Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def decompress_text(filedata,startword=0x9831):
- newfiledata = ''
- startword = 0xA695 # where does this come from?
- a3 = startword
- a2 = 0
- t9 = 0
- a0 = ord(filedata[a2])
- t0 = a3 >> 0x8
- a3 = a3 & 0xFF
- a0 = a0 ^ t0
- v0 = a0 ^ a3
- a0 = ord(filedata[a2+1])
- t4 = ord(filedata[a2+2])
- t7 = ord(filedata[a2+3])
- t4 ^= v0
- t9 = t4 ^ a3
- t4 = t7 ^ v0
- t7 = ord(filedata[a2+4])
- t6 = a0 ^ v0
- v0 = t7 ^ v0
- t6 = t6 ^ t0
- t8 = t4 ^ t0
- v0 = v0 ^ a3
- v0 = v0 << 0x8
- t7 = t8 << 0x18
- t6 = t6 << 0x10
- v0 = v0 | t9
- t6 = t7 | t6
- t5 = 0
- v0 = v0 | t6
- v1 = 0
- t3 = 0
- t2 = 0
- t1 = 0
- a0 = t0 ^ a3
- if t5 < v0:
- t7 = 1
- else:
- t7 = 0
- t4 = 0x5
- if t7 == 1:
- #089F3C9C
- t6 = 0xFFFFFF00
- t8 = t1 & 0x7
- while t7 == 1:
- t9 = t4 + 1
- if t8 == 0:
- #089F3CAC
- t3 = ord(filedata[a2+t4])
- t4 = t9
- t3 ^= a0
- t9 = t4 + 0x1
- else:
- #089F3CC8
- t3 = t3 >> 1
- #089F3CCC
- t8 = t3 & 0x1
- t1 += 1
- if t8 != 0:
- #089F3CD8
- v1 = v1 >> 0x4
- if t2 == 0:
- #089F3CDC
- v1 = a2+t4
- v1 = ord(filedata[v1])
- t4 = t9
- v1 = v1 ^ a3
- t9 = t4 + 0x1
- #089F3CF8
- t8 = ord(filedata[a2+t4])
- t4 = t9
- t8 = t8 ^ a0
- t9 = t5 & 0xFF
- s0 = v1 & 0xF
- t9 = t8 ^ t9
- s0 += 0x2
- t8 = 0
- t2 = t2 ^ 0x1
- if t8 < s0:
- s1 = 1
- else:
- s1 = 0
- t9 += 0x1
- if s1 != 0:
- #089F3D28
- t9 = t5 - t9
- t9 = a2 + t9
- t7 = 1
- while t7 != 0:
- #089F3D34
- t7 = ord(newfiledata[t9])
- s1 = a2 + t5
- newfiledata += chr(t7 & 0xFF)
- t8 += 0x1
- t5 += 0x1
- if t8 < s0:
- t7 = 1
- else:
- t7 = 0
- t9 += 0x1
- if t5 < v0:
- t7 = 1
- else:
- t7 = 0
- else:
- #089F3D5C
- t4 = ord(filedata[a2+t4])
- t7 = (t5 | 0x0) ^ 0b11111111
- if t7 == 0xFF:
- t7 = 0xFFFFFFFF
- t8 = t4 ^ t0
- t4 = t9
- t7 = t7 | t6
- t9 = len(newfiledata) + t5
- t7 = t8 ^ t7
- t5 += 0x1
- newfiledata += chr(t7 & 0xFF)
- if t5 < v0:
- t7 = 1
- else:
- t7 = 0
- t8 = t1 & 0x7
- return newfiledata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement