PRXTool HTML disassembly
PRXTool HTML disassembly
I've just added HTML output mode to prxtool disassembly, it sets up all internal and external links to be anchors so you can jump around the disassembly (and if setup correctly you can even jump between modules).
You need to do a small bit of setup to get it to work correctly, especially the inter module jumps so here is a rough tutorial :)
To get it to work correctly you need to do a few things. First generate a new libdoc xml file for your firmware you are interested in using say:
prxtool -n psplibdoc.xml -x -s x ~/flash0_decypted/v3.02/kd/*.prx ~/flash0_decypted/v3.02/vsh/module/*.prx > 3.02.xml
This sets up the dependancy map. Now use this for your disassembly:
prxtool -n 3.02.xml --disasm --disopts wdx --xmldis --funcs functions.txt ~/flash0_decypted/v3.02/kd/*.prx ~/flash0_decypted/v3.02/vsh/module/*.prx
That should output a html file for each prx in your current directory. The only real problem with this is size, something like paf weighs in at around 50megs! Admittedly that isn't that different from a raw text dump but text editors generally can handle it better than webbrowser seem to. To access the inter module links you must first click on the link to the stub, then in the stubs header there should be an "Imported from xxxx.prx" line with the prx bit linked. Click this and it will take you to the linked module file if it exists.
Seems something like links is best to view (unless you have an absolute beast of a machine), still YMMV.
You need to do a small bit of setup to get it to work correctly, especially the inter module jumps so here is a rough tutorial :)
To get it to work correctly you need to do a few things. First generate a new libdoc xml file for your firmware you are interested in using say:
prxtool -n psplibdoc.xml -x -s x ~/flash0_decypted/v3.02/kd/*.prx ~/flash0_decypted/v3.02/vsh/module/*.prx > 3.02.xml
This sets up the dependancy map. Now use this for your disassembly:
prxtool -n 3.02.xml --disasm --disopts wdx --xmldis --funcs functions.txt ~/flash0_decypted/v3.02/kd/*.prx ~/flash0_decypted/v3.02/vsh/module/*.prx
That should output a html file for each prx in your current directory. The only real problem with this is size, something like paf weighs in at around 50megs! Admittedly that isn't that different from a raw text dump but text editors generally can handle it better than webbrowser seem to. To access the inter module links you must first click on the link to the stub, then in the stubs header there should be an "Imported from xxxx.prx" line with the prx bit linked. Click this and it will take you to the linked module file if it exists.
Seems something like links is best to view (unless you have an absolute beast of a machine), still YMMV.
oh well, there is a bemol :((((
as you can see disassembly of vfpu instructions are very incomplete :(
Code: Select all
mtv
viim.s
vi2f.q
vi2f.t
vmmov.p
Last edited by hlide on Sun Jan 07, 2007 11:58 am, edited 1 time in total.
i got the svn version but i'm really pissed off :
I'm adding the missing decoding code for the non decoded vfpu instructions.hli@HLIWORLD /d/game console/psp/src/prxtool$ ./bootstrap
.
sed: -e expression #3, char 19: Unterminated `s' command
/usr/share/aclocal/autoopts.m4:22: warning: underquoted definition of AG_PATH_AUTOOPTS
run info '(automake)Extending aclocal'
or see http://sources.redhat.com/automake/auto ... %20aclocal
configure.ac: installing `./install-sh'
configure.ac: installing `./missing'
Makefile.am: installing `./depcomp'
configure.ac:8: error: possibly undefined macro: AC_PRXTOOL_VERSION
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
well, i made a project under VS.Net 2003 and modify some files to make it compile. I'm adding missing VFPU insn decoding.
normally interesting changes are only done in disasm.C (renamed as disasm.cpp) so I expect to give you this file when finished so you can decide how to integrate them in the svn version.
normally interesting changes are only done in disasm.C (renamed as disasm.cpp) so I expect to give you this file when finished so you can decide how to integrate them in the svn version.
Last edited by hlide on Sun Jan 07, 2007 2:58 am, edited 1 time in total.
Okay, tbh though I have never found the burning desire to finish the VFPU stuff, not many kernel modules actually use vfpu and when they do it is almost always just a saving context kinda thing. However it will be nice to have a finished disasm, you might also want to check that the existing stuff is actually correct as some of it was a quick hack :P
ok i think prxtool can decode all vfpu instructions.
http://hlide.free.fr/download/PSP/prxtool/disasm.cpp
http://hlide.free.fr/download/PSP/prxtool/disasm.cpp
ok i fix the xml part so the xml output should be okay too (at least i hope so because i didn't test it in xml output).
http://hlide.free.fr/download/PSP/prxtool/disasm.cpp
http://hlide.free.fr/download/PSP/prxtool/disasm.cpp