Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Script to unpack WAD archive in MKSM game (PS2)

Featured Replies

  • Author
  • Localization

Alpha1001, posted Tue Nov 06, 2018 11:09 am (40152)


Hi aluigi, I want to translate the Mortal Kombat Shaolin Monks game and I would like to know if you can make for me an script to unpack the below files. I've splitted the file into 2 parts using the "files_cutter.bms" script. Thanks in advance!
https://drive.google.com/file/d/1h6gt1l ... p=drivesdk

https://drive.google.com/file/d/1B9WXSW ... p=drivesdk
  • Author
  • Localization

aluigi, posted Wed Nov 07, 2018 11:09 pm (40182)


It's a container of archived files without header or tail for the information.
Check if you have a small file called GAMEDATA with a different extension or *index* or *idx* something.
  • Author
  • Localization

aluigi, posted Fri Nov 09, 2018 10:44 am (40210)


Eh no, there is no TOC in them.
I searched both the offset and aligned offset of one of the files.
  • Author
  • Localization

Alpha1001, posted Thu Dec 06, 2018 7:29 pm (41052)


Hi aluigi, I managed to find something infos about the GAMEDATA.WAD, I did some tests to make the pointer of a file point to the other and it worked out in the game. The infos for each file into archive is an 8 bytes field, the 4 first bytes are the offset to a file into archive, the 4 first bytes *800=offset of beginning of file, the next 6 bytes it seems the filesize but I didn't understood the last 6 bytes. The TOC is in the GAMEDATA.WAD, replacing 8 bytes of a field that contains infos for the beginning of a texture in English by 8 bytes of the same texture in Spanish for example, I can make the game read the texture of Spanish instead of English.
So, with these infos do you think that is possible make an script now?
This TOC is similar to the ZDIR.BIN TOC in the Need for Speed series.
  • Author
  • Localization

aluigi, posted Fri Dec 07, 2018 10:50 pm (41111)


What you are seeing is the PWF file itself, there are N PWF files without any reference and probably other formats (non-PWF) too.
If you are talking about another TOC tell us its offset.
  • Author
  • Localization

Alpha1001, posted Sun Dec 09, 2018 5:48 pm (41160)


Hi, I want to say that the TOC is after the PWF string, as you said there is no PWF files inside the GAMEDATA, inside the GAMEDATA there is only many EWDF files and P2N textures.
  • Author
  • Localization

Alpha1001, posted Sun Dec 09, 2018 6:07 pm (41161)


The offset to the first file is in 0x20, e.g: in the 0x220 offset there is the pointer to the EWDF archive that contains the Main Menu textures. The value of this pointer is 570A, A57*800= EWDF archive with textures.
  • Author
  • Localization

aluigi, posted Sun Dec 09, 2018 10:14 pm (41175)


Ok I have updated the script http://aluigi.org/bms/mksm_ewdf.bms

It looks like there is still some space at the end of the WAD archive that is not parse and the SIZE field is a mess, but currently it works.
  • Author
  • Localization

Alpha1001, posted Mon Dec 10, 2018 9:41 am (41197)


Thanks aluigi, I've tested the bms script here and some files have been extracted. However, an error message is showed after the extraction, "this message is related with the command in the 47 line "clog NAME OFFSET SIZE XSIZE". I've replaced the XZIZE with ZSIZE and now 2959 files are extracted, but all files has 0 bytes in filesize, probably because the SIZE field is really a mess in this format.
  • Author
  • Localization

aluigi, posted Mon Dec 10, 2018 9:48 am (41198)


Updated script, version 0.1.4.
Let me know if it works.
  • Author
  • Localization

Alpha1001, posted Mon Dec 10, 2018 11:13 am (41210)


Working perfectly, 2959 files extracted properly with valids filesize. Thank you very much!
  • Author
  • Localization

Alpha1001, posted Tue Dec 18, 2018 10:46 am (41487)


Hey aluigi, I have found a new WAD archive type into the GAMEDATA.WAD, I've tried to do an script to dump the files into it, but I have failed. This is the new WAD type https://drive.google.com/file/d/1m6FxQ9 ... p=drivesdk
it seems a simple format.
  • Author
  • Localization

aluigi, posted Thu Jan 10, 2019 5:49 pm (42121)


If I touch the script anything else will no longer work, so:
Code:
idstring "PWF \0"
get SOME_SIZE threebyte
get DUMMY long # 2
get FILES long
goto 0x20
for i = 0 < FILES
    get OFFSET long
    get SIZE long
    log "" OFFSET SIZE
next i
  • Author
  • Localization

Alpha1001, posted Sun Feb 03, 2019 12:56 am (43116)


Thanks!
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.