2Dark .Bigfile

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
0wn3df1x
Posts: 24
Joined: Wed Sep 02, 2015 6:56 pm

2Dark .Bigfile

Post by 0wn3df1x »

Hello!
Need help with 2Dark .Bigfile archive.

Sample attached.

(More samples from data\levels if you need it: https://drive.google.com/file/d/0B4gOIO ... sp=sharing )
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: 2Dark .Bigfile

Post by spider91 »

Code: Select all

get DUMMY long
get FILES long
get DATA_OFFSET long
get DUMMY long
savepos TOC_OFFSET
xmath NAME_OFFSET "TOC_OFFSET + (FILES * 8)"
for i = 0 < FILES
   get NAME_SIZE long
   get ZSIZE long
   savepos TOC_OFFSET
   goto NAME_OFFSET
   getdstring NAME NAME_SIZE
   savepos NAME_OFFSET
   if ZSIZE != 0
      goto DATA_OFFSET
      get SIGN byte
      if SIGN == 0x4F
         comtype blackdesert
         get ZSIZE long
         get SIZE long
         clog NAME DATA_OFFSET ZSIZE SIZE
      elif SIGN == 0x47 || SIGN == 0x4E
         comtype QUICKLZ
         get ZSIZE long
         get SIZE long
         clog NAME DATA_OFFSET ZSIZE SIZE
      elif SIGN == 0x44 || SIGN == 0x45
         comtype QUICKLZ
         goto DATA_OFFSET
         get SIGN byte
         get ZSIZE byte
         get SIZE byte
         clog NAME DATA_OFFSET ZSIZE SIZE
      else
         string NAME += ".dump"
         log NAME DATA_OFFSET ZSIZE
      endif
      math DATA_OFFSET += ZSIZE
   else
      log NAME 0 0
   endif
   goto TOC_OFFSET
next i
spider91
Posts: 233
Joined: Sun Aug 24, 2014 5:26 pm

Re: 2Dark .Bigfile

Post by spider91 »

Repack:

Code: Select all

comtype QUICKLZ_COMPRESS
get DUMMY long
get FILES long
get DATA_OFFSET long
get DUMMY long
savepos TOC_OFFSET
xmath NAME_OFFSET "TOC_OFFSET + (FILES * 8)"
log TEMPORARY_FILE 0 DATA_OFFSET
append
open "." TEMPORARY_FILE 1
for i = 0 < FILES
   goto TOC_OFFSET 1
   get NAME_SIZE long 1
   savepos ZSIZE_OFFSET 1
   get ZSIZE long 1
   savepos TOC_OFFSET 1
   goto NAME_OFFSET 1
   getdstring NAME NAME_SIZE 1
   savepos NAME_OFFSET 1
   if ZSIZE != 0
      open "." NAME 2
      get SIZE asize 2
      get TMP_SIZE asize 1
      clog TEMPORARY_FILE 0 SIZE SIZE 2
      get ZSIZE asize 1
      math ZSIZE -= TMP_SIZE
      goto ZSIZE_OFFSET 1
      put ZSIZE long 1
   endif
next i
append
get SIZE asize 1
get NAME filename
string NAME += ".new"
log NAME 0 SIZE 1


usage: quickbms -w <script> <original bigfile> <directory with unpacked files>

File will appear in <directory with unpacked files> with .new extension
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: 2Dark .Bigfile

Post by aluigi »

@spider91
Excellent job, really
swat
Posts: 15
Joined: Sat May 15, 2021 8:58 am

Re: 2Dark .Bigfile

Post by swat »

when repacked. game is not running