Skip to content

Instantly share code, notes, and snippets.

@samdmarshall
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samdmarshall/9432357 to your computer and use it in GitHub Desktop.
Save samdmarshall/9432357 to your computer and use it in GitHub Desktop.
uint64_t offset = section->offset;
struct segment_64 *text_segment = (struct segment_64 *)text_segment_pointer;
uint64_t addr_offset = section->addr - text_segment->vm_addr;
if (section->offset != addr_offset) {
offset = addr_offset;
}
uint64_t offset = section->offset;
struct segment_32 *text_segment = (struct segment_32 *)text_segment_pointer;
uint64_t addr_offset = section->addr - text_segment->vm_addr;
if (section->offset != addr_offset) {
offset = addr_offset;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment