ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Sep 21, 2019 12:39 am

All times are UTC




Post new topic  Reply to topic  [ 24 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Sat Jan 23, 2016 7:17 pm 

Joined: Fri Jan 22, 2016 4:37 am
Posts: 35
The fangame Super Smash Bros. crusade has since put this weird format on the games resources as ".BIN". I haven't really found a good way to crack it though but if it's safe to ask, is it possible to do so by any chance? If this shouldn't be asked about though feel free to lock I guess.


Top
   
PostPosted: Sun Jan 24, 2016 10:32 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
Do you mean that this format is different than http://aluigi.org/bms/super_smash_bros.bms ?
If yes, please provide a sample archive.


Top
   
PostPosted: Sat Jan 30, 2016 9:33 pm 

Joined: Fri Jan 22, 2016 4:37 am
Posts: 35
Sorry for the silence, But here's a sample.
https://www.mediafire.com/?6r860q34ivk9onz


Top
   
PostPosted: Sat Jan 30, 2016 9:43 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
No idea about that file. The nintendo decompression doesn't work on it.


Top
   
PostPosted: Sat Jan 30, 2016 9:53 pm 

Joined: Fri Jan 22, 2016 4:37 am
Posts: 35
It's not exactly an offical Nintendo game though. Basically a fangame. I dunno what compression they used.


Top
   
PostPosted: Sat Jan 30, 2016 10:54 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
Ah ok.
Well, basically these bin archives are xored with the key "runaway_horses_take_us_through_the_night" and then decompressed by the HuffDecompress(input_file_path, output_file_path) function of PAK_File.dll

I don't have that algorithm in quickbms so I guess the only option is writing a script that calls the function of the dll.
I will keep you update.


Top
   
PostPosted: Sat Jan 30, 2016 11:07 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
http://aluigi.org/bms/super_smash_bros_crusade.bms


Top
   
PostPosted: Sat Jan 30, 2016 11:13 pm 

Joined: Fri Jan 22, 2016 4:37 am
Posts: 35
Really nice. Thanks. :3 I'll probably ask how to repack them some other time. But for now I think things are settled. Much obliged.



Just tell me whenever how I recompile this back to a .BIN I guess so I can test my changes ingame.


Top
   
PostPosted: Sun Jan 31, 2016 11:12 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
PAK_File.dll contains all the functions to do everything you desire with the bin archives.
You need to know a bit of programming and reverse engineering (to find the arguments of the exported functions) to use it:
Code:
Name            Address  Ordinal     
----            -------  -------     
SaveToFile      00413EB4 1           
AddFromFile     00413E1C 2           
GetFileSize     00413DB8 3           
SetFileContents 00413D5C 4           
GetFileContents 00413CAC 5           
GetFileIndex    00413BE8 6           
GetFileCount    00413BB8 7           
DeleteFile      00413B4C 8           
RenameFile      00413AC8 9           
AddFile         00413A44 10         
SavePAK         004139D8 11         
LoadPAK         0041396C 12         
Reset           00413930 13         
_Free           00413914 14         
_Init           004138E4 15         
HuffDecompress  0041385C 16         
HuffCompress    004137CC 17         
XORCrypt        0041370C 18         
DllEntryPoint   00413FF8 [main entry]

Personally I'm not interested, but it should be an easy job if someone is interested.

The alternative is using the reimport feature of quickbms in 3 steps:
  • reimport
  • HuffCompress
  • xor

If you want to try it do the following:
  • use the original script to extract the files of one bin archive (for example pacman.bin)
  • do NOT delete temp.bin
  • use reimport.bat selecting the script 1 you see below and selecting temp.bin and the sub-folder where have been extracted the files (for example inside the \pacman\ folder)
  • use script 2 on temp.bin
  • it will generate a new file called output.bin
I have tested it here and it works.

SCRIPT 1 to use in REIMPORT mode on temp.bin and the extraction sub-folder
Code:
# USE reimport.bat!
idstring "PACK"
get OFFSET long
get FILES long
math FILES / 0x40
goto OFFSET
for i = 0 < FILES
    getdstring NAME 0x38
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE
next i


SCRIPT 2 to use on temp.bin, you muse have PAK_File.dll in the same folder of quickbms:
Code:
# do NOT use reimport.bat!
get NAME filename
CallDLL "PAK_File.dll" "HuffCompress" __stdcall RET NAME TEMPORARY_FILE

open "." TEMPORARY_FILE
get SIZE asize
log TEMPORARY_FILE 0 SIZE
encryption xor "runaway_horses_take_us_through_the_night"
log "output.bin" 0 SIZE
encryption "" ""


Usage example from command-line covering extraction and the 2 steps explained now:
Code:
quickbms super_smash_bros_crusade.bms z:\pacman.bin z:\folder
quickbms -w -r 1.bms Z:\folder\temp.bin Z:\folder\pacman
quickbms 2.bms Z:\folder\temp.bin Z:\folder


Top
   
PostPosted: Sun Jan 31, 2016 4:11 pm 

Joined: Fri Jan 22, 2016 4:37 am
Posts: 35
Thanks, Just wondering though: Where can I get those 3 scripts compiled though? Sorry if I'm asking a lot, if you want I can just do it myself somehow I guess.


Top
   
PostPosted: Sun Jan 31, 2016 6:05 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
What you mean?
They are quickbms scripts...


Top
   
PostPosted: Sun Jan 31, 2016 6:43 pm 

Joined: Fri Jan 22, 2016 4:37 am
Posts: 35
Having a bit of trouble. I'm not getting an "output.bin"

Edit: Never mind, Figured out.


Top
   
PostPosted: Sun May 26, 2019 1:04 am 

Joined: Sun May 26, 2019 1:03 am
Posts: 6
When I use the BMS script posted by Aluigi. I don't get an output file, I get a "temporary file". what do I do with that?


Top
   
PostPosted: Sun May 26, 2019 2:16 pm 

Joined: Sun May 26, 2019 1:03 am
Posts: 6
Thank you


Top
   
PostPosted: Sun May 26, 2019 3:13 pm 

Joined: Sun May 26, 2019 2:59 pm
Posts: 1
I can't seem to extract the bin files from the newer version of this game.
When I use the script that was posted, QuickBMS crashes

https://i.imgur.com/wP5IjAp.png

Here's a sample:
https://www.mediafire.com/file/k9zd1b0o ... c.bin/file


Top
   
PostPosted: Tue May 28, 2019 7:12 pm 

Joined: Sun May 26, 2019 1:03 am
Posts: 6
i'm having the same issue. Should I make a new thread about it or should I post here, Aluigi


Top
   
PostPosted: Tue May 28, 2019 11:06 pm 

Joined: Sun May 26, 2019 1:03 am
Posts: 6
Now I didn't make this, A luigi did. EVery time I use it the cmd closes and it gives me a temporary file and some kind of .bin file but it does not extract them, rather it just crashes. Can Aluigi fix this?


Attachments:
mac.bin [4.11 MiB]
Downloaded 63 times
super_smash_bros_crusade.bms [67.4 KiB]
Downloaded 68 times
Top
   
PostPosted: Sat Jun 01, 2019 7:56 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
Maybe the encryption key is changed, don't know just guessing.


Top
   
PostPosted: Sun Jun 02, 2019 6:24 pm 

Joined: Sun May 26, 2019 1:03 am
Posts: 6
Is there a possible way to fix this?


Top
   
PostPosted: Mon Jun 03, 2019 12:29 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
Not without the required information (keys, formats, whatever)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 24 posts ]  Go to page 1 2 Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited