ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sun Oct 21, 2018 8:22 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat May 19, 2018 1:59 pm 

Joined: Sun Feb 25, 2018 4:27 pm
Posts: 17
Is there a tool that can decompile (Star Wars: The Force Unleashed) game .xni files?


Top
   
PostPosted: Sun May 20, 2018 6:56 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9071
Info for other users, the file starts with "aCmp" and seems to contain a sort of uncompressed size 32bit field but the data in it is not really compressed due to the many duplicate and whole strings, probably it's an inefficient algorithm or the files are "compiled" from text to binary form.
I attached one of the samples.


Attachments:
File comment: OSD_HUB.xni
OSD_HUB.zip [78.95 KiB]
Downloaded 5 times
Top
   
PostPosted: Sun May 20, 2018 8:41 am 

Joined: Sun Feb 25, 2018 4:27 pm
Posts: 17
Also, in case it matters: the file was extracted (but not correctly or completely?) from an .lp game file with this script:

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

######################################
(http://forum.xentax.com/viewtopic.php?p=33723#p33723 *edit by aluigi*)


Top
   
PostPosted: Sun May 20, 2018 11:43 am 

Joined: Sun Feb 25, 2018 4:27 pm
Posts: 17
And this is the original lp file (with the xni file inside)...


Attachments:
osd_hub.xni_pc.lp.7z [2.01 MiB]
Downloaded 4 times
Top
   
PostPosted: Mon May 21, 2018 5:55 pm 

Joined: Sun Feb 25, 2018 4:27 pm
Posts: 17
To clarify: the xni file is only partially decompiled and readable...


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

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