brink.bms - last file extraction bug

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

brink.bms - last file extraction bug

Post by AnonBaiter »

uhh
not to ruin your fun or anything but for some reason, when using brink.bms[1] on some PSARC files, the last file will always have a MD5 hash as its filename when extracted even when said filename is there

sample file is in the attachment, just so anyone can reproduce this stupid bug for themselves

[1] i use "script 0.4.1" of brink.bms through quickbms 0.9.0
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: brink.bms - last file extraction bug

Post by AnonBaiter »

okay, i'll just solve the bug myself

see this part of the brink.bms script?

Code: Select all

[line 138-146]
for x = 0 < NAMES
   getarray TMP1 11 x
   getarray TMP2 12 x
   getarray TMP3 13 x
   if TMP1 == NAME_HASH || TMP2 == NAME_HASH || TMP3 == NAME_HASH
      getarray NAME 10 x
      break
   endif
next x
now let's take a closer look at line 138

Code: Select all

for x = 0 < NAMES
see the "<" symbol? that's what causes the last file to be extracted with a MD5 hash kind of filename
here's how the script can be fixed, by replacing the "<" symbol with the "<=" symbol just like you're seeing below

Code: Select all

for x = 0 <= NAMES
it was too damn easy a fix you wish this would have been solved by now
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: brink.bms - last file extraction bug

Post by aluigi »

I guess was necessary to restore the NAMES var after the cycle in the LOAD_FILENAMES functions, there is a "math NAMES - 1" that is not restored later
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: brink.bms - last file extraction bug

Post by AnonBaiter »

how are you going to "solve" this though?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: brink.bms - last file extraction bug

Post by aluigi »

"math NAMES + 1" at line 180 before "endif"
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: brink.bms - last file extraction bug

Post by AnonBaiter »

should be good enough