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

macOS support, fix #9, function parameters #10

Merged
merged 7 commits into from
Aug 26, 2021
Merged

Conversation

nneonneo
Copy link
Contributor

@nneonneo nneonneo commented Aug 10, 2021

This patchset introduces a few fixes and improvements to ghidra2dwarf:

  • Added macOS support by compiling libdwarf-20200719 as a shared library
  • Added a status message so that progress is more obvious on large binaries with many functions
  • Eliminated a redundant call to get_decompiled_function to cut down on script execution time
  • Generate formal_parameter tags for function parameters to improve backtraces and debugging experience
  • Fix Java crash reported in Crashes on Ghidra 10.0.1 #9 by using defaultFieldName if fieldName is not available (the segfault is caused by a segfault from passing a NULL pointer through to a libdwarf function).

The decompiler might fail on certain functions for any number of reasons, and
they may not even be functions that matter for debugging purposes. Handle this
situation gracefully by outputting an error comment to the decompiled source and
skipping line number generation.
meowmeowxw added a commit that referenced this pull request Aug 25, 2021
@NextLight
Copy link
Collaborator

Hey, thank you so much for your contribution, we appreciate it!

We would like to avoid distributing binaries from untrusted (a.k.a. not us) sources.
I'm going to merge this PR, but I will revert the Mac OS support immediately after. I apologize for the inconvenience.

We plan to build libdwarf automatically via CI and hopefully it will happen very soon™ (likely today), so this should fix that issue for good.

On a side note, you probably have noticed that the code is horrible (mostly because it never exited the prototype phase).
I'm working on a big refactor (a.k.a. I've rewritten everything) to make it nicer and a lot faster, so please keep that in mind if you were planning to make big changes to it in the near future.

@NextLight NextLight merged commit e5e2a24 into cesena:master Aug 26, 2021
NextLight added a commit that referenced this pull request Aug 26, 2021
@nneonneo
Copy link
Contributor Author

Thank you! I understand the concern about the untrusted binary - makes sense. I am looking forward to the rewrite - this project is immensely useful in its current state already.

@meowmeowxw
Copy link
Member

We started working today on the CI for compiling libdwarf in a cross-platform way on https://github.com/cesena/libdwarf-ghidra2dwarf, so it will be available soon hopefully :) thank you for your support!

@NextLight NextLight mentioned this pull request Aug 26, 2021
@NextLight
Copy link
Collaborator

453bb3d should have officially added macOS support.
I don't have a mac to test this with, however I've extended the tests to run on macOS as well and they seem to pass.

Please let us know if you have trouble with it!

@nneonneo
Copy link
Contributor Author

Fantastic! I pulled the new changes and tested with macOS Ghidra - works like a charm.

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

Successfully merging this pull request may close these issues.

3 participants