ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Oct 21, 2017 1:17 am

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Apr 05, 2017 1:22 pm 

Joined: Fri Nov 18, 2016 11:21 am
Posts: 7
Then how do I reimport the file back?
I read that MEMORY files that use append are not supported but how then I reimport it? I'm not good at programming


Top
   
PostPosted: Wed Apr 05, 2017 4:01 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
Some versions ago I worked on the reimporting of memory files and in my (simple) tests it worked but in practice it looks like there are problems.
memory files are used with content that can't be dumped in one operation but requires multiple operations like chunked files or multiple level of encryptions.
In some scripts (like asura.bms) a memory or temporary file is used for the compressed archives for automatically decompressing and extracting them in a transparent way for the user.

In short there is no solution to the problem.
Anyway what's the script you are using?


Top
   
PostPosted: Wed Apr 05, 2017 5:02 pm 

Joined: Fri Nov 18, 2016 11:21 am
Posts: 7
aluigi wrote:
Some versions ago I worked on the reimporting of memory files and in my (simple) tests it worked but in practice it looks like there are problems.
memory files are used with content that can't be dumped in one operation but requires multiple operations like chunked files or multiple level of encryptions.
In some scripts (like asura.bms) a memory or temporary file is used for the compressed archives for automatically decompressing and extracting them in a transparent way for the user.

In short there is no solution to the problem.
Anyway what's the script you are using?


http://aluigi.altervista.org/bms/arcsys.bms
This one, thank you so much for reply!


Top
   
PostPosted: Thu Apr 06, 2017 10:18 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
That script is like asura.bms so there are some chances of using it in reimport mode but it's necessary to split it in 2 parts and removing all the references to MEMORY_FILE, currently I can't help you so you have to wait.


Top
   
PostPosted: Thu Apr 06, 2017 10:40 am 

Joined: Fri Nov 18, 2016 11:21 am
Posts: 7
aluigi wrote:
That script is like asura.bms so there are some chances of using it in reimport mode but it's necessary to split it in 2 parts and removing all the references to MEMORY_FILE, currently I can't help you so you have to wait.


Sure, I will wait. Thank you so much for trying to help!


Top
   
PostPosted: Sat Apr 29, 2017 9:16 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6885
I'm checking the script just now.
The script is able to handle 3 different formats that are basically just the same archive that can be splitted in compressed chunks (segs), compressed (dfas) and not compressed (pfd).

The problem is the first one, the chunks-based format.
I don't know if the game runs with a dfas or pfd archive if it expects a segs one, probably not.

That's the first part of the script, the second part is not a problem.
Anyway if you want to test:

STEP1.bms:
Code:
get BASE_NAME basename
string BASE_NAME += /
comtype deflate
endian big
getdstring SIGN 4
math WORKAROUND = 0
if SIGN == "segs"
    get DUMMY short
    get CHUNKS short
    get FULL_SIZE long
    get FULL_ZSIZE long
    savepos BASE_OFF
    xmath BASE_OFF "BASE_OFF + (CHUNKS * 8)"
    #putvarchr "step1.dat" 0 FULL_SIZE
    log "step1.dat" 0 0
    append
    for i = 0 < CHUNKS
        get ZSIZE short
        get SIZE short
        get OFFSET long
        math OFFSET -= 1
        if i == 0
        if OFFSET == 0
            math WORKAROUND = 1
        endif
        endif
        if WORKAROUND != 0
            math OFFSET + BASE_OFF
        endif
        if SIZE == 0
            math SIZE = 0x00010000
        endif
        clog "step1.dat" OFFSET ZSIZE SIZE
    next i
    append
elif SIGN == "DFAS"
    endian little
    comtype zlib
    idstring "FPAC"
    get SIZE long
    get ZSIZE long
    savepos OFFSET
    clog "step1.dat" OFFSET ZSIZE SIZE
else
    # pfd
    get SIZE asize
    log "step1.dat" 0 SIZE
endif

STEP2.bms:
Code:
goto 0 
get FULL_SIZE asize
endian big
getdstring TYPE 4
if TYPE == ""   # pfd
    get DUMMY long
    get DUMMY long
    get FILES long
    savepos BASE_OFF
    for BASE_OFF = BASE_OFF < FULL_SIZE
        get HEADDATA_SIZE long
        get SIZE long
        get OFFSET long
        get DUMMY long
        get DUMMY long
        get NAME string
        math OFFSET += BASE_OFF
        set FNAME string BASE_NAME
        string FNAME += NAME
        log FNAME OFFSET SIZE
        math BASE_OFF += HEADDATA_SIZE
        goto BASE_OFF
    next
elif TYPE == "FPAC"
    endian little
    get BASE_OFF long
    get TOT_SIZE long
    if TOT_SIZE != FULL_SIZE
      endian big
      ReverseLong BASE_OFF
      ReverseLong TOT_SIZE
    endif
    get FILES long
    get DUMMY long
    get NAMELEN long
    get DUMMY long
    get DUMMY long
    for i = 0 < FILES
       getdstring NAME NAMELEN
       get FILEID long
       get OFFSET long
       get SIZE long
       Padding 16  0
       math OFFSET += BASE_OFF
       set FNAME string BASE_NAME
       string FNAME += NAME
       log FNAME OFFSET SIZE
    next i
else
    get NAME basename
    get EXT extension
    string NAME += "_unpacked."
    string NAME += EXT
    set FNAME string BASE_NAME
    string FNAME += NAME
    log FNAME 0 FULL_SIZE
endif

As you can see it's just like the original script but it's splitted in 2 parts and all the references to the output memory_file have been replaced with "step1.dat", while the input memory_file have been just removed


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 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