XeNTaX
http://forum.xentax.com/

Star Wars The Force Unleashed - PC Version .z files
http://forum.xentax.com/viewtopic.php?f=10&t=3823
Page 1 of 8

Author:  japamd [ Mon Nov 02, 2009 12:36 am ]
Post subject:  Star Wars The Force Unleashed - PC Version .z files

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:
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!

Author:  GameZelda [ Tue Nov 03, 2009 12:25 am ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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

Author:  japamd [ Tue Nov 03, 2009 1:13 am ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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

Author:  aluigi [ Thu Nov 05, 2009 4:33 am ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

the correct script would be:
Code:
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

Author:  japamd [ Thu Nov 05, 2009 3:08 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

Thanks, aluigi.

Author:  swuforce [ Thu Nov 05, 2009 9:51 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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

Author:  GameZelda [ Sun Nov 08, 2009 6:33 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

Code:
# 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

Author:  Magniel [ Tue Nov 24, 2009 8:14 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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?

Author:  CMihai [ Mon Nov 30, 2009 12:20 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

The script don't work for larger files.

Quote:

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

Author:  lordskylark [ Tue Dec 01, 2009 7:22 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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

Author:  PantheraKing [ Fri Dec 04, 2009 9:50 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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:

# 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


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

Author:  lordskylark [ Tue Dec 08, 2009 2:06 am ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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

Author:  Magniel [ Tue Dec 08, 2009 8:33 am ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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:
.
.
.


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...

Author:  aluigi [ Tue Dec 08, 2009 10:52 am ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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

Author:  UberBlack [ Tue Dec 15, 2009 9:28 pm ]
Post subject:  Re: Star Wars The Force Unleashed - PC Version .z files

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

Page 1 of 8 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/