PSP decompiler
Griever, you are right it is easy to make a win version, I built it the last time git was updated and source changes are minimal (I corrected a single crash-causing-on-exit problem in main if I remember right, kudos to the TC/Author(s) on a great program... with portability no less!):
pspdecompiler_2009-05-20_win32.zip
binary and source ~ with minimal changes included ~ if anyone else stuck on win wants to see what this thing is capable of (note to newbs, it's not magic and doesn't do *everything* for you, you will still have to be able to check it's work against disassembly.)
Used msys with mingw installed, on a (bleh) vista x64 machine no less. If I can build it on here, it must not be that hard.
The "hardest" part really is tracking down libexpat.a/h for windows, I mentioned where to get it (prebuilt) in build txt (edit:/fixed) Probably a better, more maintainable way of doing win builds but for whatever reason msys wasn't co-operating with me on self-searching usr paths for libs/headers that day.
pspdecompiler_2009-05-20_win32.zip
binary and source ~ with minimal changes included ~ if anyone else stuck on win wants to see what this thing is capable of (note to newbs, it's not magic and doesn't do *everything* for you, you will still have to be able to check it's work against disassembly.)
Used msys with mingw installed, on a (bleh) vista x64 machine no less. If I can build it on here, it must not be that hard.
The "hardest" part really is tracking down libexpat.a/h for windows, I mentioned where to get it (prebuilt) in build txt (edit:/fixed) Probably a better, more maintainable way of doing win builds but for whatever reason msys wasn't co-operating with me on self-searching usr paths for libs/headers that day.
Last edited by cory1492 on Wed Jun 24, 2009 10:15 am, edited 1 time in total.
The one I posted is based on the current public source, compiled likely the same day hnaves last updated it.
I updated the original file now that I've had a chance to review the license for libexpat, there is now a link to a much simpler zip with prebuilt win32 expat binary in it instead of the pre-built dll packages.
BOOT.BIN (when it isn't just NULL'ed or a phony) or decrypted EBOOT.BIN should be static ELF files, I think psp decompiler currently only takes care of prx/relocateable elfs? (see the tail of this discussion)
I updated the original file now that I've had a chance to review the license for libexpat, there is now a link to a much simpler zip with prebuilt win32 expat binary in it instead of the pre-built dll packages.
BOOT.BIN (when it isn't just NULL'ed or a phony) or decrypted EBOOT.BIN should be static ELF files, I think psp decompiler currently only takes care of prx/relocateable elfs? (see the tail of this discussion)
it's strange, but it not work properly when i compile sources under MVS2008.
first, in function
void propagate_constants (struct subroutine *sub); //file constants.c
variable "struct ssavar temp" is not fully initialized.
second, if i use -n option, i've got unhandled exception in function
void destroy_hashtable (void *ptr, void *arg); //file hash.c
at: free (ht->table);
first, in function
void propagate_constants (struct subroutine *sub); //file constants.c
variable "struct ssavar temp" is not fully initialized.
second, if i use -n option, i've got unhandled exception in function
void destroy_hashtable (void *ptr, void *arg); //file hash.c
at: free (ht->table);
You will have to port the code, or set the right flags, or instruct MVS to use the Gnu C++ compiler instead of it's internal one. That kind of porting generally takes away portability, better to use msys with mingw (or cygwin I guess, though that will rely on cygwin dlls) to build with Gnu tools just like is done on the native build platform unless you want to either port it to MVS or keep mentioning problems with building it.[wl] wrote:it's strange, but it not work properly when i compile sources under MVS2008.
Thanks for win build issue answers.
The only problem I have now: pspdecompiler does not recognize game's eboots, though prxtool disasembles all of them ok and creates elfs, which are entirely recognized by IDA. I checked out "Chessmaster The Art of Learning" and "Archer Maclean's Mercury" EBOOT.BINs.
The only problem I have now: pspdecompiler does not recognize game's eboots, though prxtool disasembles all of them ok and creates elfs, which are entirely recognized by IDA. I checked out "Chessmaster The Art of Learning" and "Archer Maclean's Mercury" EBOOT.BINs.
I've reversed the code and I've seen that the switch are correct but you messed up the arguments of the switch, I think it's a bug...ne0h wrote:I've some problems with a "jr", the code show a empty switch...
I'm using the version posted by cory1492 (maybe not the lastest) , I hope that this problem will be fixed soon!
Anyway, amazing work man!
This is a part of code:
Code: Select all
var6 = ((int *)((var5 << 0x00000002) + 0x00000AB0))[0];
switch()
{
case 0:
var4 = 0;
goto label35;
case 1:
((int *)var2)[10] = var4;
goto label32;
case 2:
var4 = ((int *)var2)[10];
goto label32;
case 3:
[...]
Get Xplora!
-
- Posts: 37
- Joined: Wed Jan 14, 2009 5:53 am
-
- Posts: 388
- Joined: Tue Aug 12, 2008 12:46 am
Since this decompiler isnt fully finish, I dont think you should be worried about compiling it back into a prx.victorprosa wrote:Just a question...
How the makefile should look like when re-compiling the prx?
I mean, libraries, etc, cause it is supposed to have most libraries included, but i had problems when creating a makefile...
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
-
- Posts: 91
- Joined: Sun Feb 22, 2009 8:32 am
- Location: Melbourne Australia ZOMG
!? i cannot grab any of your words. Could you make some efforts to make yourself understandable ?[wl] wrote:really bad news :(
i tryed to decompile BOOT.BIN, with small success, only 2-3 functions decompiled, looks like the app decompiles GP and exports only? how do u think, it's possible to add arbitrary address to command line instead GP, because GP in boot.bin just start main thread and exit
Some games use a small BOOT.BIN to load the true game executable as a PRX. If you want to decompile the right thing, you'll need to get the right PRX and decompile it. Isn't that simple ?
EDIT: and some UMD may also present a fake BOOT.BIN, so you need to look for EBOOT.BIN which is normally encrypted.
-
- Posts: 203
- Joined: Sat Jul 05, 2008 8:03 am
I have try to compile it against openwatom it generate code for windows,linux,dos and os/2 i haven"t found the include expat.he he is not present in the win32 port given by cory1492
expat.h is missing
expat.h is missing
Code: Select all
[f731@port39 source]$ wcl386 *.c
Open Watcom C/C++32 Compile and Link Utility Version 1.8
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wcc386 abi.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
abi.c: 12 lines, included 1998, 0 warnings, 0 errors
Code size: 11
wcc386 allefast.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
allefast.c(700): Error! E1175: Too many initializers
allefast.c(701): Error! E1175: Too many initializers
allefast.c(702): Error! E1175: Too many initializers
allefast.c(703): Error! E1175: Too many initializers
allefast.c(704): Error! E1175: Too many initializers
allefast.c(705): Error! E1175: Too many initializers
allefast.c(706): Error! E1175: Too many initializers
allefast.c(707): Error! E1175: Too many initializers
allefast.c(708): Error! E1175: Too many initializers
allefast.c(709): Error! E1175: Too many initializers
allefast.c(710): Error! E1175: Too many initializers
allefast.c(711): Error! E1175: Too many initializers
allefast.c(712): Error! E1175: Too many initializers
allefast.c(713): Error! E1175: Too many initializers
allefast.c(714): Error! E1175: Too many initializers
allefast.c(715): Error! E1175: Too many initializers
allefast.c(716): Error! E1175: Too many initializers
allefast.c(717): Error! E1175: Too many initializers
allefast.c(718): Error! E1175: Too many initializers
allefast.c(719): Error! E1175: Too many initializers
allefast.c(720): Error! E1147: Too many errors: compilation aborted
Error: Compiler returned a bad status compiling 'allefast.c'
wcc386 allegrex.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
allegrex.c: 1407 lines, included 2717, 0 warnings, 0 errors
Code size: 3199
wcc386 alloc.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
alloc.c: 124 lines, included 1406, 0 warnings, 0 errors
Code size: 353
wcc386 analyser.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
analyser.c: 159 lines, included 2860, 0 warnings, 0 errors
Code size: 868
wcc386 cfg.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
cfg.c: 237 lines, included 1998, 0 warnings, 0 errors
Code size: 1160
wcc386 constants.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
constants.c: 195 lines, included 1998, 0 warnings, 0 errors
Code size: 912
wcc386 dataflow.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
dataflow.c: 151 lines, included 1998, 0 warnings, 0 errors
Code size: 756
wcc386 decoder.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
decoder.c: 173 lines, included 2383, 0 warnings, 0 errors
Code size: 861
wcc386 graph.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
graph.c: 235 lines, included 1998, 0 warnings, 0 errors
Code size: 1027
wcc386 hash.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
hash.c: 311 lines, included 1994, 0 warnings, 0 errors
Code size: 1290
wcc386 lists.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
lists.c: 248 lines, included 1169, 0 warnings, 0 errors
Code size: 906
wcc386 liveness.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
liveness.c: 176 lines, included 1998, 0 warnings, 0 errors
Code size: 1217
wcc386 main.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
main.c: 136 lines, included 3860, 0 warnings, 0 errors
Code size: 717
wcc386 module.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
module.c: 536 lines, included 1664, 0 warnings, 0 errors
Code size: 3980
wcc386 nids.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
nids.c(8): Error! E1055: Unable to open 'expat.h'
nids.c(192): Error! E1011: Symbol 'XML_Parser' has not been declared
nids.c(192): Error! E1009: Expecting ';' but found 'p'
nids.c(193): Error! E1063: Missing operand
nids.c(193): Warning! W111: Meaningless use of an expression
nids.c(193): Error! E1009: Expecting ';' but found 'struct'
nids.c(193): Error! E1011: Symbol 'xml_data' has not been declared
nids.c(193): Error! E1009: Expecting ';' but found 'data'
nids.c(194): Error! E1058: Cannot use typedef 'size_t' as a variable
nids.c(194): Error! E1009: Expecting ';' but found 'size'
nids.c(195): Error! E1077: Missing '}'
nids.c(195): Warning! W107: Missing return value for function 'nids_load'
nids.c(197): Warning! W132: No storage class or type specified
nids.c(197): Error! E1129: Type does not agree with previous definition of 'buf'
nids.c(197): Note! I2002: 'buf' defined in: nids.c(195)
nids.c(197): Error! E1011: Symbol 'xmlpath' has not been declared
nids.c(197): Warning! W102: Type mismatch (warning)
nids.c(197): Note! I2003: source conversion type is 'int '
nids.c(197): Note! I2004: target conversion type is 'char const *'
nids.c(197): Error! E1011: Symbol 'size' has not been declared
nids.c(197): Warning! E1181: Parameter 2, sign specifier mismatch
nids.c(197): Note! I2003: source conversion type is 'int *'
nids.c(197): Note! I2004: target conversion type is 'unsigned int *'
nids.c(197): Note! I2002: 'read_file' defined in: utils.h(22)
nids.c(197): Warning! W102: Type mismatch (warning)
nids.c(197): Note! I2003: source conversion type is 'void *'
nids.c(197): Note! I2004: target conversion type is 'int '
nids.c(197): Error! E1054: Expression must be constant
nids.c(198): Error! E1099: Statement must be inside function. Probable cause: missing {
nids.c: 303 lines, included 2099, 6 warnings, 15 errors
Error: Compiler returned a bad status compiling 'nids.c'
wcc386 operations.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
operations.c: 615 lines, included 1998, 0 warnings, 0 errors
Code size: 4686
wcc386 outcode.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
outcode.c: 317 lines, included 2791, 0 warnings, 0 errors
Code size: 2036
wcc386 outgraph.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
outgraph.c: 240 lines, included 2663, 0 warnings, 0 errors
Code size: 1670
wcc386 output.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
output.c: 781 lines, included 3521, 0 warnings, 0 errors
Code size: 6247
wcc386 prx.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
prx.c: 506 lines, included 1687, 0 warnings, 0 errors
Code size: 2917
wcc386 relocs.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
relocs.c: 622 lines, included 1664, 0 warnings, 0 errors
Code size: 4168
wcc386 ssa.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
ssa.c: 273 lines, included 1998, 0 warnings, 0 errors
Code size: 1629
wcc386 structures.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
structures.c: 376 lines, included 1998, 0 warnings, 0 errors
Code size: 1953
wcc386 subroutines.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
subroutines.c: 402 lines, included 1998, 0 warnings, 0 errors
Code size: 2160
wcc386 switches.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
switches.c: 137 lines, included 1998, 0 warnings, 0 errors
Code size: 777
wcc386 utils.c
Open Watcom C32 Optimizing Compiler Version 1.8
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
utils.c: 129 lines, included 2151, 0 warnings, 0 errors
Code size: 751
expat:
http://expat.sourceforge.net/
I believe I used a prebuilt bin for win32, like expat-win32bin-2.0.1.exe, to compile under msys/mingw.
http://expat.sourceforge.net/
I believe I used a prebuilt bin for win32, like expat-win32bin-2.0.1.exe, to compile under msys/mingw.
-
- Posts: 107
- Joined: Sat Jan 13, 2007 11:50 am
Is there some central repository where people post their reverted C code? Assuming someone starts working on reversing a prx, it sounds like a waste of effort if somebody else already reverted it...
Or is it the kind of stuff people are reluctant to share? Or is it illegal maybe?
Also, I'm quite new with that kind of stuff, but what does it mean when the decompiler finds a function that does nothing?
here's a random example from a file in firmware 6.xx:
Would that be a bug in the decompiler? A bug in the plugin? Something else?
Or is it the kind of stuff people are reluctant to share? Or is it illegal maybe?
Also, I'm quite new with that kind of stuff, but what does it mean when the decompiler finds a function that does nothing?
here's a random example from a file in firmware 6.xx:
Code: Select all
/**
* Subroutine at address 0x000001B8
*/
void sub_001B8 ()
{
return;
}
-
- Posts: 107
- Joined: Sat Jan 13, 2007 11:50 am
-
- Posts: 5
- Joined: Wed Nov 25, 2009 2:52 am
hello.Thanks for this tool.
I had found two similar tool (rec and boomerang)
http://www.backerstreet.com/rec/rec.htm
http://boomerang.sourceforge.net/
The first seem also "undestand" MIPS R3000 code.
the problem it is not open source,but maybe could be some kind of coperation
I had found two similar tool (rec and boomerang)
http://www.backerstreet.com/rec/rec.htm
http://boomerang.sourceforge.net/
The first seem also "undestand" MIPS R3000 code.
the problem it is not open source,but maybe could be some kind of coperation