Skip to content

Instantly share code, notes, and snippets.

@saagarjha
Last active October 22, 2023 17:33
Show Gist options
  • Save saagarjha/21ddf65646e3feccf248a30b65619578 to your computer and use it in GitHub Desktop.
Save saagarjha/21ddf65646e3feccf248a30b65619578 to your computer and use it in GitHub Desktop.
Fix up objc_msgSend selector stubs in Binary Ninja
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