Last active
October 22, 2023 17:33
-
-
Save saagarjha/21ddf65646e3feccf248a30b65619578 to your computer and use it in GitHub Desktop.
Fix up objc_msgSend selector stubs in Binary Ninja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for function in filter(lambda f: f.name == "_objc_msgSend", bv.functions): | |
selector = function.lowest_address + 4 | |
selector = list(bv.get_code_refs_from(selector))[0] | |
selector = list(bv.get_data_refs(selector))[0] | |
selector = list(bv.get_data_refs_from(selector))[0] | |
selector = bv.get_data_var_at(selector).value | |
# objc_msgSend itself, probably | |
if not selector: | |
continue | |
selector = selector[:-1].decode() | |
function.name = f"objc_msgSend${selector}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment