Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to obtain the LLVM code? #574

Closed
frala19871987 opened this issue Oct 10, 2016 · 3 comments
Closed

How to obtain the LLVM code? #574

frala19871987 opened this issue Oct 10, 2016 · 3 comments
Labels

Comments

@frala19871987
Copy link

frala19871987 commented Oct 10, 2016

Hi,
is it possible to obtain the LLVM starting from the assembly code? I'd like to have any LLVM instruction represented a Python object that I can use.

My goal is just to have a platform agnostic representation of the assembly code. Do you think BIL would be better?

Thanks for your help

@ivg ivg added the question label Oct 10, 2016
@ivg
Copy link
Member

ivg commented Oct 10, 2016

If you're talking about LLVM IR, then it is not possible right now. However, it would be easy to write a BAP IR -> LLVM-IR transformation. Unfortunately, I don't have time right now, to implement it myself, but I will create a feature request, in a hope, that someone will implement it.

My goal is just to have a platform agnostic representation of the assembly code. Do you think BIL would be better?

Yep, I think that BIL is better, as it was designed for this specific purpose. The BAP IR, that is an intermediate representation of BIL, is actually very close LLVM IR, that's why I'm claiming that it would be easy to write a transformation from one to another. Another good point of the BIL is that it is formally specified and is mostly side-effect free, that facilitates writing formal program analysis tools.

@ivg ivg closed this as completed Oct 10, 2016
@ivg
Copy link
Member

ivg commented Oct 10, 2016

Issue #575 is created.

P.S. although I closed the issue, under assumption that I provided a full answer to your question, don't hesitate to ask more questions or to reopen the issue again, if my assumption was wrong :)

@frala19871987
Copy link
Author

Hi,
no worries I didn't close the issue on my own because i wasn't at home.

You clarified my doubts.

Thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants