Arslan the warriors of legend

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Arslan the warriors of legend

Post by sigroon365 »

Can someone let me know what is the comtype of this file?

Code: Select all

open FDDE IDX 0
open FDDE BIN 1

For
     get OFFSET longlong 0
     get SIZE longlong 0
     get ZSIZE longlong 0
     get TYPE longlong 0

     if SIZE == ZSIZE
     log "" OFFSET SIZE 1
     elif SIZE > ZSIZE
     clog "" OFFSET SIZE ZSIZE 1
     elif ZSIZE == 0
     break
endif

Next


Image
Last edited by sigroon365 on Fri Mar 04, 2016 6:33 pm, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Arslan the warriors of legend

Post by aluigi »

Use http://aluigi.org/bms/filecutter.bms to upload the first part of the BIN file and upload the whole IDX file.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Arslan the warriors of legend

Post by aluigi »

sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

aluigi wrote:http://aluigi.org/bms/arslan.bms


Oh, I would upload part of bin file, but you've already made bms script! Thanks a lot. :)
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

aluigi wrote:http://aluigi.org/bms/arslan.bms

Hmm.. what does it mean?
Image
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Arslan the warriors of legend

Post by aluigi »

I don't know because the zip you provided was corrupted (even if it was 3,2 Gb) and so LINKDATA.BIN was only 2,4 Gb, I arrive only to 00000090.dat

*edit* MD5 of the zip is eb3a0babbc8e44569813fbb066196699 here.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

aluigi wrote:I don't know because the zip you provided was corrupted (even if it was 3,2 Gb) and so LINKDATA.BIN was only 2,4 Gb, I arrive only to 00000090.dat

*edit* MD5 of the zip is eb3a0babbc8e44569813fbb066196699 here.


Hmm.. my MD5 is B3C5FBF4B48983482BCB47A0A66984C6 I will upload it again.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

Last edited by sigroon365 on Fri Mar 04, 2016 6:32 pm, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Arslan the warriors of legend

Post by aluigi »

Fixed in 0.1.1.
I'm not sure if the extracted files are so useful, they appear to be big containers of data... probably it's necessary another script to work with them but doesn't seem a simple format.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

aluigi wrote:Fixed in 0.1.1.
I'm not sure if the extracted files are so useful, they appear to be big containers of data... probably it's necessary another script to work with them but doesn't seem a simple format.


Yes it is. The unpacked files are too big. :roll:
Image
semory
Posts: 5
Joined: Fri Aug 08, 2014 6:29 am

Re: Arslan the warriors of legend

Post by semory »

this has unpacking support for PC Arslan:
http://www.mediafire.com/download/xo28e ... 6-02-24.7z
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

semory wrote:this has unpacking support for PC Arslan:
http://www.mediafire.com/download/xo28e ... 6-02-24.7z


Thanks a lot. it would be helpful for analysis.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Arslan the warriors of legend

Post by aluigi »

Various big files like those with the sdb, nfc, vap and some dat entensions have this format:

Code: Select all

get FILES long
for i = 0 < FILES
    get OFFSET long
    get SIZE long
    log "" OFFSET SIZE
next i

And, what's worst, is that even some of the files extracted with this method are archives themselve.
For example the first file of 00000049.sdb is an archive.
There is no concrete way to guess this format without names and so it's not possible to automatize the extraction.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

aluigi wrote:Various big files like those with the sdb, nfc, vap and some dat entensions have this format:

Code: Select all

get FILES long
for i = 0 < FILES
    get OFFSET long
    get SIZE long
    log "" OFFSET SIZE
next i

And, what's worst, is that even some of the files extracted with this method are archives themselve.
For example the first file of 00000049.sdb is an archive.
There is no concrete way to guess this format without names and so it's not possible to automatize the extraction.


Yes it is. It seems that there are also dummy files. :(
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

I tried to make a repacking script but how can I put longlong and ZSIZE? And is there a reason why some files are zipped and others not? How can I choose it when I repacking?

Code: Select all

set OUTPUT_ARCHIVE_IDX string "LINKDATA_NEW.IDX"
set OUTPUT_ARCHIVE_BIN string "LINKDATA_NEW.BIN"

log MEMORY_FILE  0 0
log MEMORY_FILE2  0 0

for FILES = 0
    scanDir "." NAME SIZE
    if NAME == ""
        break
    endif
    open "." NAME
    string NAME << 2
    if NAME != OUTPUT_ARCHIVE_IDX
        get OFFSET asize MEMORY_FILE2
        put OFFSET long MEMORY_FILE
        put 0 long MEMORY_FILE

        put SIZE long MEMORY_FILE
        put 0 long MEMORY_FILE

        log MEMORY_FILE2  0 0

        get ZSIZE asize MEMORY_FILE2
        put ZSIZE long MEMORY_FILE
        put 0 long MEMORY_FILE

        put 1 long MEMORY_FILE
        put 0 long MEMORY_FILE

        append
        log MEMORY_FILE2 0 SIZE

        math OFFSET += ZSIZE

        append
        math FILES + 1
    endif
next

get SIZE asize MEMORY_FILE2
log OUTPUT_ARCHIVE_BIN 0 SIZE MEMORY_FILE2

get SIZE asize MEMORY_FILE
log OUTPUT_ARCHIVE_IDX 0 SIZE MEMORY_FILE
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Arslan the warriors of legend

Post by aluigi »

For longlong it's enough to replace long with longlong.
ZSIZE must be equal to SIZE and ZIP set to 0.
Don't use any compression because they are chunked files.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

aluigi wrote:For longlong it's enough to replace long with longlong.
ZSIZE must be equal to SIZE and ZIP set to 0.
Don't use any compression because they are chunked files.


I replace long with longlong but it put the values like this.

ex) 0A DF 00 00 0A DF 00 00.

What I want is 0A DF 00 00 00 00 00 00.

And when I didn't use ZSIZE and tried to repacking for a number of files, memory alloc error occur.
By the way, this error doesn't occur when I repack a few files. I can't figure out what's the problem.
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

This is the error message.
Image

And here is my code. What't wrong with it?

Code: Select all

set OUTPUT_ARCHIVE_IDX string "LINKDATA_NEW.IDX"
set OUTPUT_ARCHIVE_BIN string "LINKDATA_NEW.BIN"

log MEMORY_FILE  0 0
log MEMORY_FILE2  0 0

for FILES = 0
    scanDir "." NAME SIZE
    if NAME == ""
        break
    endif
    open "." NAME
    string NAME << 2
    if NAME != OUTPUT_ARCHIVE_IDX
        get OFFSET asize MEMORY_FILE2
        put OFFSET longlong MEMORY_FILE
        put SIZE longlong MEMORY_FILE
        put SIZE longlong MEMORY_FILE
        put 0 longlong MEMORY_FILE

        append
        log MEMORY_FILE2 0 SIZE

        math OFFSET += SIZE

        append
        math FILES + 1
    endif
next

get SIZE asize MEMORY_FILE2
log OUTPUT_ARCHIVE_BIN 0 SIZE MEMORY_FILE2

get SIZE asize MEMORY_FILE
log OUTPUT_ARCHIVE_IDX 0 SIZE MEMORY_FILE
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Arslan the warriors of legend

Post by aluigi »

I guess it's caused by the amount of files, quickbms is a 32bit application and so it's limited to use about 3Gb of memory.
It's enough to use the script without the memory file for BIN:

Code: Select all

set OUTPUT_ARCHIVE_IDX string "LINKDATA_NEW.IDX"
set OUTPUT_ARCHIVE_BIN string "LINKDATA_NEW.BIN"

log MEMORY_FILE  0 0
#log OUTPUT_ARCHIVE_BIN 0 0  # recreate if exists

math OFFSET = 0
for FILES = 0
    scanDir "." NAME SIZE
    if NAME == ""
        break
    endif
    open "." NAME
    string NAME << 2
    if NAME != OUTPUT_ARCHIVE_IDX
        put OFFSET longlong MEMORY_FILE
        put SIZE longlong MEMORY_FILE
        put SIZE longlong MEMORY_FILE
        put 0 longlong MEMORY_FILE

        append
        log OUTPUT_ARCHIVE_BIN 0 SIZE
        math OFFSET + SIZE
        append
        math FILES + 1
    endif
next

get SIZE asize MEMORY_FILE
log OUTPUT_ARCHIVE_IDX 0 SIZE MEMORY_FILE
sigroon365
Posts: 330
Joined: Fri Nov 21, 2014 4:03 am

Re: Arslan the warriors of legend

Post by sigroon365 »

aluigi wrote:I guess it's caused by the amount of files, quickbms is a 32bit application and so it's limited to use about 3Gb of memory.
It's enough to use the script without the memory file for BIN:

Code: Select all

set OUTPUT_ARCHIVE_IDX string "LINKDATA_NEW.IDX"
set OUTPUT_ARCHIVE_BIN string "LINKDATA_NEW.BIN"

log MEMORY_FILE  0 0
#log OUTPUT_ARCHIVE_BIN 0 0  # recreate if exists

math OFFSET = 0
for FILES = 0
    scanDir "." NAME SIZE
    if NAME == ""
        break
    endif
    open "." NAME
    string NAME << 2
    if NAME != OUTPUT_ARCHIVE_IDX
        put OFFSET longlong MEMORY_FILE
        put SIZE longlong MEMORY_FILE
        put SIZE longlong MEMORY_FILE
        put 0 longlong MEMORY_FILE

        append
        log OUTPUT_ARCHIVE_BIN 0 SIZE
        math OFFSET + SIZE
        append
        math FILES + 1
    endif
next

get SIZE asize MEMORY_FILE
log OUTPUT_ARCHIVE_IDX 0 SIZE MEMORY_FILE


Thanks a lot. However, Linkdata_new.idx's OFFSET is still wrong.
The OFFSET of last file is 275E12BD0h. But int the Linkdata_new.idx, the offset of this file is
D0 2B E1 75.

<Wrong>
D0 2B E1 75 D0 2B E1 75 5C 03 00 00 5C 03 00 00
5C 03 00 00 5C 03 00 00 00 00 00 00 00 00 00 00

<It should be corrected like this>
D0 2B E1 75 02 00 00 00 5C 03 00 00 00 00 00 00
5C 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00