Bioshock 2

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
InKviZ
Posts: 124
Joined: Fri Oct 24, 2014 2:55 pm

Bioshock 2

Post by InKviZ »

Hello. Help unpack and pack lbf archive the Bioshock 2.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Bioshock 2

Post by aluigi »

I can give you 2 scripts that do the same but the first dumps the data "as-is" (suggested) while the second one converts unicode to utf8:

Code: Select all

set MEMORY_FILE binary "\xff\xfe"
get LBF_SIZE asize
for OFFSET = 0 < LBF_SIZE

    get DATASZ variable2
    math DATASZ * 2
    getdstring DATA DATASZ
    set DATA unicode DATA
    set NAME string DATA

    get DATASZ variable2
    math DATASZ * 2
    savepos OFFSET

    log NAME 0 0
    append
    log NAME 0 2 MEMORY_FILE
    math DATASZ - 2
    log NAME OFFSET DATASZ
    math DATASZ + 2
    append

    math OFFSET + DATASZ
    goto OFFSET
next


Code: Select all

get LBF_SIZE asize
for TMP_OFF = 0 < LBF_SIZE
    callfunction GET_DATA 1
    set NAME string DATA
    callfunction GET_DATA 1
    savepos TMP_OFF

    log MEMORY_FILE 0 0
    putct DATA string -1 MEMORY_FILE
    get SIZE asize MEMORY_FILE
    log NAME 0 SIZE MEMORY_FILE
next

startfunction GET_DATA
    get DATASZ variable2
    math DATASZ * 2
    getdstring DATA DATASZ
    set DATA unicode DATA
endfunction
InKviZ
Posts: 124
Joined: Fri Oct 24, 2014 2:55 pm

Re: Bioshock 2

Post by InKviZ »

Thank you for help. But somehow the scripts are not working.
InKviZ
Posts: 124
Joined: Fri Oct 24, 2014 2:55 pm

Re: Bioshock 2

Post by InKviZ »

On the internet I found unrollers for the first part, and the unpacked archive. There was one file. Now we need someone to help export and import text from a file. Text file attached.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Bioshock 2

Post by aluigi »

Open it with a hex editor and add the bytes 0xff 0xfe at the beginning.
The first script I pasted does this operation automatically when extracting the files.
Graveyard
Posts: 54
Joined: Sun Nov 12, 2017 12:30 pm

Re: Bioshock 2

Post by Graveyard »

solution to reimport files?
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: Bioshock 2

Post by Hexaae »

.
How to rebuild original .lbf from extracted files?
Hexaae
Posts: 61
Joined: Sat Mar 04, 2017 10:37 am

Re: Bioshock 2

Post by Hexaae »