Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Texture2D with LZO (unreal 3) in The Last Remnant

Featured Replies

  • Author
  • Localization

cfarl, posted Mon Oct 01, 2018 6:55 pm (38927)


Hi all!

I'm working in a pt-br localization of The Last Remnant. Currently, I'm figthting with some upk files to extract textures from them to edit and replace.

Here my upk (from xbox360):

https://drive.google.com/open?id=1M-ZwBeQzuq0HbWfMnIDYEA8fjxC1hRcT

I used Gildor UModel to open, visualize and extract textures as DDS from the upk.

I also used Gildor Unreal Package Extractor to extract .Texture2D files from this upk. Here is this file:

https://drive.google.com/open?id=1g6hnbk5F3m0lDxnLvOUMgq4_0_lir4na

It seems there the DDS texture inside the .Texture2D has a LZO compression, but I had no sucess in extracting it.

So... Here I'm, asking for your help.

How can I extract the DDS file from the .Texture2D? Or, how can I get the DDS from the LZO in this .Texture2D file?

Thanks in advance,

cfarl
  • Author
  • Localization

cfarl, posted Tue Oct 02, 2018 2:15 pm (38942)


Well, I did some improvements...

After looking at this page http://wiki.tesnexus.com/index.php/Savegame_file_format_-_XCOM:EU_2012#Data_Structures I found that there is FCompressedChunk in my Texture2D file.

So, I extracted this part of the Texture2D file, that begins with the magic 9e 2a 83 c1:

https://pasteboard.co/HGAOU21.jpg

Now, using the FCompressedChunk record:

FCompressedChunk
? - FCompressedChunkHeader ? ? // 16 bytes
? - FCompressedBlock
? ? ? - FCompressedBlockHeader // 8 bytes
? ? ? - Raw compressed data ? ?// variable size

I got:

// FCompressedChunkHeader - 16 bytes
9E 2A 83 C1 ? ?4 bytes UE3 package signature (magic)
00 02 00 00 ? ?4 bytes Block size
00 00 0b 36 ? ?4 bytes Compressed size
00 00 80 00 ? ?4 bytes Uncompressed size

// FCompressedBlockHeader - 8 bytes
00 00 0b 36 ? ?4 bytes Compressed size
00 00 80 00 ? ?4 bytes Uncompressed size

The uncompressed image is a PF_DXT5, width 256, height 32
In fact, I have 0x8000 = 32.768 = 256 x 32 (uncompressed image size) * 4 (as each pixel is RGB and a alpha channel)

// Raw compressed data
From compressed size, 0x0b36 = 2.870 bytes

In the previous image, I selected 2.870 bytes from the end of the Texture2D file. They are the bytes in blue.

So, this is what I have until now.

But... There is 8 unknow bytes just between FCompressedBlockHeader and Raw compressed data: 02 01 00 00 , 00 00 60 00. Do you know what could be this data?

And... the raw data is LZO1X_1 compressed. What I have to do to extract this data? I have to take it and add a lzo header to extract with lzop or another lzo extractor?

Your help is appreciated. Thanks!

?
  • Author
  • Localization

cfarl, posted Tue Oct 02, 2018 3:38 pm (38946)


New advances....

There is no 8 unknow bytes. This bytes are part of the raw data.

So, using the following script I could extract the compressed data:

endian big
comtype lzo1x
get magic long
get lixo long
get ZSIZE long
get SIZE long

print "Value of magic: %magic|x%"
print "Compressed size: %ZSIZE|x%"
print "Uncompressed size: %SIZE|x%"

get trash long
get trash long

clog "extracted.txt" 0x18 ZSIZE SIZE

Result:

offset filesize filename
--------------------------------------
Value of magic: 0x9e2a83c1
Compressed size: 0x00000b36
Uncompressed size: 0x00008000
00000018 32768 extracted.txt

- 1 files found in 0 seconds
coverage file 0 99% 2894 2902 . offset 00000018
  • Author
  • Localization

cfarl, posted Tue Oct 02, 2018 4:49 pm (38947)


Now... I have this extracted data....

It seems to be the DDS data of my 256 x 32 DXT5 image.

https://drive.google.com/open?id=1U8WU5x37iyfZgfY80EUEObCH7LmHvrJZ

As the extracted file comes from xbox, you have to do unswizzle and byte swap, and add a dds header.

If you are extracting the texture2d from pc, just put a dds header.

That's all! :D

Hope this can be usefull!
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.