Monday, October 18, 2021

Baldur's Gate 3 - How to Unpack .PAK files

How to unpack game resource files (.pak) of Baldur's Gate 3.

Way #1 (more user-friendly)

  1. Download and unpack ExportTool version 1.15.10 or later from https://github.com/Norbyte/lslib/releases
  2. run ConverterApp.exe
  3. at "Game" picklist select "Baldur's Gate 3 (64-bit)"
  4. select tab "PAK / LSV Tools"
  5. select game resources and manipulate what you want

That instrument also can convert binary .lsf files into readable XML .lsx files.

Way #2

  1. download and unpack QuickBMS version 0.11 or later from https://aluigi.altervista.org/quickbms.htm
  2. open https://zenhax.com/viewtopic.php?f=9&t=14229#p59245
  3. and copy script code to a clipboard.
  4. OR find script code here below.
  5. in that folder create file baldur_pack.bms
  6. paste script code into the file and save changes.
  7. run quickbms_4gb_files.exe
  8. select the script file baldur_pack.bms
  9. select game file .pak from ..\steamapps\common\Baldurs Gate 3\Data\
  10. select output folder
  11. just wait, QuickBMS will unpack game files into output folder

And, of course, you can use CLI of that application.

* CLI = command-line interface


# Baldur's Gate 3 PAK format (script 0.1.1)

# script for QuickBMS http://quickbms.aluigi.org


callfunction QUICKBMS_4GB_CHECK 1


comtype lz4

idstring "LSPK"

get VERSION long #15

get TABLE_OFF longlong


goto TABLE_OFF

get FILES long

get TABLE_ZSIZE long

savepos TABLE_OFFSET


math TABLE_SIZE = FILES

math TABLE_SIZE *= 296


clog MEMORY_FILE TABLE_OFFSET TABLE_ZSIZE TABLE_SIZE


for i = 0 < FILES

    getdstring NAME 256 MEMORY_FILE

    get OFFSET longlong MEMORY_FILE

    get ZSIZE longlong MEMORY_FILE

    get SIZE longlong MEMORY_FILE

    get DUMMY longlong MEMORY_FILE

    get CRC long MEMORY_FILE

    get DUMMY long MEMORY_FILE

   

    if SIZE == 0

        log NAME OFFSET ZSIZE

    else

        clog NAME OFFSET ZSIZE SIZE

    endif

next i


startfunction QUICKBMS_4GB_CHECK

    math TMP64 = 0x10000000

    math TMP64 * 16

    if TMP64 == 0

        print ">>>> You must use quickbms_4gb_files.exe with this archive <<<<"

        cleanexit

    endif

endfunction


Guide by Mellarius

0 comments:

Post a Comment