Page 1 of 1

The King of Fighters XIII - PCS, BNK and LUA files

Posted: Sun Mar 28, 2021 9:53 pm
by GilgameshKOFGC
Hello

I want to mod a pc game (The King of Fighters XIII) it's a Japanese 2d fighting game

But all the content I want to change is packed, I tried using QuickBMS but can't find a working script, the game has almost zero mods except a boss unlocker and an hitbox viewer

I have zero experience in modding but I really want to mod that specific game, my modifications are pretty basic, just some tweaks on dmg/hp/speed...etc

Thanks for your time

Re: Unpack KOFXIII

Posted: Sun Mar 28, 2021 11:11 pm
by ikskoks
Can you upload some archive samples?

Re: Unpack KOFXIII

Posted: Mon Mar 29, 2021 7:36 am
by GilgameshKOFGC
I uploaded and archive about 120 Mo of various files of various folders
https://mega.nz/file/2pwgiZjK#u7Lwz0oz1 ... OC2zFcl8eI


Most files are .lua / .pcs / .pso
I think i identified character files, opened with an hex editor but can't seem to find what matches to what

Like i said the modifications i want to do are nothing funky

-Edit character variable (name,speed,hp,dmg,states,colors)
-Edit hitboxes,sprites
-Edit a move input
-Swap stages,voices


A look of the game folder

Image
Image

Thank you very much

Re: Unpack KOFXIII

Posted: Mon Mar 29, 2021 2:52 pm
by ikskoks
As for PCS files, we have already documentation on this http://wiki.xentax.com/index.php/King_O ... CS_TEXLIST
Images can be extracted using Game Extractor and then vieved in texture finder https://i.imgur.com/RxXg0T4.png

As for BNK files, they seems to be standard Wwise SoundBanks http://wiki.xentax.com/index.php/Wwise_ ... nk_(*.bnk)
and they can be played in foobar without any issues https://i.imgur.com/RNIwz4s.png

As for LUA files, they probably contain values you are looking for, but they seems to be encrypted.
Someone needs to figure out encryption method before doing any changes in these files will be possible.

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Mon Mar 29, 2021 8:38 pm
by GilgameshKOFGC
I have found that on another forum
.luas are XORed with 0x66 key and compiled. I used unluac (unluac_2015_06_13.jar) for decompiling.

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Mon Mar 29, 2021 9:52 pm
by ikskoks
Ok, yeah, in this case it is easy.

First you need to use xor tool from aluigi's site http://aluigi.altervista.org/mytoolz/xor.zip

For example:

Code: Select all

xor.exe game_config.lua game_config.lua_new 0x66

Then you just need to decompile it with this decompiler https://sourceforge.net/projects/unluac ... r/download

For example:

Code: Select all

java -jar unluac_2015_06_13.jar game_config.lua_new > game_config.lua_out

And then you will see decompiled code https://i.imgur.com/TA0Q3z1.png

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Wed Mar 31, 2021 11:42 am
by GilgameshKOFGC
I am sorry to be such a mess but i don't know how to use xor tools, if i undestood well it runs on python (which i have absolutely no knowledge) i tried to download it and inserted your code but it does nothing

For .pcs when i use game extractor and i try to open some random background or character files i get some unamedfile00001.l8 or .dxt file

The other post for the same game on Zenhax https://zenhax.com/viewtopic.php?f=12&t ... f+fighters

Thanks

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Wed Mar 31, 2021 12:25 pm
by ikskoks
i don't know how to use xor tools, if i undestood well it runs on python (which i have absolutely no knowledge) i tried to download it and inserted your code but it does nothing
This tool fro aluigi is compiled C program and can be run from command line.
Please google something like "how to run command line program" and then follow the tutorial.

i get some unamedfile00001.l8 or .dxt file
Yes, those are unpacked image files and they can be viewed in texture finder or in raw texture cooker with the proper settings.
I have posted one example of the correct settings in the previous post. Just look at the file extension to determine pixel format.

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Wed Mar 31, 2021 5:03 pm
by GilgameshKOFGC
I managed to recreate the .lua you did + one another decompiling

thanks you very much that's 1st big step for me

what is the procedure when i modified my file to recompile it and put it in my game ?

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Wed Mar 31, 2021 5:15 pm
by ikskoks
I would say that you need to find a compiler that will generate the same output as the original and after compiling you should xor your lua file with 0x66 and replace the original file.
But I'm not sure if it is 100% correct way, I've never done any lua compiling. ;)

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Wed Mar 31, 2021 5:32 pm
by GilgameshKOFGC
Thanks,

By the way is there a way to mass xor then decompile all my .lua files?

Re: The King of Fighters XIII - PCS, BNK and LUA files

Posted: Wed Mar 31, 2021 9:17 pm
by ikskoks
Yeah, you could use BAT script for that.
Here are some example scripts:
https://github.com/bartlomiejduda/Tools ... FOLDER.BAT
https://github.com/bartlomiejduda/Tools ... mplate.bat

Recompiling .lua files

Posted: Fri Apr 02, 2021 10:22 am
by GilgameshKOFGC
Hi

I manage to xor and unluac with 0x66 key the .lua files for the game i want to mod but i don't know how to recompile them and put them in my game.

I have almost zero experience in modding / compiling / decompiling.

Thanks for your time