Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghidra: Unable to decompile after rebasing addreses of PIE binary #70

Open
Angelo942 opened this issue Jun 7, 2023 · 1 comment
Open

Comments

@Angelo942
Copy link

Hi,

this is similar to #60

Rebasing causes the debugger to tell the decompiler that it's PIE, which means that it needs to rebase everything. But then the decompiler has essentially turned the binary into a Non-PIE address layout, which conflicts with what the debugger is telling the decompiler.

but the second part of your answer there seems to describe a different problem, so I'm opening a new issue specific to this plugin.

This causes both to send massive addresses (the ones seen inside the debugger), which both causes a mismatch and a number too large to send on XML.

In this case, after rebasing a binary to 0x555555554000, I get the following error: Decompiler server sent back a response without decompilation lines for 0x4360. I think GDB is sending the relative address to de decompiler, but Ghidra uses that value as an absolute address and not an offset, so if I set 0x0 as a base everything still works fine, but otherwise I get the wrong code or nothing at all.

For what I've seen in the source code the plugin does use the new base in ghidra, so I don't know where is the problem.
https://github.com/mahaloz/d2d-ghidra-plugin/blob/5bd8a4cadf2e7fbb29e6c801ccf117ad3d0b1550/src/main/java/decomp2dbg/D2DGhidraServerAPI.java#L46
https://github.com/mahaloz/d2d-ghidra-plugin/blob/5bd8a4cadf2e7fbb29e6c801ccf117ad3d0b1550/src/main/java/decomp2dbg/D2DPlugin.java#L139-L155

@mahaloz
Copy link
Owner

mahaloz commented Jun 7, 2023

Hi, I’m going to transfer this issue for easier tracking, since I plan on archiving this repo and moving all the code into the d2d repo.

@mahaloz mahaloz transferred this issue from mahaloz/d2d-ghidra-plugin Jun 7, 2023
@mahaloz mahaloz changed the title Unable to decompile after rebasing addreses of PIE binary Ghidra: Unable to decompile after rebasing addreses of PIE binary Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants