Hacking Tutorial
Updated
How to import and export a .dds.phyre texture
Before starting:
Importing an image from .dds.phyre file:
Tools needed:
QuickBMS method:
Exporting an image to .dds.phyre file:
Tools needed:
Instructions:
TODO:
Thanks to:
Revised:
- This guide only mentions use of dds.phyre files that are swizzled and ARGB8. Other texture types are not included and may (or rather, will) end in unexpected behavior if used.
- This can be checked by looking at the "Texture Base Format" of the GXT file in the .dds.phyre file.
- This guide assumes you're using Windows.
- Linux users can figure out how to do it themselves. It's not difficult.
- If the image you imported was flipped vertically, it needs to still be flipped vertically when exported. Otherwise it'll look broken if not wonky.
Importing an image from .dds.phyre file:
Tools needed:
QuickBMS method:
- Download QuickBMS and extract it
- Download the attached file
PhyreEngine_PTexture2D_phyre.bms.zip
and extract it - Put the extracted
PhyreEngine_PTexture2D_phyre.bms
script file in the same directory as QuickBMS. - In the current directory of QuickBMS, open up cmd/terminal and use the command
Code:
quickbms.exe PhyreEngine_PTexture2D_phyre.bms <YOUR_TEXTURE_FILE>.dds.phyre
- Grab the extracted .gxt file from the previous step and copy it over to Scarlet's directory.
- In Scarlet's directory, open cmd/terminal and use the command
Code:
ScarletTestApp.exe <YOUR_EXTRACTED_GXT_FILE>.gxt
- You now have the extracted texture file in .png format.
Exporting an image to .dds.phyre file:
Tools needed:
- psp2gxt
- GIMP, Photoshop, or some image editor/processor supporting tga
- A hex editor (Hexinator is recommended)
Instructions:
- Get the texture you ripped from the .dds.phyre file (that is currently in .png format) and import it into your image processor / editor
- Export as .tga file. If the .png has transparency, ensure the exported .tga file is still transparent - The finished .dds.phyre file will look like a blocky white mess otherwise.
- In the current directory of psp2gxt, open up cmd/terminal and use the previously exported .tga file as the input file. So, the command should look something similar to this:
Code:
psp2gxt.exe -i <YOUR_TGA_FILE>.tga -o <YOUR_OUT_FILE>.gxt
- Open the original .dds.phyre file in a hex editor and copy the phyre container's header. This should be all the way from 0x0000000 to before "GXT" (
0x47 0x58 0x54
) - Open the (edited) .gxt file (exported from psp2gxt) in the hex editor
- Paste the bytes copied from the original .dds.phyre file (in step 4) and insert at the beginning of the .gxt file. Make sure you do not overwrite the bytes from the .gxt file.
- Save as a new file and name it whatever the original .dds.phyre file was
TODO:
- Mention DXT formats
- Add image instructions to follow along with
Thanks to:
- TheUkrainianBard for the Phyre scripts
- xdanieldzd for Scarlet
- Everyone else that worked on reversing the Phyre Engine container and GXT texture format
Revised:
- 4/11/2019
- 5/19/2023 - Formatting
- 5/22/2023 - Formatting, add missing instructions
- 6/4/2023 - Remove link to infected ZenHAX website and add local mirrors
Attachments
Last edited by master801,