King of Figthers 2000 DC (DAT FILE)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
domingo
Posts: 83
Joined: Fri Aug 19, 2016 11:53 am

King of Figthers 2000 DC (DAT FILE)

Post by domingo »

Hello again, I need to extract the textures from these KOF 2000 data files.
These files are GRC compressed texture packs.
I have tried this script, but it only extracts and uncompresses the first texture.

Code: Select all

comtype grc
get ZSIZE asize
xmath SIZE "ZSIZE * 10"
get NAME basename
clog NAME 0 ZSIZE SIZE


I have also found in this same forum the script to compress again, I don't know if it would be possible to adapt it for these rows.

Code: Select all

log MEMORY_FILE 0 0
get SIZE asize
for i = 0 < SIZE
    get TMP byte
    if TMP >= 0xc0
        put 0xc1 byte MEMORY_FILE
    endif
    put TMP byte MEMORY_FILE
next i
get SIZE asize MEMORY_FILE
get NAME filename
string NAME -= "_uncompressed"
log NAME 0 SIZE MEMORY_FILE


file
ART_MENU.zip


Cheers
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: King of Figthers 2000 DC (DAT FILE)

Post by aluigi »

Are you sure there is no other file with name name and different extension?
Or maybe another file that acts as index for all these DAT files?

Because that DAT is clearly a container of files without index, that explains the decompression of the first file only.
domingo
Posts: 83
Joined: Fri Aug 19, 2016 11:53 am

Re: King of Figthers 2000 DC (DAT FILE)

Post by domingo »

Well, I can't find anything among the files, these files are inside a folder, and they are all texture packs.
In the root folder at the moment I have not seen anything. only GRC files, other DAT files for which I can't find any type of index, and OSB files that seem to be audio.
It is possible that they may be in other compressed files such as GRC in the root folder
In the binary I have only found the names of these DATs, but nothing of their content.
I have managed to extract a whole file, extracting the first entry and then deleting it, but if there are for example 50 textures, I have to do it 50 times.

Perhaps with a script to which the offsets of each texture can be added manually, it could be done faster.
At least that way it would only be to edit the offsets in the script and at once they could be extracted
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: King of Figthers 2000 DC (DAT FILE)

Post by aluigi »

I tried something lame like searching all the GBIX but the decompression crashes with some files, don't know why.
The crash happens even if you set the compressed size equal than the remaining part of the DAT file.

Anyway the lame scanner/dumper for testing is the following:

Code: Select all

comtype grc
get DAT_SIZE asize
for OFFSET = 0 != DAT_SIZE
    getdstring SKIP 8

    findloc NEXT_OFF binary "GBIX" 0 ""
    if NEXT_OFF == ""
        math NEXT_OFF = DAT_SIZE
    else
        math NEXT_OFF - 2
    endif

    xmath ZSIZE "NEXT_OFF - OFFSET"
    xmath SIZE "ZSIZE * 32"
    #math SIZE = 0x10022 # is it ever the same?
    clog "" OFFSET ZSIZE SIZE

    math OFFSET = NEXT_OFF
    goto OFFSET
next
domingo
Posts: 83
Joined: Fri Aug 19, 2016 11:53 am

Re: King of Figthers 2000 DC (DAT FILE)

Post by domingo »

I think it can help me, at least it makes the extraction much easier.
In any case, I will count the textures of each file in case one is left unextracted.

thank you aluigi ;)