Advertisement
Guest User

Untitled

a guest
Dec 15th, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.34 KB | None | 0 0
  1. def decompress_text(filedata,startword=0x9831):
  2.     newfiledata = ''
  3.     startword = 0xA695 # where does this come from?
  4.     a3 = startword
  5.     a2 = 0
  6.     t9 = 0
  7.    
  8.     a0 = ord(filedata[a2])
  9.     t0 = a3 >> 0x8
  10.     a3 = a3 & 0xFF
  11.     a0 = a0 ^ t0
  12.     v0 = a0 ^ a3
  13.     a0 = ord(filedata[a2+1])
  14.     t4 = ord(filedata[a2+2])
  15.     t7 = ord(filedata[a2+3])
  16.     t4 ^= v0
  17.     t9 = t4 ^ a3
  18.     t4 = t7 ^ v0
  19.     t7 = ord(filedata[a2+4])
  20.     t6 = a0 ^ v0
  21.     v0 = t7 ^ v0
  22.     t6 = t6 ^ t0
  23.     t8 = t4 ^ t0
  24.     v0 = v0 ^ a3
  25.  
  26.     v0 = v0 << 0x8
  27.     t7 = t8 << 0x18
  28.     t6 = t6 << 0x10
  29.     v0 = v0 | t9
  30.     t6 = t7 | t6
  31.     t5 = 0
  32.     v0 = v0 | t6
  33.     v1 = 0
  34.     t3 = 0
  35.     t2 = 0
  36.     t1 = 0
  37.     a0 = t0 ^ a3
  38.     if t5 < v0:
  39.         t7 = 1
  40.     else:
  41.         t7 = 0
  42.  
  43.     t4 = 0x5
  44.     if t7 == 1:
  45.         #089F3C9C
  46.         t6 = 0xFFFFFF00
  47.         t8 = t1 & 0x7
  48.         while t7 == 1:
  49.             t9 = t4 + 1
  50.             if t8 == 0:
  51.                 #089F3CAC
  52.                 t3 = ord(filedata[a2+t4])
  53.                 t4 = t9
  54.                 t3 ^= a0
  55.                 t9 = t4 + 0x1
  56.             else:
  57.                 #089F3CC8
  58.                 t3 = t3 >> 1
  59.  
  60.             #089F3CCC
  61.             t8 = t3 & 0x1
  62.             t1 += 1
  63.             if t8 != 0:
  64.                 #089F3CD8
  65.                 v1 = v1 >> 0x4
  66.                 if t2 == 0:
  67.                     #089F3CDC
  68.                     v1 = a2+t4
  69.                     v1 = ord(filedata[v1])
  70.                     t4 = t9
  71.                     v1 = v1 ^ a3
  72.                     t9 = t4 + 0x1
  73.                 #089F3CF8
  74.                 t8 = ord(filedata[a2+t4])
  75.                 t4 = t9
  76.                 t8 = t8 ^ a0
  77.                 t9 = t5 & 0xFF
  78.                 s0 = v1 & 0xF
  79.                 t9 = t8 ^ t9
  80.                 s0 += 0x2
  81.                 t8 = 0
  82.                 t2 = t2 ^ 0x1
  83.                 if t8 < s0:
  84.                     s1 = 1
  85.                 else:
  86.                     s1 = 0
  87.  
  88.                 t9 += 0x1
  89.                 if s1 != 0:
  90.                     #089F3D28
  91.                     t9 = t5 - t9
  92.                     t9 = a2 + t9
  93.                     t7 = 1
  94.  
  95.                     while t7 != 0:
  96.                         #089F3D34
  97.                         t7 = ord(newfiledata[t9])
  98.                         s1 = a2 + t5
  99.                         newfiledata += chr(t7 & 0xFF)
  100.                         t8 += 0x1
  101.                         t5 += 0x1
  102.                         if t8 < s0:
  103.                             t7 = 1
  104.                         else:
  105.                             t7 = 0
  106.                         t9 += 0x1
  107.                     if t5 < v0:
  108.                         t7 = 1
  109.                     else:
  110.                         t7 = 0
  111.                        
  112.             else:
  113.                 #089F3D5C
  114.                 t4 = ord(filedata[a2+t4])
  115.                 t7 = (t5 | 0x0) ^ 0b11111111
  116.                 if t7 == 0xFF:
  117.                     t7 = 0xFFFFFFFF
  118.                 t8 = t4 ^ t0
  119.                 t4 = t9
  120.                 t7 = t7 | t6
  121.                 t9 = len(newfiledata) + t5
  122.                 t7 = t8 ^ t7
  123.                 t5 += 0x1
  124.                 newfiledata += chr(t7 & 0xFF)
  125.                 if t5 < v0:
  126.                     t7 = 1
  127.                 else:
  128.                     t7 = 0
  129.                
  130.             t8 = t1 & 0x7
  131.            
  132.     return newfiledata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement