PS3 Is there a bytecode interpreter for PS3?

afrv

Member
I stumbled across a debug page on a game, that showed the names of almost every single function in the game. Bytecodes were paired with them. I did research and found it's an encoded way to call on variables and functions via interpreter.
Is there a bytecode interpreter for PS3?
 
I stumbled across a debug page on a game, that showed the names of almost every single function in the game. Bytecodes were paired with them. I did research and found it's an encoded way to call on variables and functions via interpreter.
Is there a bytecode interpreter for PS3?
I am not really sure what you mean... Maybe a screenshot of the Debug page you saw would help us figure it.

Are you talking about converting ps3 binary code into ppc language?

If so, you need to use a 32bit ppc disassembler to which you must feed your decrypted self or sprx file.
You get a ppc disassembler with IDA (under expensive license except for an old free version) & Ghidra (open source).
You will only get all functions names if you have the Debug symbols though, otherwise the exports/imports functions will be named properly but everything else will be given generic names.

And if ever you mean converting ps3 binary code to ppc then to C++, you would also need a decompiler, IDA offers an add-on to do that but it costs a fortune, on top of an already very costly license for the main software. Ghidra includes that feature for free.

For info, using IDA & Ghidra is not the most intuitive thing if you are a complete noob, it takes a while to discover/get used to & of course it implies using/learning ppc language basics.
 
I am not really sure what you mean... Maybe a screenshot of the Debug page you saw would help us figure it.
Game is a LittleBigPlanet 2 debug build. By entering the ipv4 of my ps3 in browser with the game open and webman disabled, it has a whole debug page where you can view scripts etc. Here is a sbcreenshot of a portion of the bytecode section of one of the scripts, it's fairly intuitive from there. Disassembly is shown beside it.
upload_2020-6-12_9-35-40.png

I am more planning some sort of way to view this directly in the memory based off bytecode offsets. If that makes any sense at all, I can't tell if I'm completely off the meaning of bytecode yet or not.

Are you talking about converting ps3 binary code into ppc language?
Generally bytecodes here are used to load predetermined functions/call variables (likely from a line?) - Good quote/info (though for JVM, uses same idea) here: https://www.javaworld.com/article/2077233/bytecode-basics.html

If so, you need to use a 32bit ppc disassembler to which you must feed your decrypted self or sprx file.
You get a ppc disassembler with IDA (under expensive license except for an old free version) & Ghidra (open source).
You will only get all functions names if you have the Debug symbols though, otherwise the exports/imports functions will be named properly but everything else will be given generic names.

I do have the debug symbols along with self

For info, using IDA & Ghidra is not the most intuitive thing if you are a complete noob, it takes a while to discover/get used to & of course it implies using/learning ppc language basics.
Oh yeah, I'm aware of that. Learn new things every day lol


I was thinking it might've been a game with a source code leak like the 360's gears of war 3.
LittleBigPlanet in sense of debug content available is actually quite low. So far all of the debug content has just been people in the community buying beta tester ps3s from ebay
 
Game is a LittleBigPlanet 2 debug build. By entering the ipv4 of my ps3 in browser with the game open and webman disabled, it has a whole debug page where you can view scripts etc. Here is a sbcreenshot of a portion of the bytecode section of one of the scripts, it's fairly intuitive from there. Disassembly is shown beside it.
View attachment 26244
I am more planning some sort of way to view this directly in the memory based off bytecode offsets. If that makes any sense at all, I can't tell if I'm completely off the meaning of bytecode yet or not.


Generally bytecodes here are used to load predetermined functions/call variables (likely from a line?) - Good quote/info (though for JVM, uses same idea) here: https://www.javaworld.com/article/2077233/bytecode-basics.html



I do have the debug symbols along with self


Oh yeah, I'm aware of that. Learn new things every day lol



LittleBigPlanet in sense of debug content available is actually quite low. So far all of the debug content has just been people in the community buying beta tester ps3s from ebay
I am not at all familiar with Littlebigplanet2 game internals or the scripting language it uses, I cannot help you much with that.
Someone else might have experience with the lbp2 scripting & chime in.

You are dealing with game specific bytecode totally unrelated to ppc (the low level language giving the bytecode used by the ps3 ppu & spu processing units).
According to the data in the screenshot, this bytecode uses 64bit instructions as opposed to the ps3's ppc which uses 32bit instructions both for kernel & userland with 64bit memory addressing in ps3 kernel and 32bit memory addressing in ps3 userland.

To convert chunks of this bytecode from/to corresponding instructions (or mnemonics), you would need an assembler/disassembler tool, specific for the scripting language used to produce the bytecode. That's exactly what the Debug page must do if it shows you those disassembled instructions on the fly.

Broadly speaking, bytecodes can come in many forms, all sorts of scripting/programming language engines can produce bytecode, for example you can get bytecode from javascript, actionscript, python, java, .net, regex etc..
The list goes on & on & for each type of bytecode, you need its specific interpreter, there is no such thing as a universal bytecode interpreter.
No need to complicate matters further talking about JIT/AOT compilation, the ps3 cannot use those in userland due to security restrictions on writable executable memory allocation, it can only use interpreters!

Do not confuse interpreter & disassembler at this stage, interpreting basically means using an interpreter software to read whatever custom bytecode in order to determine what actions that interpreter software should take & what functions it should call to complete the tasks described by the custom bytecode whereas disassembling is only a way to convert the custom bytecode to a list of human readable & organised instructions so you can make sense of it.
In short, interpreting jobs are meant for processing units and disassembling jobs are meant for people!
And to go back to the question in your thread title, other than the interpreter included in the lbp2 game engine itself, there is no other bytecode interpreter for ps3 available to interpret the lbp2 scripting engine bytecode.

Afaik Scratch was the LBP games scripting language, that's maybe what produced this bytecode. There were several versions of Scratch, at least 3, the oldest version was implemented over a scripting language called squeak, then there was a version built over actionscript (Adobe/Macromedia Flash scripting) & finally another version implemented over javascript. I have no idea what lbp2 might be using.
Finding an appropriate disassembling tool for lbp2 produced bytecode on PC may or may not be easy, it could even be impossible or maybe only available as a very expensive add-on. It really depends on the lbp2 scripting language implementation & also on whether it uses standard stuff or not. Depending on the situation, it might also be possible to write a ida/ghidra script that would customise the use of an existing included disassembler for the underlying scripting language. If ever it were possible, that would mean some R&D & some python programming though...
Ultimately it's also possible that the debug tool that produced the page in the screenshot is your best option if it can disassemble any bytecode produced by the game engine on the fly.

I am still unsure what you are trying to achieve & I am sorry if this leaves you with more questions than you started with.
Anyway, good luck with this research. ;-)
 
Last edited:

Similar threads

Back
Top