-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflpunlocker.py
67 lines (52 loc) · 1.49 KB
/
flpunlocker.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
67
import sys
import traceback
print("making backup...")
try:
file = sys.argv[1]
with open(file, "rb") as f:
with open(file+".bak", "wb+") as f2:
f2.write( f.read() )
print(f"saved to {file}.bak")
except Exception:
print("could not make backup:\n")
traceback.print_exc()
input("")
exit()
print("")
print("unlocking...")
try:
file = sys.argv[1]
print(file)
def hx(h):
if type(h) == list:
out = []
for x in h:
out.append( int(x, 16) )
return out
else:
return int(h,16)
with open(file, "rb+") as f:
content = bytearray( f.read() )
f.seek(0)
if content[42] == hx('01'):
print("could not unlock flp:\nflp is already unlocked")
input("")
exit()
content[42] = hx('01')
content[46] = hx('2E')
content[47] = hx('5B')
content[48:48] = hx((
# # # #
'00 3A 00 32 00 44 00 77 00 38 00 78 00 78 00 39 ' +
'00 64 00 32 00 78 00 37 00 75 00 3F 00 41 00 43 ' +
'00 42 00 3A 00 3A 00 38 00 3E 00 00'
).split(" "))
f.write( bytes(content) )
f.truncate()
print("flp unlocked successfully.")
input("")
except Exception:
print("could not unlock flp:\n")
traceback.print_exc()
input("")
exit()