Seeking advice for my repacking script

Programming related discussions related to game research
Procyon
Posts: 7
Joined: Thu Sep 21, 2017 5:00 am

Seeking advice for my repacking script

Post by Procyon »

Hello,

There is a game I wish to modify, and due to the number of items I wish to change, I felt that I must build a repacking script before any significant progress can be made.

User Ekey was kind enough to provide me with his extracting script in this link:
http://forum.xentax.com/viewtopic.php?f=10&t=13147

For past several days I have taken a look at various forum posts dealing with repacking scripts, and I have attempted to create one of my own. But to be completely honest, I am new to all this; may I have some pointers as to the various skills I would need to educate myself with beforehand? Thank you.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Seeking advice for my repacking script

Post by aluigi »

The latest version of the script is http://aluigi.org/bms/nxpk.bms but yes the core of the first format is that one.

My suggestion is to NOT use quickbms for creating rebuilding tools/scripts.

Then you have 3 CRC fields there so you must figure out what algorithm is used to calculate them.
Remember to use flag 0 with equal SIZE and ZSIZE (non-compressed file).
The first VER* fields are not very clear, probably you have to use those of the archive you want to rebuild.
Last but not least the names in the .hash and .info files are associate to the md5 of the compressed files stored in the archive so if you "modify" the file you must modify the hash in these files too.

Good luck
Procyon
Posts: 7
Joined: Thu Sep 21, 2017 5:00 am

Re: Seeking advice for my repacking script

Post by Procyon »

Thank you for helping me on this matter. I have another question or two, if I may.

Thank you for linking me to the 0.3.6 version of the script. It appears to me that both this script (the one I linked - 0.1.1) and that script (0.3.6) give same outputs in terms of files. May I ask as to the exact benefits that comes from using this updated script?

My second question: if using QuickBMS here is not recommended, should I use, for example, MultiEx instead?

Thank you.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Seeking advice for my repacking script

Post by aluigi »

The updated script is necessary with some versions of the NXPK archives and for supporting the filenames (if available).

MultiEx is not a programming language so it's totally useless in this scenario.

I guess that using the reimport feature of quickbms didn't make the archive working with the game due to the CRC fields, right?

You must write a tool from scratch in the programming language you know.
Procyon
Posts: 7
Joined: Thu Sep 21, 2017 5:00 am

Re: Seeking advice for my repacking script

Post by Procyon »

Ahh... I guess that's why the reimport feature did not work.

I'll fiddle around with Python in that case. Thank you for helping me on this matter.
Procyon
Posts: 7
Joined: Thu Sep 21, 2017 5:00 am

Re: Seeking advice for my repacking script

Post by Procyon »

To aluigi,

I have found an example of an extraction code in Python Language on this website: https://zhuanlan.zhihu.com/p/24998664

I'm not sure if you know the python language, but I would greatly appreciate it if you took a look at the code within the link to see if it'll help me create a rebuilding script. Thank you.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Seeking advice for my repacking script

Post by aluigi »

I don't write rebuilders.
If you mean a "rebuilding script" in bms language forget it because bms is not good for that job.
Procyon
Posts: 7
Joined: Thu Sep 21, 2017 5:00 am

Re: Seeking advice for my repacking script

Post by Procyon »

Of course, I will be the one making the rebuilding script, not you. What I'm asking is if you have any experience in Python, and to see if that code will help me. All I need is a second eye to observe the situation.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Seeking advice for my repacking script

Post by aluigi »

If "you" are going to write the rebuilder why do you ask "me" if that link is helpful to you???

Just FYI:
http://aluigi.org/bms/nxpk.bms
Procyon
Posts: 7
Joined: Thu Sep 21, 2017 5:00 am

Re: Seeking advice for my repacking script

Post by Procyon »

Will it suffer you that greatly to take a glance at the link I provided and tell me your thoughts on it?

If you will not, than this is my final word on this subject.
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: Seeking advice for my repacking script

Post by Acewell »

i would say until you can reproduce the hashing algorithm by NetEase, that python code will do you no good. :)

All Hashes are calculated use a private algorithm from NetEase, it can even be implemented differently.

You can call it by DEBUGGING.
Procyon
Posts: 7
Joined: Thu Sep 21, 2017 5:00 am

Re: Seeking advice for my repacking script

Post by Procyon »

I see, thank you. I'll think of what to do next. (Y)