Skip to content

Instantly share code, notes, and snippets.

@xooxo
Created May 17, 2023 13:35
Show Gist options
  • Save xooxo/4a86d0ff5dc9d5173b50ae6ee5ccc152 to your computer and use it in GitHub Desktop.
Save xooxo/4a86d0ff5dc9d5173b50ae6ee5ccc152 to your computer and use it in GitHub Desktop.
see if mach lookup to a service allowed from attached process
import lldb
file_path = "reachable_services.txt"
debugger = lldb.SBDebugger.Create()
interpreter = debugger.GetCommandInterpreter()
debugger.Initialize()
return_obj = lldb.SBCommandReturnObject()
with open(file_path, 'r') as file:
for line in file:
stripped_line = line.strip()
if stripped_line: # Skip empty lines
interpreter.HandleCommand('call (int*)bootstrap_lookup(0,"{}")'.format(stripped_line),return_obj)
print(return_obj.GetOutput())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment