Lunia CBF files

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
slinker0
Posts: 1
Joined: Sun Nov 17, 2019 3:06 pm

Lunia CBF files

Post by slinker0 »

Hey, guys, I've been playing around for quite some time now with Lunia source for its 2.6 version and it helped me a lot to see what changed from 2.6 to 3.1 version by extracting CBF files using Aluigi's tool as well as his cbf script. Now things have changed a bit. I need to make my source code read and create those files from a xml file. My only issue is how do I make it readable (without lzma) According to Aluigi's script it's pretty simple.

Code: Select all

comtype lzma
# Lunia (CBF archives) (script 0.2)
# script for QuickBMS http://quickbms.aluigi.org

get CBF_SIZE asize
for NEXT_OFF = 0 u< CBF_SIZE
    get DATA_SIZE long
    savepos NEXT_OFF
    math NEXT_OFF + DATA_SIZE
    savepos OFFSET
    for OFFSET = OFFSET u< NEXT_OFF
        get ZSIZE long
        get SIZE long
        math ZSIZE + 5
        savepos OFFSET
        clog "" OFFSET ZSIZE SIZE
        math OFFSET + ZSIZE
        goto OFFSET
    next
    goto NEXT_OFF
next

Could you guys help me out understanding this? How is it gathering the header of the file and stuff like that.
Is there a small source code that would extract the data from this file in cpp that I could use to go deep into it? Thanks!
I attached a file that has the encryption mentioned.
Thanks so much