Skip to content

Instantly share code, notes, and snippets.

@scrapbird
Created July 3, 2018 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scrapbird/1e9197410a2fb6e11949072190332dff to your computer and use it in GitHub Desktop.
Save scrapbird/1e9197410a2fb6e11949072190332dff to your computer and use it in GitHub Desktop.
24b89e36e12166f613edb61909d1192dbd918c2eac45d3a75a588ec24a4e2a36 scripts
#!/usr/bin/env python
import r2pipe, sys, os, json
if len(sys.argv) < 2:
print "Please supply the hit number"
os.exit(1)
r2 = r2pipe.open ()
flags = r2.cmdj ("fj")
hits = list (filter ((lambda x: "hit{}".format (sys.argv[1]) in x['name']), flags))
addrs = list (map ((lambda x: hex (x['offset'])), hits))
with open("syscalls.json", "r") as f:
j = json.load(f)
for addr in addrs:
inst = r2.cmdj("pdj 1 @ {}".format (addr))[0]
s = inst["opcode"].split(" ")
if len(s) == 2:
# some ugly cleanup to pad everything from r2 to how it is in our json file
if not "0x" in s[1]:
s[1] = "{0:#0{1}x}".format(int (s[1]), 4)
else:
s[1] = "0x" + s[1][2:].zfill (2)
if s[1] in j:
print hex (inst["offset"]), ":", inst["opcode"], "->", j[s[1]]
r2.cmd ("CC " + j[s[1]] + " @ " + hex (inst["offset"]))
{
"0x900000": "restart_syscall",
"0x900001": "exit",
"0x900002": "fork",
"0x900003": "read",
"0x900004": "write",
"0x900005": "open",
"0x900006": "close",
"0x900008": "creat",
"0x900009": "link",
"0x90000a": "unlink",
"0x90000b": "execve",
"0x90000c": "chdir",
"0x90000d": "time",
"0x90000e": "mknod",
"0x90000f": "chmod",
"0x900010": "lchown",
"0x900013": "lseek",
"0x900014": "getpid",
"0x900015": "mount",
"0x900016": "umount",
"0x900017": "setuid",
"0x900018": "getuid",
"0x900019": "stime",
"0x90001a": "ptrace",
"0x90001b": "alarm",
"0x90001d": "pause",
"0x90001e": "utime",
"0x900021": "access",
"0x900022": "nice",
"0x900024": "sync",
"0x900025": "kill",
"0x900026": "rename",
"0x900027": "mkdir",
"0x900028": "rmdir",
"0x900029": "dup",
"0x90002a": "pipe",
"0x90002b": "times",
"0x90002d": "brk",
"0x90002e": "setgid",
"0x90002f": "getgid",
"0x900031": "geteuid",
"0x900032": "getegid",
"0x900033": "acct",
"0x900034": "umount2",
"0x900036": "ioctl",
"0x900037": "fcntl",
"0x900039": "setpgid",
"0x90003c": "umask",
"0x90003d": "chroot",
"0x90003e": "ustat",
"0x90003f": "dup2",
"0x900040": "getppid",
"0x900041": "getpgrp",
"0x900042": "setsid",
"0x900043": "sigaction",
"0x900046": "setreuid",
"0x900047": "setregid",
"0x900048": "sigsuspend",
"0x900049": "sigpending",
"0x90004a": "sethostname",
"0x90004b": "setrlimit",
"0x90004c": "getrlimit",
"0x90004d": "getrusage",
"0x90004e": "gettimeofday",
"0x90004f": "settimeofday",
"0x900050": "getgroups",
"0x900051": "setgroups",
"0x900052": "select",
"0x900053": "symlink",
"0x900055": "readlink",
"0x900056": "uselib",
"0x900057": "swapon",
"0x900058": "reboot",
"0x900059": "readdir",
"0x90005a": "mmap",
"0x90005b": "munmap",
"0x90005c": "truncate",
"0x90005d": "ftruncate",
"0x90005e": "fchmod",
"0x90005f": "fchown",
"0x900060": "getpriority",
"0x900061": "setpriority",
"0x900063": "statfs",
"0x900064": "fstatfs",
"0x900066": "socketcall",
"0x900067": "syslog",
"0x900068": "setitimer",
"0x900069": "getitimer",
"0x90006a": "stat",
"0x90006b": "lstat",
"0x90006c": "fstat",
"0x90006f": "vhangup",
"0x900071": "syscall",
"0x900072": "wait4",
"0x900073": "swapoff",
"0x900074": "sysinfo",
"0x900075": "ipc",
"0x900076": "fsync",
"0x900077": "sigreturn",
"0x900078": "clone",
"0x900079": "setdomainname",
"0x90007a": "uname",
"0x90007c": "adjtimex",
"0x90007d": "mprotect",
"0x90007e": "sigprocmask",
"0x900080": "init_module",
"0x900081": "delete_module",
"0x900083": "quotactl",
"0x900084": "getpgid",
"0x900085": "fchdir",
"0x900086": "bdflush",
"0x900087": "sysfs",
"0x900088": "personality",
"0x90008a": "setfsuid",
"0x90008b": "setfsgid",
"0x90008c": "_llseek",
"0x90008d": "getdents",
"0x90008e": "_newselect",
"0x90008f": "flock",
"0x900090": "msync",
"0x900091": "readv",
"0x900092": "writev",
"0x900093": "getsid",
"0x900094": "fdatasync",
"0x900095": "_sysctl",
"0x900096": "mlock",
"0x900097": "munlock",
"0x900098": "mlockall",
"0x900099": "munlockall",
"0x90009a": "sched_setparam",
"0x90009b": "sched_getparam",
"0x90009c": "sched_setscheduler",
"0x90009d": "sched_getscheduler",
"0x90009e": "sched_yield",
"0x90009f": "sched_get_priority_max",
"0x9000a0": "sched_get_priority_min",
"0x9000a1": "sched_rr_get_interval",
"0x9000a2": "nanosleep",
"0x9000a3": "mremap",
"0x9000a4": "setresuid",
"0x9000a5": "getresuid",
"0x9000a8": "poll",
"0x9000aa": "setresgid",
"0x9000ab": "getresgid",
"0x9000ac": "prctl",
"0x9000ad": "rt_sigreturn",
"0x9000ae": "rt_sigaction",
"0x9000af": "rt_sigprocmask",
"0x9000b0": "rt_sigpending",
"0x9000b1": "rt_sigtimedwait",
"0x9000b2": "rt_sigqueueinfo",
"0x9000b3": "rt_sigsuspend",
"0x9000b4": "pread64",
"0x9000b5": "pwrite64",
"0x9000b6": "chown",
"0x9000b7": "getcwd",
"0x9000b8": "capget",
"0x9000b9": "capset",
"0x9000bb": "sendfile",
"0x9000be": "vfork",
"0x9000bf": "ugetrlimit",
"0x9000c0": "mmap2",
"0x9000c1": "truncate64",
"0x9000c2": "ftruncate64",
"0x9000c3": "stat64",
"0x9000c4": "lstat64",
"0x9000c5": "fstat64",
"0x9000c6": "lchown32",
"0x9000c7": "getuid32",
"0x9000c8": "getgid32",
"0x9000c9": "geteuid32",
"0x9000ca": "getegid32",
"0x9000cb": "setreuid32",
"0x9000cc": "setregid32",
"0x9000cd": "getgroups32",
"0x9000ce": "setgroups32",
"0x9000cf": "fchown32",
"0x9000d0": "setresuid32",
"0x9000d1": "getresuid32",
"0x9000d2": "setresgid32",
"0x9000d3": "getresgid32",
"0x9000d4": "chown32",
"0x9000d5": "setuid32",
"0x9000d6": "setgid32",
"0x9000d7": "setfsuid32",
"0x9000d8": "setfsgid32",
"0x9000d9": "getdents64",
"0x9000da": "pivot_root",
"0x9000db": "mincore",
"0x9000dc": "madvise",
"0x9000dd": "fcntl64",
"0x9000e0": "gettid",
"0x9000e1": "readahead",
"0x9000e2": "setxattr",
"0x9000e3": "lsetxattr",
"0x9000e4": "fsetxattr",
"0x9000e5": "getxattr",
"0x9000e6": "lgetxattr",
"0x9000e7": "fgetxattr",
"0x9000e8": "listxattr",
"0x9000e9": "llistxattr",
"0x9000ea": "flistxattr",
"0x9000eb": "removexattr",
"0x9000ec": "lremovexattr",
"0x9000ed": "fremovexattr",
"0x9000ee": "tkill",
"0x9000ef": "sendfile64",
"0x9000f0": "futex",
"0x9000f1": "sched_setaffinity",
"0x9000f2": "sched_getaffinity",
"0x9000f3": "io_setup",
"0x9000f4": "io_destroy",
"0x9000f5": "io_getevents",
"0x9000f6": "io_submit",
"0x9000f7": "io_cancel",
"0x9000f8": "exit_group",
"0x9000f9": "lookup_dcookie",
"0x9000fa": "epoll_create",
"0x9000fb": "epoll_ctl",
"0x9000fc": "epoll_wait",
"0x9000fd": "remap_file_pages",
"0x900100": "set_tid_address",
"0x900101": "timer_create",
"0x900102": "timer_settime",
"0x900103": "timer_gettime",
"0x900104": "timer_getoverrun",
"0x900105": "timer_delete",
"0x900106": "clock_settime",
"0x900107": "clock_gettime",
"0x900108": "clock_getres",
"0x900109": "clock_nanosleep",
"0x90010a": "statfs64",
"0x90010b": "fstatfs64",
"0x90010c": "tgkill",
"0x90010d": "utimes",
"0x90010e": "arm_fadvise64_64",
"0x900110": "pciconfig_read",
"0x900111": "pciconfig_write",
"0x900112": "mq_open",
"0x900113": "mq_unlink",
"0x900114": "mq_timedsend",
"0x900115": "mq_timedreceive",
"0x900116": "mq_notify",
"0x900117": "mq_getsetattr",
"0x900118": "waitid",
"0x900119": "socket",
"0x90011a": "bind",
"0x90011b": "connect",
"0x90011c": "listen",
"0x90011d": "accept",
"0x90011e": "getsockname",
"0x90011f": "getpeername",
"0x900120": "socketpair",
"0x900121": "send",
"0x900122": "sendto",
"0x900123": "recv",
"0x900124": "recvfrom",
"0x900125": "shutdown",
"0x900126": "setsockopt",
"0x900127": "getsockopt",
"0x900128": "sendmsg",
"0x900129": "recvmsg",
"0x90012a": "semop",
"0x90012b": "semget",
"0x90012c": "semctl",
"0x90012d": "msgsnd",
"0x90012e": "msgrcv",
"0x90012f": "msgget",
"0x900130": "msgctl",
"0x900131": "shmat",
"0x900132": "shmdt",
"0x900133": "shmget",
"0x900134": "shmctl",
"0x900135": "add_key",
"0x900136": "request_key",
"0x900137": "keyctl",
"0x900138": "semtimedop",
"0x90013a": "ioprio_set",
"0x90013b": "ioprio_get",
"0x90013c": "inotify_init",
"0x90013d": "inotify_add_watch",
"0x90013e": "inotify_rm_watch",
"0x90013f": "mbind",
"0x900140": "get_mempolicy",
"0x900141": "set_mempolicy",
"0x900142": "openat",
"0x900143": "mkdirat",
"0x900144": "mknodat",
"0x900145": "fchownat",
"0x900146": "futimesat",
"0x900147": "fstatat64",
"0x900148": "unlinkat",
"0x900149": "renameat",
"0x90014a": "linkat",
"0x90014b": "symlinkat",
"0x90014c": "readlinkat",
"0x90014d": "fchmodat",
"0x90014e": "faccessat",
"0x90014f": "pselect6",
"0x900150": "ppoll",
"0x900151": "unshare",
"0x900152": "set_robust_list",
"0x900153": "get_robust_list",
"0x900154": "splice",
"0x900155": "sync_file_range2",
"0x900156": "tee",
"0x900157": "vmsplice",
"0x900158": "move_pages",
"0x900159": "getcpu",
"0x90015a": "epoll_pwait",
"0x90015b": "kexec_load",
"0x90015c": "utimensat",
"0x90015d": "signalfd",
"0x90015e": "timerfd_create",
"0x90015f": "eventfd",
"0x900160": "fallocate",
"0x900161": "timerfd_settime",
"0x900162": "timerfd_gettime",
"0x900163": "signalfd4",
"0x900164": "eventfd2",
"0x900165": "epoll_create1",
"0x900166": "dup3",
"0x900167": "pipe2",
"0x900168": "inotify_init1",
"0x900169": "preadv",
"0x90016a": "pwritev",
"0x90016b": "rt_tgsigqueueinfo",
"0x90016c": "perf_event_open",
"0x90016d": "recvmmsg",
"0x90016e": "accept4",
"0x90016f": "fanotify_init",
"0x900170": "fanotify_mark",
"0x900171": "prlimit64",
"0x900172": "name_to_handle_at",
"0x900173": "open_by_handle_at",
"0x900174": "clock_adjtime",
"0x900175": "syncfs",
"0x900176": "sendmmsg",
"0x900177": "setns",
"0x900178": "process_vm_readv",
"0x900179": "process_vm_writev",
"0x00": "sys_restart_syscall",
"0x01": "sys_exit",
"0x02": "sys_fork",
"0x03": "sys_read",
"0x04": "sys_write",
"0x05": "sys_open",
"0x06": "sys_close",
"0x07": "sys_waitpid",
"0x08": "sys_creat",
"0x09": "sys_link",
"0x0a": "sys_unlink",
"0x0b": "sys_execve",
"0x0c": "sys_chdir",
"0x0d": "sys_time",
"0x0e": "sys_mknod",
"0x0f": "sys_chmod",
"0x10": "sys_lchown16",
"0x12": "sys_stat",
"0x13": "sys_lseek",
"0x14": "sys_getpid",
"0x15": "sys_mount",
"0x16": "sys_oldumount",
"0x17": "sys_setuid16",
"0x18": "sys_getuid16",
"0x19": "sys_stime",
"0x1a": "sys_ptrace",
"0x1b": "sys_alarm",
"0x1c": "sys_fstat",
"0x1d": "sys_pause",
"0x1e": "sys_utime",
"0x21": "sys_access",
"0x22": "sys_nice",
"0x24": "sys_sync",
"0x25": "sys_kill",
"0x26": "sys_rename",
"0x27": "sys_mkdir",
"0x28": "sys_rmdir",
"0x29": "sys_dup",
"0x2a": "sys_pipe",
"0x2b": "sys_times",
"0x2d": "sys_brk",
"0x2e": "sys_setgid16",
"0x2f": "sys_getgid16",
"0x30": "sys_signal",
"0x31": "sys_geteuid16",
"0x32": "sys_getegid16",
"0x33": "sys_acct",
"0x34": "sys_umount",
"0x36": "sys_ioctl",
"0x37": "sys_fcntl",
"0x39": "sys_setpgid",
"0x3b": "sys_olduname",
"0x3c": "sys_umask",
"0x3d": "sys_chroot",
"0x3e": "sys_ustat",
"0x3f": "sys_dup2",
"0x40": "sys_getppid",
"0x41": "sys_getpgrp",
"0x42": "sys_setsid",
"0x43": "sys_sigaction",
"0x44": "sys_sgetmask",
"0x45": "sys_ssetmask",
"0x46": "sys_setreuid16",
"0x47": "sys_setregid16",
"0x48": "sys_sigsuspend",
"0x49": "sys_sigpending",
"0x4a": "sys_sethostname",
"0x4b": "sys_setrlimit",
"0x4c": "sys_old_getrlimit",
"0x4d": "sys_getrusage",
"0x4e": "sys_gettimeofday",
"0x4f": "sys_settimeofday",
"0x50": "sys_getgroups16",
"0x51": "sys_setgroups16",
"0x52": "sys_old_select",
"0x53": "sys_symlink",
"0x54": "sys_lstat",
"0x55": "sys_readlink",
"0x56": "sys_uselib",
"0x57": "sys_swapon",
"0x58": "sys_reboot",
"0x59": "sys_old_readdir",
"0x5a": "sys_old_mmap",
"0x5b": "sys_munmap",
"0x5c": "sys_truncate",
"0x5d": "sys_ftruncate",
"0x5e": "sys_fchmod",
"0x5f": "sys_fchown16",
"0x60": "sys_getpriority",
"0x61": "sys_setpriority",
"0x63": "sys_statfs",
"0x64": "sys_fstatfs",
"0x65": "sys_ioperm",
"0x66": "sys_socketcall",
"0x67": "sys_syslog",
"0x68": "sys_setitimer",
"0x69": "sys_getitimer",
"0x6a": "sys_newstat",
"0x6b": "sys_newlstat",
"0x6c": "sys_newfstat",
"0x6d": "sys_uname",
"0x6e": "sys_iopl",
"0x6f": "sys_vhangup",
"0x71": "sys_vm86old",
"0x72": "sys_wait4",
"0x73": "sys_swapoff",
"0x74": "sys_sysinfo",
"0x75": "sys_ipc",
"0x76": "sys_fsync",
"0x77": "sys_sigreturn",
"0x78": "sys_clone",
"0x79": "sys_setdomainname",
"0x7a": "sys_newuname",
"0x7b": "sys_modify_ldt",
"0x7c": "sys_adjtimex",
"0x7d": "sys_mprotect",
"0x7e": "sys_sigprocmask",
"0x80": "sys_init_module",
"0x81": "sys_delete_module",
"0x83": "sys_quotactl",
"0x84": "sys_getpgid",
"0x85": "sys_fchdir",
"0x86": "sys_bdflush",
"0x87": "sys_sysfs",
"0x88": "sys_personality",
"0x8a": "sys_setfsuid16",
"0x8b": "sys_setfsgid16",
"0x8c": "sys_llseek",
"0x8d": "sys_getdents",
"0x8e": "sys_select",
"0x8f": "sys_flock",
"0x90": "sys_msync",
"0x91": "sys_readv",
"0x92": "sys_writev",
"0x93": "sys_getsid",
"0x94": "sys_fdatasync",
"0x95": "sys_sysctl",
"0x96": "sys_mlock",
"0x97": "sys_munlock",
"0x98": "sys_mlockall",
"0x99": "sys_munlockall",
"0x9a": "sys_sched_setparam",
"0x9b": "sys_sched_getparam",
"0x9c": "sys_sched_setscheduler",
"0x9d": "sys_sched_getscheduler",
"0x9e": "sys_sched_yield",
"0x9f": "sys_sched_get_priority_max",
"0xa0": "sys_sched_get_priority_min",
"0xa1": "sys_sched_rr_get_interval",
"0xa2": "sys_nanosleep",
"0xa3": "sys_mremap",
"0xa4": "sys_setresuid16",
"0xa5": "sys_getresuid16",
"0xa6": "sys_vm86",
"0xa8": "sys_poll",
"0xa9": "sys_nfsservctl",
"0xaa": "sys_setresgid16",
"0xab": "sys_getresgid16",
"0xac": "sys_prctl",
"0xad": "sys_rt_sigreturn",
"0xae": "sys_rt_sigaction",
"0xaf": "sys_rt_sigprocmask",
"0xb0": "sys_rt_sigpending",
"0xb1": "sys_rt_sigtimedwait",
"0xb2": "sys_rt_sigqueueinfo",
"0xb3": "sys_rt_sigsuspend",
"0xb4": "sys_pread64",
"0xb5": "sys_pwrite64",
"0xb6": "sys_chown16",
"0xb7": "sys_getcwd",
"0xb8": "sys_capget",
"0xb9": "sys_capset",
"0xba": "sys_sigaltstack",
"0xbb": "sys_sendfile",
"0xbe": "sys_vfork",
"0xbf": "sys_getrlimit",
"0xc0": "sys_mmap_pgoff",
"0xc1": "sys_truncate64",
"0xc2": "sys_ftruncate64",
"0xc3": "sys_stat64",
"0xc4": "sys_lstat64",
"0xc5": "sys_fstat64",
"0xc6": "sys_lchown",
"0xc7": "sys_getuid",
"0xc8": "sys_getgid",
"0xc9": "sys_geteuid",
"0xca": "sys_getegid",
"0xcb": "sys_setreuid",
"0xcc": "sys_setregid",
"0xcd": "sys_getgroups",
"0xce": "sys_setgroups",
"0xcf": "sys_fchown",
"0xd0": "sys_setresuid",
"0xd1": "sys_getresuid",
"0xd2": "sys_setresgid",
"0xd3": "sys_getresgid",
"0xd4": "sys_chown",
"0xd5": "sys_setuid",
"0xd6": "sys_setgid",
"0xd7": "sys_setfsuid",
"0xd8": "sys_setfsgid",
"0xd9": "sys_pivot_root",
"0xda": "sys_mincore",
"0xdb": "sys_madvise",
"0xdc": "sys_getdents64",
"0xdd": "sys_fcntl64",
"0xe0": "sys_gettid",
"0xe1": "sys_readahead",
"0xe2": "sys_setxattr",
"0xe3": "sys_lsetxattr",
"0xe4": "sys_fsetxattr",
"0xe5": "sys_getxattr",
"0xe6": "sys_lgetxattr",
"0xe7": "sys_fgetxattr",
"0xe8": "sys_listxattr",
"0xe9": "sys_llistxattr",
"0xea": "sys_flistxattr",
"0xeb": "sys_removexattr",
"0xec": "sys_lremovexattr",
"0xed": "sys_fremovexattr",
"0xee": "sys_tkill",
"0xef": "sys_sendfile64",
"0xf0": "sys_futex",
"0xf1": "sys_sched_setaffinity",
"0xf2": "sys_sched_getaffinity",
"0xf3": "sys_set_thread_area",
"0xf4": "sys_get_thread_area",
"0xf5": "sys_io_setup",
"0xf6": "sys_io_destroy",
"0xf7": "sys_io_getevents",
"0xf8": "sys_io_submit",
"0xf9": "sys_io_cancel",
"0xfa": "sys_fadvise64",
"0xfc": "sys_exit_group",
"0xfd": "sys_lookup_dcookie",
"0xfe": "sys_epoll_create",
"0xff": "sys_epoll_ctl",
"0x100": "sys_epoll_wait",
"0x101": "sys_remap_file_pages",
"0x102": "sys_set_tid_address",
"0x103": "sys_timer_create",
"0x104": "sys_timer_settime",
"0x105": "sys_timer_gettime",
"0x106": "sys_timer_getoverrun",
"0x107": "sys_timer_delete",
"0x108": "sys_clock_settime",
"0x109": "sys_clock_gettime",
"0x10a": "sys_clock_getres",
"0x10b": "sys_clock_nanosleep",
"0x10c": "sys_statfs64",
"0x10d": "sys_fstatfs64",
"0x10e": "sys_tgkill",
"0x10f": "sys_utimes",
"0x110": "sys_fadvise64_64",
"0x112": "sys_mbind",
"0x113": "sys_get_mempolicy",
"0x114": "sys_set_mempolicy",
"0x115": "sys_mq_open",
"0x116": "sys_mq_unlink",
"0x117": "sys_mq_timedsend",
"0x118": "sys_mq_timedreceive",
"0x119": "sys_mq_notify",
"0x11a": "sys_mq_getsetattr",
"0x11b": "sys_kexec_load",
"0x11c": "sys_waitid",
"0x11e": "sys_add_key",
"0x11f": "sys_request_key",
"0x120": "sys_keyctl",
"0x121": "sys_ioprio_set",
"0x122": "sys_ioprio_get",
"0x123": "sys_inotify_init",
"0x124": "sys_inotify_add_watch",
"0x125": "sys_inotify_rm_watch",
"0x126": "sys_migrate_pages",
"0x127": "sys_openat",
"0x128": "sys_mkdirat",
"0x129": "sys_mknodat",
"0x12a": "sys_fchownat",
"0x12b": "sys_futimesat",
"0x12c": "sys_fstatat64",
"0x12d": "sys_unlinkat",
"0x12e": "sys_renameat",
"0x12f": "sys_linkat",
"0x130": "sys_symlinkat",
"0x131": "sys_readlinkat",
"0x132": "sys_fchmodat",
"0x133": "sys_faccessat",
"0x134": "sys_pselect6",
"0x135": "sys_ppoll",
"0x136": "sys_unshare",
"0x137": "sys_set_robust_list",
"0x138": "sys_get_robust_list",
"0x139": "sys_splice",
"0x13a": "sys_sync_file_range",
"0x13b": "sys_tee",
"0x13c": "sys_vmsplice",
"0x13d": "sys_move_pages",
"0x13e": "sys_getcpu",
"0x13f": "sys_epoll_pwait",
"0x140": "sys_utimensat",
"0x141": "sys_signalfd",
"0x142": "sys_timerfd_create",
"0x143": "sys_eventfd",
"0x144": "sys_fallocate",
"0x145": "sys_timerfd_settime",
"0x146": "sys_timerfd_gettime",
"0x147": "sys_signalfd4",
"0x148": "sys_eventfd2",
"0x149": "sys_epoll_create1",
"0x14a": "sys_dup3",
"0x14b": "sys_pipe2",
"0x14c": "sys_inotify_init1",
"0x14d": "sys_preadv",
"0x14e": "sys_pwritev",
"0x14f": "sys_rt_tgsigqueueinfo",
"0x150": "sys_perf_event_open",
"0x151": "sys_recvmmsg"
}
@scrapbird
Copy link
Author

Run a search in r2 for all syscalls with /A swi, then run the script with #!pipe ./label_syscalls.py <hit number for search>. If you only run one search then the hit number will be 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment