ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Thu Oct 22, 2020 5:24 pm

All times are UTC




Post new topic  Reply to topic  [ 26 posts ]  Go to page 1 2 Next
Author Message
 Post subject: Baldur's Gate 3 (*.PAK)
PostPosted: Sun Oct 11, 2020 1:49 am 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 1100
Code:
# 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


Last edited by Ekey on Wed Oct 14, 2020 3:15 pm, edited 3 times in total.

Top
   
PostPosted: Sun Oct 11, 2020 2:55 pm 

Joined: Sat Nov 18, 2017 7:30 pm
Posts: 22
Thank you!


Top
   
PostPosted: Sun Oct 11, 2020 3:32 pm 

Joined: Sun Oct 11, 2020 3:24 pm
Posts: 3
Just created an account to say Thanks :)

I dont know if this is an issue with the script, but some creature files contain only .bin files while others contain .gr2 + .bin files (.bin are 1kb files - probably some file info haven't checked them out yet)
this includes creatures that are in EA of the game so there should be gr2 files for them.

By the way could you please let me know how you identified the compression type is lz4?
while I pretty good with 3d meshes and skeleton/animation , I have almost 0 experience with compressed archives except for .zlib
any pointers would be great


Top
   
PostPosted: Sun Oct 11, 2020 3:39 pm 

Joined: Thu Aug 07, 2014 10:28 pm
Posts: 310
you can just use a compression scan tool here.
compscan bms scrip.
QuickBMS comtype scanner 2
https://aluigi.altervista.org/quickbms.htm


Top
   
PostPosted: Sun Oct 11, 2020 4:04 pm 

Joined: Sun Oct 11, 2020 3:24 pm
Posts: 3
chrrox wrote:
you can just use a compression scan tool here.
compscan bms scrip.
QuickBMS comtype scanner 2
https://aluigi.altervista.org/quickbms.htm


Thanks for the tip - just for practice sake ill try using this tool to figure out compression type and RE the archive.


Top
   
PostPosted: Sun Oct 11, 2020 5:32 pm 

Joined: Tue Nov 12, 2019 4:58 pm
Posts: 2
Thanks for the script! I have an issue tho. For some reason when I try to extract the 30gb textures.pak file, it only exports 0 byte textures.


Top
   
PostPosted: Sun Oct 11, 2020 10:53 pm 

Joined: Tue Oct 29, 2019 5:30 pm
Posts: 2
Thanks, but sadly it dont extract texture pak


Top
   
PostPosted: Mon Oct 12, 2020 12:16 am 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 1100
Clearless wrote:
Thanks for the script! I have an issue tho. For some reason when I try to extract the 30gb textures.pak file, it only exports 0 byte textures.

farrarie wrote:
Thanks, but sadly it dont extract texture pak

Fixed. Check the first post :)

jayn23 wrote:
I dont know if this is an issue with the script, but some creature files contain only .bin files while others contain .gr2 + .bin files (.bin are 1kb files - probably some file info haven't checked them out yet)
this includes creatures that are in EA of the game so there should be gr2 files for them.

The script extract everything in the archive entry table. I think that's what the developers intended

PS: Also you can use this tool for unpack/pack and convert models https://github.com/Norbyte/lslib/releases

Just example :)

Image


Top
   
PostPosted: Mon Oct 12, 2020 5:38 am 

Joined: Sun Oct 11, 2020 3:24 pm
Posts: 3
Quote:
PS: Also you can use this tool for unpack/pack and convert models https://github.com/Norbyte/lslib/releases


Thanks you can check out my .gr2 script for noesis - it supports more gr2 variations than norbytes tool

although norbytes code was my main reference with animation phrasing

https://forum.xentax.com/viewtopic.php? ... b20b082c28


Top
   
PostPosted: Mon Oct 12, 2020 6:01 am 

Joined: Sun Aug 30, 2015 12:51 pm
Posts: 64
Hmm, lowtex.pak can't be unpacked still even with a newer script.


Top
   
PostPosted: Tue Oct 13, 2020 12:55 am 

Joined: Tue Nov 12, 2019 4:58 pm
Posts: 2
Thank you Ekey.


Top
   
PostPosted: Tue Oct 13, 2020 7:10 pm 

Joined: Tue Oct 13, 2020 7:05 pm
Posts: 1
Hi, thank you for putting this out there! I do have a question, will this script work for reimporting as well? After extracting, I tried changing some minor values like a number or string here or there, and depending on the change the game either won't load at all, or character creation will be entirely broken, or hitting "continue" will just leave me in a loading loop. It seems to me that maybe there's just an issue repacking in general, since I don't know why there would be these issues just by changing some item description text.

Anyway, thanks again!


Top
   
PostPosted: Tue Oct 13, 2020 11:35 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 1100
The structure contains a DWORD similar to CRC, perhaps the game checks files by this CRC. If so then try the tool from this post


Top
   
PostPosted: Wed Oct 14, 2020 5:31 am 

Joined: Thu Oct 08, 2020 11:46 am
Posts: 6
Hi everyone,

I've managed to unpack the PAK file with the following tool:

https://github.com/Norbyte/lslib/releases

Now I'm stuck on repacking it. I've tried many packers and the program starts, but always writes "not found.".

https://images2.imagebam.com/3e/9b/4d/8 ... 224540.jpg

Any help is appreciated,
Cheers,


Top
   
PostPosted: Wed Oct 14, 2020 11:27 am 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 1100
Try the updated version lslib


Top
   
PostPosted: Wed Oct 14, 2020 12:07 pm 

Joined: Thu Oct 08, 2020 11:46 am
Posts: 6
Ekey wrote:
Try the updated version lslib


Dear Ekey

thank you i try new version same problem i try only unpack and repack not modify and not work.


Top
   
PostPosted: Wed Oct 14, 2020 3:00 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 1100
Butterbean wrote:
Dear Ekey

thank you i try new version same problem i try only unpack and repack not modify and not work.

It works fine!

Some proofs
https://images2.imagebam.com/46/9d/a2/5 ... 365509.png
https://images2.imagebam.com/f3/68/73/f ... 365510.png


Top
   
PostPosted: Wed Oct 14, 2020 4:36 pm 

Joined: Thu Oct 08, 2020 11:46 am
Posts: 6
Ekey wrote:
Butterbean wrote:
Dear Ekey

thank you i try new version same problem i try only unpack and repack not modify and not work.

It works fine!

Some proofs
https://images2.imagebam.com/46/9d/a2/5 ... 365509.png
https://images2.imagebam.com/f3/68/73/f ... 365510.png



and how work ? i see this lslib i try all variation and not work for me :(


Last edited by Butterbean on Wed Oct 14, 2020 4:43 pm, edited 1 time in total.

Top
   
PostPosted: Wed Oct 14, 2020 4:43 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 1100
There is no difference, I think it will work the same with editing English.pak. Show me your settings of this app.


Top
   
PostPosted: Wed Oct 14, 2020 4:59 pm 

Joined: Thu Oct 08, 2020 11:46 am
Posts: 6
Ekey wrote:
There is no difference, I think it will work the same with editing English.pak. Show me your settings of this app.



Thank you for helping!

russian pack only open and repack ( i try english.pak):

https://images2.imagebam.com/0f/5e/d2/2 ... 372134.png


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 26 posts ]  Go to page 1 2 Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited