| View previous topic :: View next topic |
| Author |
Message |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Fri Nov 09, 2007 7:40 am Post subject: PS3 themes |
|
|
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: | 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. |
|
| Back to top |
|
 |
ps2asker
Joined: 12 Nov 2007 Posts: 7
|
Posted: Mon Nov 12, 2007 3:10 pm Post subject: |
|
|
| Nice find, Would it be possible to use this code to reverse the process?(extract the theme) |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Mon Nov 12, 2007 5:25 pm Post subject: |
|
|
| 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.. |
|
| Back to top |
|
 |
almar
Joined: 13 Nov 2007 Posts: 3
|
Posted: Tue Nov 13, 2007 10:27 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
codelogic
Joined: 10 Nov 2007 Posts: 10
|
Posted: Thu Nov 15, 2007 11:43 am Post subject: Disassembly |
|
|
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: |
#!/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 |
|
| Back to top |
|
 |
codelogic
Joined: 10 Nov 2007 Posts: 10
|
|
| Back to top |
|
 |
unsolo
Joined: 16 Apr 2007 Posts: 155 Location: OSLO Norway
|
Posted: Thu Nov 15, 2007 7:51 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
almar
Joined: 13 Nov 2007 Posts: 3
|
Posted: Thu Nov 15, 2007 10:08 pm Post subject: |
|
|
| unsolo whats your opinion of the used compression/encryption? |
|
| Back to top |
|
 |
codelogic
Joined: 10 Nov 2007 Posts: 10
|
Posted: Sat Nov 17, 2007 5:52 pm Post subject: Theme extractor |
|
|
| If anyone's interested in a theme extractor, it's available here. |
|
| Back to top |
|
 |
|