-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathanalysis.py
31 lines (24 loc) · 863 Bytes
/
analysis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import lief
from lief import PE
packed = PE.parse('packed.exe')
loader = PE.parse('shifted-loader.exe')
with open('packed-analysis.txt', 'w+', encoding='utf-8') as out:
print('-----'*20, file=out)
print('packed.exe', file=out)
print('-----'*20, file=out)
print(packed.header, file=out)
print(packed.optional_header, file=out)
for entry in packed.data_directories:
print(entry, file=out)
for s in packed.sections:
print(s, file=out)
with open('loader-analysis.txt', 'w+', encoding='utf-8') as out:
print('-----'*20, file=out)
print('shifted-loader.exe', file=out)
print('-----'*20, file=out)
print(loader.header, file=out)
print(loader.optional_header, file=out)
for entry in loader.data_directories:
print(entry, file=out)
for s in loader.sections:
print(s, file=out)