-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add Support for shared librairies. #41
Comments
Hi @0xMirasio thanks for using d2d! If I am getting this right, the use case you are talking about is one where you want both decompilation output inside the main binary being debugged and inside the shared libraries it uses, right? As a solution to this scenario, would you be willing to open another instance of IDA, start decomp2dbg on there, an then connect it as well? Currently, we have the ability to load multiple decompiler outputs into one debugger but the problem becomes the main base address which all things are based off. I think the solution to this problem will be:
|
Hello, thank for your response. |
@0xMirasio alright, so here is the plan: You will now be able to configure the base address we load symbols at like so:
|
@0xMirasio alright, the PR is just about ready to land. Would you be able to checkout into that branch and play with it a little? I tested it with only connecting and IDA instance that had libc decompiled, then I mapped it to the virtual address space and it worked. In this approach we can still only have 1 ida open at a time and connected.
then break in libc_start_main or something. Still need to make it not freak out when you are in an address space outside its known addrs. You may need to find your libc load location with vmmap or the like. |
@0xMirasio actually, its in master now; use the command like the README shows here: If you find any bugs let me know, and if you are happy with the new feature close the issue :) |
Hi again @mahaloz .
d2d server start on libvtwrap on port 3661 Output of gdb when step in:
Did i miss something ? Will debug in this afternoon, maybe there is still offsets problems. |
@0xMirasio interesting, ok a few things:
I've pushed more changes to main to help you with this crash. You should now see a more explicit address printed out when you error at this same place. The address printed out should be an offset... if it's not, that means PIE analysis failed. This should also fix the crash you see on the screen about the banner. |
Pretty sure about last base adress/start addr. I'm not sure i have latest pwndbg, will see tomorrow. |
Really weird, so decompiled adress is okay, it correspond to the adress of the function i want. (_parse_special_tag) here are some info : Also i tested on several libs from the same project, i have the same error |
@0xMirasio I think I just fixed the bug. Try on |
Hello Back. Seem the adress is correct but decompilation don't work. Also i removed base-addr-start/end and i have the same adress given by client (weird?). |
Alright, looks like it's time for me to stop blind debugging. @0xMirasio could you:
I'll look at it some point this week. |
Hello. Can't send neither librairie neither binary as the software is my companie private data. I will try to debug from my side but unfortunately i cant give you my sample (sorry). |
I'm going to try to trigger the bug via other non private sample, and send you if I can retrigger it. |
@0xMirasio No problem, but yeah, if you can trigger it another way, that would be great. I would recommend |
Closing this issue since remote debugging is now supported (allowing for custom address range assigning); however, you still can't decompile and debug two things simultaneously. This support must be added at some point to accomplish shared lib debugging. Deferring to #43. |
Hello. Tested on binary it work perfect, great tools!
But when i test on shared libraries started with another binary, after connecting to the server, the tool won't work.
(no decompilation, breakpoints have offset errors) .
I know original behavior is to start the server on binary and use the connect while debugging the binary with gdb. But in my situation I can't debug the libraries without starting the linked main binary before.
(Maybe adding muliple server syncing ? Decomp2dbg can't export ida decompiled code on gdb because shared librairies is extern but maybe adding another syncing server on shared lib IDA instance + syncing correctly when jumping on shared lib can work)
The text was updated successfully, but these errors were encountered: