Exetools

Exetools (https://forum.exetools.com/index.php)
-   Source Code (https://forum.exetools.com/forumdisplay.php?f=46)
-   -   IDA Ghidra decompiler plugin source code release (https://forum.exetools.com/showthread.php?t=19510)

chants 04-29-2020 15:42

IDA Ghidra decompiler plugin source code release
 
There are still a good number of cleanup tasks for things like building on Linux, building on 32-bit systems, moving every path variable for bison or libraries to a single unified place.

This was built with an older Ghidra release not the current one and contains some special customizations of the sleigh source that it is built with by necessity as the P-code parser portion is a necessity. Otherwise the decompiler itself is communicated with via the interface that the Java frontend uses in Ghidra.

My focus was on 16-bit code so a lot of special details dealing with both IDA and Ghidra for these cases are built in for handling them. There are no good 16-bit decompilers in existence. But the concept of Ghidra which requires parameter identification before the decompilation pass was in the works and never completely finished. The code is somewhat staged to do it though.

You can browser or download the source here: https://github.com/GregoryMorse/GhidraDec

GhidraDec project is the main project as the others were test projects, or projects to test total decompiler integration. Ideally a build variable should allow building against the full decompiler, as well as the current separate binary approach. For technical design reasons, its definitely better to leave the decompiler as a separate process, Ghidra may have had to do it do to use of Java, but there are other reasons dealing with processes and threads and stability and memory leaks, crashes or hangs.

SegWolf 04-29-2020 19:30

Is this your own work or are you just sharing it with us? I ask since the source was available online from the past 9 months on github...

Is this the same as the one here:
Quote:

https://forum.exetools.com/showthread.php?t=19264
Thanks for sharing this :)

chants 04-29-2020 21:19

It is my own work, it was kept in a private repo. For the sake of continuation of the project while its still relevant, I had it made public. I simply have not had time to work on remaining parts. It is basically a mess of technical details mostly on the IDA database side, that requires a lot of testing.

The decompiler.cpp/h and sleighinterface.cpp/h contain all of the crucial code. I am not sure if its forward compatible or not, but as long as the protocol between the decompiler and UI did not change, and as long as the sleigh classes did not have any major changes, it should be.

A lot was done including trying to make all typedefs, minimal function declarations which are needed, forward/initialized/uninitialized data definitions, in the right order including dealing with circular references and such. A lot of recursive functions were eliminated using STL stacks, to allow for unlimited depth without stack overflows in this regard.

SegWolf 04-29-2020 21:40

Quote:

Originally Posted by chants (Post 119988)
It is my own work, it was kept in a private repo. For the sake of continuation of the project while its still relevant, I had it made public. I simply have not had time to work on remaining parts. It is basically a mess of technical details mostly on the IDA database side, that requires a lot of testing.

Thanks. I'd asked so that I could contact you directly outside of the forum with some of my private questions about this that I cannot post here.
As you know, I do not have the private message privileges yet :D

argie 08-17-2020 20:40

Quote:

Originally Posted by SegWolf (Post 119989)
Thanks. I'd asked so that I could contact you directly outside of the forum with some of my private questions about this that I cannot post here.
As you know, I do not have the private message privileges yet :D

chants the hero.

I really wonder if by some magic magic, this (not full capacity obv) could be made for x64dbg.

Cheers chants!

agoo 08-18-2020 15:04

I wish I also had private message privileges for my questions too.


All times are GMT +8. The time now is 22:38.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX