Exetools  

Go Back   Exetools > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2020, 15:42
chants chants is offline
Family
 
Join Date: Jul 2016
Posts: 559
Rept. Given: 6
Rept. Rcvd 35 Times in 21 Posts
Thanks Given: 472
Thanks Rcvd at 835 Times in 392 Posts
chants Reputation: 35
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.
Reply With Quote
The Following User Gave Reputation+1 to chants For This Useful Post:
yoza (05-08-2020)
The Following 5 Users Say Thank You to chants For This Useful Post:
besoeso (04-29-2020), niculaita (04-29-2020), Stingered (04-29-2020), virus (05-04-2020), yoza (05-08-2020)
  #2  
Old 04-29-2020, 19:30
SegWolf SegWolf is offline
Friend
 
Join Date: Oct 2018
Posts: 15
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 3
Thanks Rcvd at 23 Times in 6 Posts
SegWolf Reputation: 1
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

Last edited by SegWolf; 04-29-2020 at 19:54.
Reply With Quote
  #3  
Old 04-29-2020, 21:19
chants chants is offline
Family
 
Join Date: Jul 2016
Posts: 559
Rept. Given: 6
Rept. Rcvd 35 Times in 21 Posts
Thanks Given: 472
Thanks Rcvd at 835 Times in 392 Posts
chants Reputation: 35
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.
Reply With Quote
  #4  
Old 04-29-2020, 21:40
SegWolf SegWolf is offline
Friend
 
Join Date: Oct 2018
Posts: 15
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 3
Thanks Rcvd at 23 Times in 6 Posts
SegWolf Reputation: 1
Quote:
Originally Posted by chants View Post
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



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


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX
( 1998 - 2020 )