-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
28 lines (20 loc) · 708 Bytes
/
Main.py
File metadata and controls
28 lines (20 loc) · 708 Bytes
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
#!/usr/bin/python
import binascii
from Engine import Engine
def print_code():
address = 0
with open('722531-1996-UK-SVX-EG33.bin', 'r+b') as f:
while True:
bytes = binascii.hexlify(f.read(16))
if not bytes:
break
bytes = ' '.join([bytes[i:i + 2] for i in range(0, len(bytes), 2)])
print("{} {}".format('0x' + hex(address)[2:].zfill(4), bytes))
address += 16
f.seek(address)
if __name__ == '__main__':
engine = Engine(0x9000)
engine.parse_instruction('cmp al, #0x0100')
# engine.parse_instruction('adc ax, 0x1060')
# engine.parse_instruction('and ax, #0x00ff')
print(engine.r)