lfnetwork.com mark read register faq members calendar

Thread: Decompressing using Quick BMS
Thread Tools Display Modes
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Prev Previous Post   Next Post Next
Old 01-17-2010, 02:25 PM   #1
DarthSlinky
Rookie
 
DarthSlinky's Avatar
 
Join Date: Dec 2009
Posts: 97
Current Game: Starcraft II
Decompressing using Quick BMS

As most of use know some the TFU can be unpacked using QuickBMS and a script by GameZelda and PantheraKing on the XeNTaX forum

The script
Quote:
# Star Wars The Force Unleashed PC / .lp extractor
# script for QuickBMS http://aluigi.org/papers.htm#quickbms


# OFFSET TABLE LAYOUT - SIZE=0x10
#
# 0x00 - FILE INDEX - 4
# 0x04 - FILE DATA OFFSET - 4
# 0x08 - ALWAYS 0 - 4
# 0x0C - ALWAYS 0 - 4

# INFO TABLE LAYOUT - SIZE=0x40
#
# 0x00 - UNKNOWN - 4
# 0x04 - UNKNOWN - 4
# 0x08 - ALWAYS 0 - 4
# 0x0C - UNKNOWN - 4
# 0x10 - UNKNOWN - 4
# 0x14 - NAME OFFSET - 4
# 0x18 - UNKNOWN - 4
# 0x1C - ALWAYS 0 - 4
# 0x20 - ALWAYS 0 - 4
# 0x24 - ALWAYS 0 - 4
# 0x28 - FILE SIZE - 4
# 0x2C - FILE SIZE CHECK? - 4
# 0x30 - ALWAYS 0 - 4
# 0x34 - UNKNOWN - 4
# 0x38 - ALWAYS 0 - 4
# 0x3C - ALWAYS 0 - 4

getdstring IDSTRING 4
get FILE_VERSION long
get NUM_FILES long

get UNKNOWN1 long # Seems to be always 0x00000000
get UNKNOWN2 long # Seems to be always 0xFFFFFFFF
get UNKNOWN3 long # Seems to be always 0x00000000


# The header seems to change depending of this value
# It seems to be the extra header size
# Default header size is 0x50, to get the correct offset for the name table, you have to do
# 0x50 + EXTRA_HEADER_SIZE

get EXTRA_HEADER_SIZE long
get NAME_TABLE_SIZE long
get OFFSET_TABLE_OFF long
get DATA_OFF long
get UNKNOWN4 long
get UNKNOWN5 long
get DATA_OFF_2 long # Seems to be always the same value as DATA_OFF
get WHOLE_FILE_SIZE long # Seems to be the size of the whole file
get UNKNOWN6 long # Seems to be always 0x00000000
get UNKNOWN7 long # Seems to be always 0x00000000
get UNKNOWN8 long # Seems to be always 0x00000000
get DATA_OFF_3 long # Seems to be always the same value as DATA_OFF
get WHOLE_FILE_SIZE_2 long # Seems to be always the same value as WHOLE_FILE_SIZE
get UNKNOWN9 long # Seems to be always 0x00000000

set NAME_TABLE_OFF EXTRA_HEADER_SIZE
math NAME_TABLE_OFF += 0x50

set INFO_TABLE_OFF NAME_TABLE_OFF
math INFO_TABLE_OFF += NAME_TABLE_SIZE

########### FILE CHECKS ##############

if IDSTRING != "kaPA"
print "File type check error\nThis is not a SWTFU .lp file\n"
cleanExit
endif

if FILE_VERSION != 0x00000005
print "File version is not supported!\nExpected version: 5\nThis version: %FILE_VERSION%\n"
cleanExit
endif

if WHOLE_FILE_SIZE != WHOLE_FILE_SIZE_2
print "File size check error: %WHOLE_FILE_SIZE% - %WHOLE_FILE_SIZE_2%\n"
cleanExit
endif

if DATA_OFF != DATA_OFF_2
print "Data offset check error: %DATA_OFF% - %DATA_OFF_2% - %DATA_OFF_3%\n"
cleanExit
elseif DATA_OFF != DATA_OFF_3
print "Data offset check error: %DATA_OFF% - %DATA_OFF_2% - %DATA_OFF_3%\n"
cleanExit
endif

########### EXTRACTION ###############

for i = 0 < NUM_FILES

set FILE_INFO_POS i
math FILE_INFO_POS *= 0x40 # Size of INFO_TABLE struct for each file
math FILE_INFO_POS += INFO_TABLE_OFF

set FILE_OFFSET_POS i
math FILE_OFFSET_POS *= 0x10 # Size of FILE_OFFSET struct for each file
math FILE_OFFSET_POS += OFFSET_TABLE_OFF

# GET FILE NAME

set TEMP_POS FILE_INFO_POS
math TEMP_POS += 0x14

goto TEMP_POS
get FILE_NAME_OFFSET long
math FILE_NAME_OFFSET += NAME_TABLE_OFF

goto FILE_NAME_OFFSET
get FILE_NAME string

# GET FILE SIZE

set TEMP_POS FILE_INFO_POS
math TEMP_POS += 0x28

goto TEMP_POS
get FILE_SIZE long

# GET FILE DATA

set TEMP_POS FILE_OFFSET_POS
math TEMP_POS += 0x04

goto TEMP_POS
get FILE_DATA_OFFSET long
math FILE_DATA_OFFSET += DATA_OFF

# WRITE FILE

log FILE_NAME FILE_DATA_OFFSET FILE_SIZE

next i


######################################
The script works but as of now there is no way to recompress the files and very few of the models have been opened because LucasArts seems to have invented or modified an already non standard format.

This thread is to post your ideas, results and projects concerning the decompressing of TFU

Keep in my this only decompresses .lp files and the QuickBMS has no user interface to speak of, so this process is not for a novice computer user.

Good luck!

Edit: the link to QuickBSM is categorized as Malware by some website advisers, its clean.


Freude, schöner Götterfunken Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum! Deine Zauber binden wieder Was die Mode streng geteilt; Alle Menschen werden Brüder, Wo dein sanfter Flügel weilt.
DarthSlinky is offline   you may: quote & reply,
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Force Unleashed > General > Modding The Force Unleashed > Decompressing using Quick BMS

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -4. The time now is 12:48 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.