Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
X64: Use Struct for ELF Ehdr and Phdr headers #1694
X64: Use Struct for ELF Ehdr and Phdr headers #1694
Changes from 10 commits
b766d8a
dab6068
bd19300
a05b71c
150a9c8
9ffc308
06ed809
f12e42c
14b1197
0630d23
1a99f9a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this copying the (potentially big) binary code byte by byte?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is copying the binary code byte by byte. Another approach that we can do is to just return the ELF and Phdr headers in
create_elf64_x86_binary()
(we can rename it ascreate_elf64_x86_header()
).For example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently updated it to return the
header
only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this function outside of X86Assembler. Eventually once we add
Arm64Assembler
, we will figure out how to generalize this function to also work for ELF ARM binaries.Also I would rename it to something like
create_elf64_x86_binary
and I would passm_code
as an argument.I would make the function return a string.
The caller will then save the string to a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I currently used a
Vec<uint8_t>
. I would like to know if it is fine or if I shall update it.