Star Wars The Force Unleashed - PC Version .z files

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
User avatar
japamd
advanced
Posts: 41
Joined: Sat Sep 19, 2009 10:26 pm
Has thanked: 3 times
Been thanked: 8 times

Star Wars The Force Unleashed - PC Version .z files

Post by japamd » Mon Nov 02, 2009 12:36 am

Hello,

I'm trying to uncompress some files found on PC version of Star Wars The Force Unleashed, I figured out the following until now:

Code: Select all

Offset Bytes     Description
0        4          Uncompressed size
4        4          ZSIZE -> Compressed size (file size minus 0xC bytes) 
8        4          Checksum?
C        ZSIZE   Contents
I have attached a sample, can some please take a look?

I already have tested quickbms using several uncompression type (ComType xxxxxx), none of them worked. Maybe contents are encrypted?

Thanks!
You do not have the required permissions to view the files attached to this post.

GameZelda
advanced
Posts: 61
Joined: Wed Nov 14, 2007 5:56 pm
Been thanked: 27 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by GameZelda » Tue Nov 03, 2009 12:25 am

The compressed data is XOR FF'd.
The compression looks like LZSS.

User avatar
japamd
advanced
Posts: 41
Joined: Sat Sep 19, 2009 10:26 pm
Has thanked: 3 times
Been thanked: 8 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by japamd » Tue Nov 03, 2009 1:13 am

GameZelda wrote:The compressed data is XOR FF'd.
The compression looks like LZSS.
Thanks!

But didn't work. I tried:

get SIZE LONG
get ZSIZE LONG

comtype lzss
filexor "\xff"
clog NAME.txt "\x0c" ZSIZE SIZE

User avatar
aluigi
VVIP member
VVIP member
Posts: 1925
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 643 times
Contact:

Re: Star Wars The Force Unleashed - PC Version .z files

Post by aluigi » Thu Nov 05, 2009 4:33 am

the correct script would be:

Code: Select all

comtype lzss
get SIZE long
get ZSIZE long
get DUMMY long
savepos OFFSET
filexor 0xff
clog "dump.dat" OFFSET ZSIZE SIZE
but can't work because the algorithm is not lzss, it's something else

User avatar
japamd
advanced
Posts: 41
Joined: Sat Sep 19, 2009 10:26 pm
Has thanked: 3 times
Been thanked: 8 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by japamd » Thu Nov 05, 2009 3:08 pm

Thanks, aluigi.

swuforce
veteran
Posts: 121
Joined: Thu Nov 05, 2009 8:46 pm
Has thanked: 9 times
Been thanked: 104 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by swuforce » Thu Nov 05, 2009 9:51 pm

Hi
Can someone make an unpacker for the game .lp files?
Sample:http://www.zshare.net/download/6802877050e22834/

GameZelda
advanced
Posts: 61
Joined: Wed Nov 14, 2007 5:56 pm
Been thanked: 27 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by GameZelda » Sun Nov 08, 2009 6:33 pm

Code: Select all

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

# The container format seems pretty strange and I don't understand it much, but this script works...

# File Header
IDString "kaPA"
Get @version long
If @version != 5
	Print "@version = %@version%, expected 5."
	CleanExit
EndIf
Get @nFiles long

GoTo 0x1C
Get @fileNameTableSize long
Get @fileOffTableOff long
Get @dataOff long

# Calculate some useful stuff
Set @fileNameTableOff 0x50

Set @fileInfoTableOff @fileNameTableOff
Math @fileInfoTableOff += @fileNameTableSize

# Extract the files
For @i = 0 < @nFiles
	# Get the file name (there's an offset to it at 0x14 of the file info table)
	Set @fileNameOffOff @i
	Math @fileNameOffOff *= 0x40
	Math @fileNameOffOff += @fileInfoTableOff
	Math @fileNameOffOff += 0x14
	GoTo @fileNameOffOff

	Get @fileNameOff long
	Math @fileNameOff += @fileNameTableOff
	GoTo @fileNameOff

	Get @fileName string

	# Get the file size (it's at 0x28 of the file info table)
	Set @fileSizeOff @i
	Math @fileSizeOff *= 0x40
	Math @fileSizeOff += @fileInfoTableOff
	Math @fileSizeOff += 0x28
	Goto @fileSizeOff

	Get @fileSize long

	# Get the file offset (it's at 0x04 of the file offset table)
	Set @fileOffOff @i
	Math @fileOffOff *= 0x10
	Math @fileOffOff += @fileOffTableOff
	Math @fileOffOff += 0x04
	Goto @fileOffOff

	Get @fileOff long
	Math @fileOff += @dataOff
	
	# Extract the data, finally
	Log @fileName @fileOff @fileSize
Next @i

Magniel
ultra-n00b
Posts: 2
Joined: Thu Nov 05, 2009 8:10 am
Has thanked: 2 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by Magniel » Tue Nov 24, 2009 8:14 pm

And can I use this script to extract and also pack that archive? In that case, can someone explain me how please?

//EDIT: Ok, I can extract that archive, thank you for script, but can I get it back to the archive?

User avatar
CMihai
veteran
Posts: 132
Joined: Sun Jul 05, 2009 12:58 pm
Has thanked: 13 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by CMihai » Mon Nov 30, 2009 12:20 pm

The script don't work for larger files.

QuickBMS generic files extractor 0.3.9a
by Luigi Auriemma
e-mail: aluigi@autistici.org
web: aluigi.org

- GUI mode activated, remember that the tool works also from command-line
where are available various options like folder scanning, filters and so on

- select the input archive/file to extract
- select the output folder where extracting the files
- open input file E:\Games\Star Wars The Force Unleashed\LevelPacks\tem_jeditemp
le_b_pc.lp
- open script D:\[SNP] Ripping Tools\quickbms2\starwars.txt
- set output folder E:\[Archives] Extracted Files\[PC] Star Wars Force Unleashed


offset filesize filename
------------------------------

- 0 files found in 0 seconds

Press RETURN to quit

lordskylark
beginner
Posts: 39
Joined: Tue May 26, 2009 1:27 pm
Has thanked: 1 time

Re: Star Wars The Force Unleashed - PC Version .z files

Post by lordskylark » Tue Dec 01, 2009 7:22 pm

The contents of this post was deleted because of possible forum rules violation.

PantheraKing
ultra-n00b
Posts: 1
Joined: Fri Dec 04, 2009 8:44 am
Been thanked: 2 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by PantheraKing » Fri Dec 04, 2009 9:50 pm

Hi,

I did a more generic script to extract files from files .lp

It works with any .lp files (If not just tell me but i've tested it on almost all files)
If you can figure out some of the "UNKNOWN" fields please tell me, because i'm writing a SWTFU Tool like Kotor Tool

Code: Select all


# 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


######################################

lordskylark
beginner
Posts: 39
Joined: Tue May 26, 2009 1:27 pm
Has thanked: 1 time

Re: Star Wars The Force Unleashed - PC Version .z files

Post by lordskylark » Tue Dec 08, 2009 2:06 am

Have you been able to figure out anything for the pcp/pcd files?

Magniel
ultra-n00b
Posts: 2
Joined: Thu Nov 05, 2009 8:10 am
Has thanked: 2 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by Magniel » Tue Dec 08, 2009 8:33 am

PantheraKing wrote:Hi,

I did a more generic script to extract files from files .lp

It works with any .lp files (If not just tell me but i've tested it on almost all files)
If you can figure out some of the "UNKNOWN" fields please tell me, because i'm writing a SWTFU Tool like Kotor Tool

Code: Select all

.
.
.
That script don't work for me. QuickBMS shows "Error: invalid command "elseif" or arguments 3 at line 86" I'm noob, so I don't see any problem on that line...

User avatar
aluigi
VVIP member
VVIP member
Posts: 1925
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 643 times
Contact:

Re: Star Wars The Force Unleashed - PC Version .z files

Post by aluigi » Tue Dec 08, 2009 10:52 am

in case of problems like this check EVER if exist a newer version of QuickBMS (0.3.10 at the moment):
http://aluigi.org/papers.htm#quickbms

UberBlack
advanced
Posts: 43
Joined: Thu Oct 22, 2009 8:54 pm
Has thanked: 3 times
Been thanked: 5 times

Re: Star Wars The Force Unleashed - PC Version .z files

Post by UberBlack » Tue Dec 15, 2009 9:28 pm

Image

Chrrox and I have been working on the Unleashed model format. Here is a picture of a StormTrooper that we ripped. The ripping is not yet automated, yet if you would like the script it will be posted on my blog when complete: http://uberblack3d.blogspot.com/

WE NEED YOUR HELP!

What is left to do?

We would like to get some help finding the bone format and integrating this into our 3DSMAX script. Also animation is very possible and we also need help with this. If you are interested in helping in this project let Chrrox or me know or just edit our script and post it.

Also if anyone is good at figuring out the sound format that would be awesome too.

Note: All the mesh formats with UV's have been discovered and is able to be imported into max via Script.

Very special thanks to Luigi for a great BMS script to extract the assets.

The first link is for the Storm Trooper model, and Animations. I have also included the Alpha of the 3DSMax script that we are still working on for other's to critique or improve. The second is a PCP & PCD file which I think is sound.

Storm Trooper Mesh & Animations
http://www.sendspace.com/file/gvvi7s

Storm Trooper Sounds
http://www.sendspace.com/file/ytdr37

Post Reply