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

Clean up disassembler #95

Open
riptl opened this issue Jul 31, 2021 · 1 comment
Open

Clean up disassembler #95

riptl opened this issue Jul 31, 2021 · 1 comment
Labels
decompiler Improvements to decompiler tooling p-low

Comments

@riptl
Copy link
Collaborator

riptl commented Jul 31, 2021

The current disassembler routine is a hack.
It starts by invoking Capstone, which doesn't support the complete Gekko instruction set.
Capstone is going to abort on undefined instructions.
We fall back to custom disassembler extensions for the rest.

Ideally, we'd want to use only one disassembler. Options:

  1. Add paired-singles support to Capstone
  2. Drop Capstone and build a custom pure-Python disassembler
@riptl riptl added the decompiler Improvements to decompiler tooling label Jul 31, 2021
@riptl
Copy link
Collaborator Author

riptl commented Jul 31, 2021

I did some research into Capstone / LLVM.
Capstone uses LLVM's TableGen sources to auto-generate .inc C sources.
The tooling is here: https://github.com/aquynh/capstone/tree/next/suite/synctools
Upstream LLVM is missing paired-single support, but I found a fork that has it:

I couldn't get code-generation to work regardless using llvm-tblgen-12.
I've reached out to DarkKirb to see if they are available to help out.
I'll leave this until then.

cc @riidefi any ideas? Could you take a look?

@riptl riptl added the p-medium label Jul 31, 2021
@riptl riptl added p-low and removed p-medium labels Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decompiler Improvements to decompiler tooling p-low
Projects
None yet
Development

No branches or pull requests

1 participant