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

How to view or convert gtrib IR to LLVM IR #15

Open
ajaymas opened this issue Oct 8, 2020 · 3 comments
Open

How to view or convert gtrib IR to LLVM IR #15

ajaymas opened this issue Oct 8, 2020 · 3 comments

Comments

@ajaymas
Copy link

ajaymas commented Oct 8, 2020

Hello,
I have disassembled a simple hello binary using gtrib with the below commands.

ddisasm hello --asm hello.s

Also, I have generated hello.gtrib using the below command.

ddisasm hello --ir hello.gtrib

Now, I am not able to open or view hello.gtrib. sometimes I noticed here in the issue section there is a way to convert back to LLVM-IR or opening in some form.

Could you please help me how to see or convert hello.gtrib IR

Thanks in advance.

@ajaymas ajaymas changed the title How to view or convert back to gtrib IR to LLVM IR How to view or convert gtrib IR to LLVM IR Oct 8, 2020
@aeflores
Copy link
Collaborator

aeflores commented Oct 9, 2020

Hi @ajaymas, the GTIRB representation is not directly human-readable. You can open it and manipulate it using the GTIRB API https://github.com/GrammaTech/gtirb. Here is a link to the documentation https://grammatech.github.io/gtirb/index.html and this is a tutorial on how to implement a binary transformation https://grammatech.github.io/gtirb/md_stack-stamp.html.

You can also try to load a GTIRB file into Ghidra using https://github.com/GrammaTech/gtirb-ghidra-plugin

That said, currently there is no way to translate from GTIRB to LLVM-IR. GTIRB represents a binary whereas LLVM-IR is a much higher level representation. Such a translation would be non-trivial.

@SaiVK
Copy link

SaiVK commented Mar 4, 2022

Hello @aeflores, the https://grammatech.github.io/gtirb/md_stack-stamp.html is broken. Can you share the correct link?

Thanking you
Sai

@eschulte
Copy link
Contributor

https://grammatech.github.io/gtirb/md_stack_stamp.html (underscore not hyphen) thanks for the heads up, I'll fix the broken link.

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

4 participants