Skip to content

[experiment]: Use capstone to implement ELF.libc_start_main_ret #2580

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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Apr 24, 2025

Use capstone to implement ELF.libc_start_main_ret.

Reasons:

  • Avoid text-based searching on objdump's output to ease maintenance.
  • Make it easier to support other architectures.
    powerpc64 still fail after this PR.
  • For fun.

I marked this PR as draft to get some early feedback, and some volunteer testers.

Testing

Need more testing!!! And some design works to make the code cleaner.

This PR has been manually tested on ( is pass, X is failure):

arch 2.28 2.36 2.31
x86_64
i386
mips
mips64el
arm64
armel
armhf
ppc64el
s390 N/A

Failure cases:

  • mips: Not really fail but upgrading capstone to v6.alpha should remove a condition.

Failure arch on dev:

  • armhf:
    Fail to decompile this target, this should use arm-linux-gnueabihf-objdump.

@tesuji tesuji marked this pull request as ready for review April 24, 2025 17:13
@tesuji tesuji changed the title [experiment]: Use capstone to refactor ELF.libc_start_main [experiment]: Use capstone to implement ELF.libc_start_main Apr 24, 2025
@tesuji tesuji changed the title [experiment]: Use capstone to implement ELF.libc_start_main [experiment]: Use capstone to implement ELF.libc_start_main_ret Apr 24, 2025
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.

1 participant