www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor

Reply
 
Thread Tools
Old 04-03-20, 12:13   #11
ANoDE
Gold Membership
 
ANoDE's Avatar
 
Join Date: May 2005
Location: Austria
Posts: 4,690
Default Uncompressing cutseq.pak

Code:
import zlib
import struct

# read compressed file
packed_data = open('cutseq.pak', 'rb').read()

# read UncompressedLen field
unpacked_len = struct.unpack('L', packed_data[0:4])[0]

# Decompress zlib data
try:
  unpacked_data = zlib.decompress(packed_data[4:])
except:
  # Try headerless
  unpacked_data = zlib.decompress(packed_data[4:],-15)

# sanity check
assert len(unpacked_data) == unpacked_len

# write uncompressed file
open('cutseq.bin', 'wb').write(unpacked_data)
This should do the trick (given the information above):
  • save the above code snippet as unpack.py in your tr4's data folder
  • Download Python 3.8 from www.python.org
  • open a cmd window in your tr4's data folder (both unpack.py and cutseq.pak should be there)
  • run the command 'python unpack.py'

If all goes well, this should leave you with an uncompressed cutseq.bin file.
I'm at a place without my computer right now, so I couldn't try it out. Sorry if it doesn't work.
__________________
#BringClassicLaraCroftBack - more now than ever.

Last edited by ANoDE; 05-03-20 at 18:08.
ANoDE is offline   Reply With Quote
Old 04-03-20, 22:35   #12
ReH_
Hobbyist
 
ReH_'s Avatar
 
Join Date: Jul 2015
Location: Your Dreams
Posts: 78
Default

I don't know if i'm doing something wrong but i'm getting this error
Code:
Traceback (most recent call last):
  File "unpack.py", line 18, in <module>
	assert len(unpacked_data) == unpacked_len
AssertionError
Btw I created a .bat file in data folder to run the command in cmd.

If there's no fix for it, it's okay, i appreciate your help

EDIT: IT'S WORKING NOW!! THANKSSS A LOT ANoDE
__________________
"Hahahaha right! In your next life!"

Last edited by ReH_; 05-03-20 at 02:08.
ReH_ is offline   Reply With Quote
Old 05-03-20, 16:03   #13
ANoDE
Gold Membership
 
ANoDE's Avatar
 
Join Date: May 2005
Location: Austria
Posts: 4,690
Default

Glad I could help

EDIT: Actually, there was an error in the code above. I've fixed it, and now it should work out of the box.
__________________
#BringClassicLaraCroftBack - more now than ever.

Last edited by ANoDE; 05-03-20 at 18:08.
ANoDE is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.