def ptrace(code, pid, addr, data):
"""
The contents of this call are basically cleanly
passed to the libc implementation of ptrace.
"""
global libc
if not libc:
if os.getenv('ANDROID_ROOT'):
cloc = '/system/lib/libc.so'
else:
cloc = cutil.find_library("c")
if not cloc:
raise Exception("ERROR: can't find C library on posix system!")
libc = CDLL(cloc)
libc.ptrace.restype = c_size_t
libc.ptrace.argtypes = [c_int, c_uint32, c_size_t, c_size_t]
return libc.ptrace(code, pid, c_size_t(addr), c_size_t(data))
评论列表
文章目录