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

Qbindiff can't guess the arch #20

Open
Fenrisfulsur opened this issue Jul 10, 2023 · 1 comment
Open

Qbindiff can't guess the arch #20

Fenrisfulsur opened this issue Jul 10, 2023 · 1 comment
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@Fenrisfulsur
Copy link
Collaborator

While trying to use qbindiff on a ARM32 Thumb program, i got the following exception:

Cannot guess the instruction set of the instruction at 0x....

I fixed the issue by hard-coding the mode and arch inside the file qbindiff/loader/backend/binexport.py but it could be cool to let the user define the arch and mode when he knows it, something like:

differ = qbindiff.QBinDiff(
    p, q,
    distance=Distance.canberra,
    ...,
    arch="ARM-32",
    mode="THUMB"
)
@Fenrisfulsur Fenrisfulsur added bug Something isn't working enhancement New feature or request labels Jul 10, 2023
@patacca
Copy link
Collaborator

patacca commented Oct 28, 2023

This is indeed a huge problem that happens when using the BinExport backend. It originates from the fact that BinExport doesn't export enough information to reliably reconstruct a capstone object at instruction level.
There have been few attempts to solve this (see #36) but it's still not over yet.

Here's a list of refinements that are left to do:

  • When the target architecture is not enforced (by either CLI or parameter) the algorithm has to guess it. It should be better to suggest enforcing the architecture manually when failing to guess correctly.
  • Use the global capstone object when disassembling with the old method

@patacca patacca added this to the 1.1.0 milestone Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants