* Correctly get the address of the PLT entry for a symbol. If the symbol
was not yet added to the .got.r2 section, then take the first available
address (vaddr), otherwise retrieve it from the hashtable.
* Avoid showing wrong relocations when relocations are already replaced
Rebasing and stripping happens on-the-fly by swizzling
the io read function and leveraging the chain starts
generated by supporting the BIND_OPCODE_THREADED
machinery.
For the swizzling to work, all reads generated
during r_bin_object_set_items() must go through the
swizzled read function.
To make this possible, these 3 conditions must be true:
1- r_bin_file_set_obj must be called before the first read
2- the corresponding bin file must be already in the
binfiles list before the first read
3- the swizzled read function must be able to find the
right MACH0_(obj_t) among all active bin objects
This feature is enabled only when opening arm64 binaries.
Add logic to parse unmapped local symbols.
Every macho image present in the dyldcache has all the metadata about its local symbols stripped away from the corresponding macho header. Instead, this information is present as dyldcache-specific metadata stored in unmapped parts of the cache file.
This PR, for every loaded image, takes care of adding the local symbols which are missing.
Bonus
Fix a potential use-after-free caused by r_bin_object_set_items, by rebuilding class-related hash tables after replacing the class list.
* introduce r_bin_open_buf
* fix r_bin_file_delete to use bf->id and not fd. This was used
inconsistently and the function was just wrong.
* rewrite r_bin_reload to just reuse the existing bf->buf
* fix some memory leaks
* Implement containing rbtree, give RBTreeComparator a user ptr
* RAnal.ESIL.DFG: handle type, memory, register, relations and filter, reverse
* Add r_anal_esil_cfg_op and use it to merge fcn bbs