-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.py
66 lines (36 loc) · 1.27 KB
/
test.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import time
import re
import hashlib
import angr, monkeyhex
import pefile
import codecs
import pydis
from iced_x86 import *
from lazy_ctypes import *
from vmp_unzipper import *
'''
--------------------------------------------------------------------------------------
'''
from ctypes import CFUNCTYPE, c_double
'''
--------------------------------------------------------------------------------------
'''
#proj = angr.Project("no_protections_packed_vmp1.exe")
#proj.loader
VMP_FILE_BASE = 0x140000000
SIG_VM_ENTER_DECRYPT = r'8b{2}424.+4.{1}b.{1}0{9}10{6}'
SIG_VM_ENCRYPTED_ADDRESS = r'68.{8}e8.{8}'
SIG_VM_HANDLERS_STUFF = r'(4c8d1d.{8}.+4881(c6010{6}|ee010{6}))'
pe = pefile.PE('C:\\Users\\mibho\\Desktop\\vmp_notes\\maybe_post\\no_protections_packed_vmp1.exe')
entry = pe.OPTIONAL_HEADER.AddressOfEntryPoint
ep_addr = entry + pe.OPTIONAL_HEADER.ImageBase
data = pe.get_memory_mapped_image()
test = vmp_unzipper()
test.load_file('C:\\Users\\mibho\\Desktop\\vmp_notes\\maybe_post\\no_protections_packed_vmp2.exe')
test.get_file_data()
test.get_vm_ep_data()
test.get_bytecode_addresses()
test.get_decryption_routine()
test.interpret_lines()
test.manual_search_for_handlers()
test.get_handler_code()