ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Oct 27, 2020 5:18 pm

All times are UTC




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Sep 03, 2020 11:09 pm 

Joined: Thu Sep 03, 2020 10:41 pm
Posts: 1
Hello !
I'm sorry if my english is not correct. ^^
Before I explain my problem, I wanted to thank for all the work that has been done on QuickBMS, this is great tool which is very useful.

To sum up, I've used the script available for this game (it's actually great to see at least a script available for this game, since the format of the files are quite horrible to read), I've modified some files that were extracted from the .PAK files of the game and I wanted to reimport them. Unfortunately, it didn't worked.
I wasn't aware that there was an issue with scripts using MEMORY_FILEs. I felt dumb for not checking what the reimport mode could do or not. I was about to give up but then I wanted to know if it was possible to, maybe, modify the script and avoid using MEMORY_FILEs.
Just wanted to know if it's possible, then I could try to learn how .bms scripts work and change this script.

The link of the script :
https://aluigi.altervista.org/bms/lotr_conquest.bms
The link of an example of a .PAK file :
http://www.mediafire.com/file/pc84lwlv0 ... a.PAK/file

Thank you in advance to anyone who may be able to help me.


Top
   
PostPosted: Wed Sep 16, 2020 7:08 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11696
It's not impossible but it's very difficult that it's going to work because there are two big chunks of compressed data that contains all the files, then there is a second part that dumps additional stuff.

So it's not possible to avoid the memory file, it's possible to split the script in two parts where you can use the first part to reimport the files in the two chunks and the second part for compressing these two chunks.

Use this script for both extraction and reimporting:
Code:
get EXT extension
if EXT == "pak"

    get DUMMY long
    get SOME_TABLE_OFFSET long
    get DUMMY long  # 0x13
    get DUMMY long  # 0x1
    get STRINGS_OFF long
    get DUMMY long
    get DUMMY long

    for i = 0 < 2   # only two?
        get OFFSET long
        get SIZE long
        get ZSIZE long
        get INFO_OFF long
        string NAME p "part%d_0x%08x" i INFO_OFF
        clog NAME OFFSET ZSIZE SIZE
    next i

else

    get INFO_OFF basename
    string INFO_OFF ! "_"
    goto INFO_OFF
    get ZERO long
    get FILES long
    getdstring ZERO 8
    for j = 0 < FILES
        get DUMMY long
        get OFFSET long
        get SIZE long
        math OFFSET += INFO_OFF
        log "" OFFSET SIZE
    next j

endif


Extraction (it will ask you to create these 3 folders):
Code:
quickbms script.bms Moria.PAK Moria
quickbms script.bms Moria\part0_0x00528300 Moria\part0
quickbms script.bms Moria\part1_0x00000000 Moria\part1


Reimporting:
Code:
quickbms -r -r -w script.bms Moria\part0_0x00528300 Moria\part0
quickbms -r -r -w script.bms Moria\part1_0x00000000 Moria\part1
quickbms -r -r -w script.bms Moria.PAK Moria


Hope it helps.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

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