The rules have been updated, read them now: Rules!

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

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
GilgameshKOFGC
ultra-n00b
Posts: 7
Joined: Sun Mar 28, 2021 9:46 pm

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

Post by GilgameshKOFGC » Sun Mar 28, 2021 9:53 pm

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

User avatar
ikskoks
Moderator
Posts: 813
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 473 times
Been thanked: 216 times
Contact:

Re: Unpack KOFXIII

Post by ikskoks » Sun Mar 28, 2021 11:11 pm

Can you upload some archive samples?

GilgameshKOFGC
ultra-n00b
Posts: 7
Joined: Sun Mar 28, 2021 9:46 pm

Re: Unpack KOFXIII

Post by GilgameshKOFGC » Mon Mar 29, 2021 7:36 am

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

User avatar
ikskoks
Moderator
Posts: 813
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 473 times
Been thanked: 216 times
Contact:

Re: Unpack KOFXIII

Post by ikskoks » Mon Mar 29, 2021 2:52 pm

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.

GilgameshKOFGC
ultra-n00b
Posts: 7
Joined: Sun Mar 28, 2021 9:46 pm

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

Post by GilgameshKOFGC » Mon Mar 29, 2021 8:38 pm

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.

User avatar
ikskoks
Moderator
Posts: 813
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 473 times
Been thanked: 216 times
Contact:

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

Post by ikskoks » Mon Mar 29, 2021 9:52 pm

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

GilgameshKOFGC
ultra-n00b
Posts: 7
Joined: Sun Mar 28, 2021 9:46 pm

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

Post by GilgameshKOFGC » Wed Mar 31, 2021 11:42 am

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

User avatar
ikskoks
Moderator
Posts: 813
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 473 times
Been thanked: 216 times
Contact:

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

Post by ikskoks » Wed Mar 31, 2021 12:25 pm

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.

GilgameshKOFGC
ultra-n00b
Posts: 7
Joined: Sun Mar 28, 2021 9:46 pm

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

Post by GilgameshKOFGC » Wed Mar 31, 2021 5:03 pm

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 ?

User avatar
ikskoks
Moderator
Posts: 813
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 473 times
Been thanked: 216 times
Contact:

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

Post by ikskoks » Wed Mar 31, 2021 5:15 pm

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. ;)

GilgameshKOFGC
ultra-n00b
Posts: 7
Joined: Sun Mar 28, 2021 9:46 pm

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

Post by GilgameshKOFGC » Wed Mar 31, 2021 5:32 pm

Thanks,

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

User avatar
ikskoks
Moderator
Posts: 813
Joined: Thu Jul 26, 2012 5:06 pm
Location: Poland, Łódź
Has thanked: 473 times
Been thanked: 216 times
Contact:

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

Post by ikskoks » Wed Mar 31, 2021 9:17 pm

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

GilgameshKOFGC
ultra-n00b
Posts: 7
Joined: Sun Mar 28, 2021 9:46 pm

Recompiling .lua files

Post by GilgameshKOFGC » Fri Apr 02, 2021 10:22 am

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

Post Reply