For loop xor code needs tweaking - misses end of file
Opened this issue · 0 comments
bgbennyboy commented
The code for the for loops (lines 151-155) needs tweaking. It misses a case in ggpack1 in the latest version. 5 bytes from the end the filename ends up as "zzycwhjpjk#ogg"
The second for loop doesnt catch it because its less than 6 bytes from the end.
Possible fixes:
Replace both for loops with a while
i = 5
while i+1 < buf_len:
buffer[i] = buffer[i] ^ 0x0D
buffer[i+1] = buffer[i+1] ^ 0x0D
i += 16
Or combine the for loops:
for i in range(5, buf_len - 5, 16):
buffer[i] = buffer[i] ^ 0x0D
buffer[i+1] = buffer[i+1] ^ 0x0D