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

C++:How to insert assembly instructions containing labels? #66

Open
shuxinsun opened this issue May 29, 2024 · 1 comment
Open

C++:How to insert assembly instructions containing labels? #66

shuxinsun opened this issue May 29, 2024 · 1 comment

Comments

@shuxinsun
Copy link

I am trying to insert assembly instructions containing labels into a GTIRB file. Specifically, I want to insert a jmp label, where the label is added using the GTIRB addSymbol() function.

Currently, the method I found for inserting assembly instructions involves converting the instructions into binary sequences using Keystone and then using the provided insertBytes() function. However, there is an issue because Keystone cannot handle labels within the assembly instructions.

Therefore, I would like to know if there are any other ways in GTIRB that I might have overlooked to achieve the insertion of assembly instructions containing labels into a GTIRB file?

@aeflores
Copy link
Collaborator

Hi @shuxinsun,
I'd suggest trying out our gtirb-rewriting library https://github.com/GrammaTech/gtirb-rewriting this allows you to do higher level modifications to gtirb much more easily.

In particular, take a look at the getting started guide https://github.com/GrammaTech/gtirb-rewriting/blob/main/doc/Getting-Started.md. gtirb-rewriting supports inserting assembly with labels https://github.com/GrammaTech/gtirb-rewriting/blob/main/doc/Getting-Started.md#labels

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

2 participants