PS3 themes

Technical discussion on the newly released and hard to find PS3.

Moderators: cheriff, emoon

Post Reply
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

PS3 themes

Post by jimparis »

The ps3 theme compiler available here was written in Python and turned into a Windows executable using "py2exe". If you take p3tcompiler.exe and extract 1705167 bytes starting at offset 2165248 then you get a zip file containing the compiled Python 2.5 code (.pyo).

I haven't managed to get it to run on Linux, because of some character set nonsense, but it should be doable. My python2.5 also seems to have some trouble finding modules named .pyo, but deals with .pyc, so I tested with something like:

Code: Select all

for i in $(find . -name '*.pyo'); do ln -sf $(basename $i) ${i%%pyo}pyc ; done
python2.5 ./p3tcompiler.pyc sample/01/sample.xml
There are online services that will decompile Python 2.5 .pyo for money, but I think free tools only go up to 2.3.
ps2asker
Posts: 7
Joined: Mon Nov 12, 2007 3:07 pm

Post by ps2asker »

Nice find, Would it be possible to use this code to reverse the process?(extract the theme)
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Sure, the first step would be to decompile the pyo and figure out how it works. I don't know enough about python bytecode to extend "decompyler" to work with 2.5..
almar
Posts: 3
Joined: Tue Nov 13, 2007 6:44 am

Post by almar »

Ive replicated your steps(partly independant). I also found out that the program packs all the files at the end, so i managed to inject a file of my own after the conversion to gim. I analysed it with a hex editor and found out that the beginning part(the strange pattern) the changes are minor. I think files are recognizable with 78 DA DD hex codes. For example in the example theme icon.gim is at offset 243Co, so a comparison can be made. I found out that the file got bigger, this is kind of strange since the complete record of gim's is bigger than the p3t file.(i probably made a mistake but the rest of the resulting p3t file is identical to the standard one)So there must be some kind of compression, but i couldnt find out which one, winrar doesnt recognize the resulting file. Maybe some kind of custom compression? But then it might be possible this is also used in pkg files or other ps3 related files so it would really help is somebody figured out how to decompile the pyo files that are found in the p3tcompiler.exe.
codelogic
Posts: 10
Joined: Sat Nov 10, 2007 5:00 am
Contact:

Disassembly

Post by codelogic »

I was able to disassemble (not decompile) p3tcompiler into python bytecode. Looks like the actual packing is done in cxml.

Here's the program I wrote to disassemble it

Code: Select all

#!/usr/bin/python                                                                                                                                                                     

import zipimport
import dis

# change to full path of exe                                                                                                                                                          
z = zipimport.zipimporter("p3tcompiler.exe")

cxml = z.load_module("cxml")
p3tcompiler = z.load_module("p3tcompiler")

dis.dis(cxml)
Last edited by codelogic on Thu Nov 15, 2007 11:55 am, edited 2 times in total.
codelogic
Posts: 10
Joined: Sat Nov 10, 2007 5:00 am
Contact:

Post by codelogic »

Ok, I guess there's a message limit so I can't paste the disassembly directly.

Here are the links

Disassembly of p3tcompiler.pyo

and

Disassembly of cxml.pyo
unsolo
Posts: 155
Joined: Mon Apr 16, 2007 2:39 am
Location: OSLO Norway

Post by unsolo »

Using either spu's or the RSX access one should be able to render a "clone" one day in other-os which also uses custom textures.

My idea is to make users enter a familiar other-os enviroment were we can have open media center's ++

Perhaps someone wants to start working on it :)
Don't do it alone.
almar
Posts: 3
Joined: Tue Nov 13, 2007 6:44 am

Post by almar »

unsolo whats your opinion of the used compression/encryption?
codelogic
Posts: 10
Joined: Sat Nov 10, 2007 5:00 am
Contact:

Theme extractor

Post by codelogic »

If anyone's interested in a theme extractor, it's available here.
Post Reply