-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathcodebin2js.py
More file actions
46 lines (37 loc) · 730 Bytes
/
codebin2js.py
File metadata and controls
46 lines (37 loc) · 730 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import struct
import os
j = 0;
payload = ""
try:
f = open("wiiuhaxx_loader.bin", "rb")
while True:
B = struct.unpack(">B", f.read(1))[0];
payload += "0x%02x, " % (B)
j+=1
except:
payload += "\n"
for i in range(j&0x03):
payload += "0x00, "
payload += "\n"
payload += "0x00, 0x80, 0x00, 0x00,\n"
j+=4
try:
f = open("code550.bin", "rb")
while True:
B = struct.unpack(">B", f.read(1))[0];
payload += "0x%02x, " % (B)
j+=1
except:
payload += ""
for i in range(j&0x03):
payload += "0x00,"
payload += "\n"
#nop
nop = "";
for i in range(j, 0x8000, 4):
nop += "0x60, 0x00, 0x00, 0x00, "
nop += "\n"
print "["
print nop
print payload
print "]"