Castlevania - extraction, conversion and modding - GENERAL

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Delacroix
Posts: 65
Joined: Mon Dec 08, 2014 1:16 pm

Castlevania - extraction, conversion and modding - GENERAL

Post by Delacroix »

Greetings. I'm starting this thread to keep all my inquiries related to the 3D Castlevania titles in one place as the games aren't too numerous and many are in one way or another related - formatwise or enginewise. The objective of my research is:

- to obtain models (with animations) importable to engines such as Unreal and Unity.
- to gain access to text and font files for translation purposes.

Like I said, this thread will concern only a couple titles:

- Castlevania 64 for the N64
- Castlevania: Legacy of Darkness for the N64
- Castlevania: Lament of Innocence for the PS2
- Castlevania: Curse of Darkness for the PS2
- Castlevania: Dracula X Chronicles for the PSP
- Castlevania: Judgment for the N-Wii.

If by any chance any research in the regard of these games was already made, I'll be grateful if results of that are linked when a given question arises.

For now, my first inquiry.

1. Castlevania: Lament of Innocence and Curse of Darkness
- Can I please request that a method of extraction for the following files be provided?

FileData.bin (Lament)
ELF file (Lament)
FileData.bin (Curse)
ELF file (Curse)
sd.bin (Curse)
sd_ntsc.bin (Curse)

Thank you very much in advance for any assistance you offer.
Last edited by Delacroix on Tue May 03, 2016 9:31 am, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Castlevania - extraction, conversion and modding - GENERAL

Post by aluigi »

sd*.bin is ok but filedata.bin has no references for the archived files, for example there are some Svag files from offset 0x2bb52000 and no references to their offsets or size (even divided by 0x800, nothing).

Script:

Code: Select all

get DUMMY long  # 1
if DUMMY == 0x544f4f42  # "BOOT2" for FILEDATA.BIN

    math INFO_OFF = 0x800
    for
print "INFO_OFF %INFO_OFF|X%"
        goto INFO_OFF
        get TYPE long
        if TYPE == 0x82734927   # idstring "\x27\x49\x73\x82"
            get ZERO long
            get INFO_SIZE long
            get ZERO long
            get FILES long
            get DUMMY long
            get ZERO long
            get ZERO long
            savepos BASE_OFF
            for i = 0 < FILES
                get SIZE long
                get DUMMY1 long
                get OFFSET long
                get DUMMY2 long
                math OFFSET + BASE_OFF
                log "" OFFSET SIZE
            next i
            math INFO_OFF + INFO_SIZE
        else
            findloc INFO_OFF binary "\x27\x49\x73\x82"           
        endif
    next

else                    # SD*.BIN

    get FILES long
    get ZERO long
    get ZERO long   # 1
    for i = 0 < FILES
        get OFFSET long
        get SIZE long
        math OFFSET * 0x800
        log "" OFFSET SIZE
    next i

endif

*edit* script updated
Delacroix
Posts: 65
Joined: Mon Dec 08, 2014 1:16 pm

Re: Castlevania - extraction, conversion and modding - GENERAL

Post by Delacroix »

Added the ELF files which serve as PS2 executables in the first post. Is it possible they contain a file table of sorts?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Castlevania - extraction, conversion and modding - GENERAL

Post by aluigi »

No references in the elf, I guess there is an index file probably that contains the offsets and sizes.

I continued to check the data in it and I can confirm that filedata.bin is just a raw container (no offset/size), in fact I tried to parse the "\x27\x49\x73\x82" blocks of data and I can extract the 80% of the sub-files (because "\x27\x49\x73\x82" are files!).

Work-in-progress script of the previous post updated.