Ghidra - open-source decompiler by Nisto at 4:55 PM EDT on March 22, 2019
Heard of this tool from a co-worker a little while ago.

https://ghidra-sre.org/

(P.S.: This is developed by NSA - paranoids be aware)

I haven't tested it extensively, but I did try decompiling some raw PS1 (MIPS R3000) code (it doesn't support PS-X EXE files natively from what I can tell) and was surprised how well it worked. I mean, IDA Pro has been around for decades, costing a boatload of money, and to this day doesn't even have a decompiler for MIPS.

Part of what I tried decompiling in Ghidra looked like this:

lui $v0, 0x3E0F ; Load Upper Immediate
ori $v0, 0x83E1 ; OR Immediate
multu $v1, $v0 ; Multiply (Unsigned)
mfhi $v0 ; Move From HI
srl $v1, $v0, 4 ; Shift Right Logical

As complicated as it may look, the C equivalent is just a simple unsigned division, which it correctly interpreted:

v1 = (unsigned int)v1 / (unsigned int)66;

I've confirmed that this will in fact compile to the assembly above with Psy-Q's official toolchain (at least with -Os switch). So it seems rather promising.

Anyone else had any experience with it? Plugins? Other resources?
by Kurausukun at 5:11 PM EDT on March 22, 2019
I hear Ghidra is excellent, but I haven't tried it myself because I don't have tons of use for a disassembler. Also that code looks a lot nicer if you use pseudoinstructions:

la $v0, 0x3E0F83E1 ; (probably some label)
mulu $v1, $v0
srl $v1, $v0, 4
by Nisto at 9:03 PM EDT on March 22, 2019
@Kurausukun: Regarding the magic value 0x3E0F83E1 -- it's a bit over my head, but it does in fact appear to be an arithmetic number used for unsigned division. There's a blog article here which explains the math.

Also possibly related: https://stackoverflow.com/questions/32683494/reversing-a-multiplication-in-64-bit-arithmetic
by 54634564 at 10:11 PM EDT on March 22, 2019
I'll wait until the full source code is released before touching it. The release archive includes source to the main program, but does not include the decompiler binary's source code.
by bnnm at 4:34 AM EDT on March 23, 2019
I played around a bit with it and thought it was pretty good, great to have a "second opinion". Not (Jiang Yang's) IDA-good yet, but I'm sure they are sweating buckets at hex-rays. You can't beat the price, plus decompiles MIPS and PowerPC unlike IDA+hexrays, can even CTRL+Z. I don't think it handles CPU variations yet though (some PS2 ELFs worked fine but it chocked on others) but I believe Ghidra is pretty extensible. Possibly useful docs: https://ghidra.re/

As for using it without source code, well, I'd say it's a calculated risk. It's done in Java which is easy to decompile, and I'm sure many eyes are trying to find something to put in their sites for the hitz. If they want to hide a backdoor they'd be more subtle than having Backdoor.class, so having source or not doesn't change much (case in point: zillions of open source projects with subtle security bugs).

On the other hand maybe they're trying to find out who would want to DLs/use it. Also, how do you know IDA doesn't have a backdoor planted at the request of the NSA? Where is the source there? (food for thought)
by Kurausukun at 5:51 AM EDT on March 23, 2019
@Nisto: Ah, modular arithmetic strikes again.


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source