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

feature request: add support lifting 32-bit x86 binaries to LLVM IR #4

Open
mewmew opened this issue Jun 9, 2020 · 0 comments
Open

Comments

@mewmew
Copy link

mewmew commented Jun 9, 2020

Hi tej!

I tried using g2llvm today to lift some binaries and it worked perfectly for the x86-64 binaries.

However, when I tried to lift 32-bit x86 binaries, I got the following stack trace:

Traceback (most recent call last):
  File "/home/u/Desktop/lifters/Ghidra-to-LLVM/g2llvm.py", line 49, in <module>
    module = xmltollvm.lift(xmlfile)
  File "/home/u/Desktop/lifters/Ghidra-to-LLVM/src/xmltollvm.py", line 70, in lift
    populate_func(ir_func, function)
  File "/home/u/Desktop/lifters/Ghidra-to-LLVM/src/xmltollvm.py", line 79, in populate_func
    populate_cfg(function, builders, blocks)
  File "/home/u/Desktop/lifters/Ghidra-to-LLVM/src/xmltollvm.py", line 110, in populate_cfg
    builder.store(stack_top, registers["RSP"])
KeyError: 'RSP'

I'm sure you are aware of this already. Just wanted to create a tracking issue for supporting 32-bit x86 assembly.

If you want to reproduce, I tried lifting add.o from https://github.com/mewmew/lift-samples/tree/master/x86_32/add.

To create add.o, run the following commands:

$ git clone https://github.com/mewmew/lift-samples
$ cd lift-samples/x86_32/add
$ make -B

Cheers,
Robin

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

No branches or pull requests

1 participant