import
os
def
numDecode(a1, a2, a3):
v4
=
0
if
a1
=
=
0
:
v4
=
1
if
a2 <
=
0
:
v4 |
=
1
if
v4:
return
-
1
v5
=
a2
-
1
v6
=
a2
a1
=
list
(a1)
while
v5:
v5
-
=
1
v7
=
a1[v6
-
2
]
a1[v6
-
2
]
=
a1[v6
-
1
]
v6
=
v6
-
1
a1[v6]
=
v7 ^ a3
a1[
0
] ^
=
a3
return
bytes(a1)
def
main():
filename
=
'd:\\1.tlw'
file
=
open
(filename,
'rb'
)
t
=
file
.read(
1
)
ver
=
b''
ver
=
ver
+
t
while
(
ord
(t)!
=
59
):
t
=
file
.read(
1
)
ver
=
ver
+
t
print
(ver)
name
=
file
.read(
4
)
print
(name)
alldata
=
b''
while
(
1
):
s
=
file
.read(
0x400
);
if
(s
=
=
b''):
break
v7
=
numDecode(s,
len
(s),
109
);
alldata
+
=
v7
open
(
'out.apk'
,
'wb'
).write(alldata)
main()