diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1211f80da..cb2bc431fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: | git fetch origin git log --oneline --graph -10 - + - name: Fix libcdb-cache permissions id: fix-perms run: | @@ -66,7 +66,7 @@ jobs: sudo apt-get update && sudo apt-get install -y python3-pip gdb gdbserver /usr/bin/python -m pip install --break-system-packages rpyc || /usr/bin/python -m pip install rpyc gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)' - + - name: Cache for pip uses: actions/cache@v4 if: matrix.python_version == '2.7' @@ -113,6 +113,7 @@ jobs: - name: Install Linux dependencies run: | sudo apt-get update + # binutils-loongarch64-linux-gnu is not in Ubuntu 22.04 sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 \ ash bash-static dash ksh mksh zsh \ gdb gdbserver socat \ @@ -129,7 +130,7 @@ jobs: libc6-dbg \ elfutils \ patchelf - + - name: Testing Corefiles run: | ulimit -a @@ -260,7 +261,7 @@ jobs: name: coverage-${{ matrix.python_version }} path: .coverage* include-hidden-files: true - + - name: Fix libcdb-cache permissions run: | container_id=$(docker ps --filter volume=/home/runner/libcdb-cache --no-trunc --format "{{.ID}}") @@ -283,15 +284,15 @@ jobs: run: | pip install --upgrade pip pip install --upgrade --editable . - + - name: Install documentation dependencies run: pip install -r docs/requirements.txt - + - name: Sanity checks run: | python -bb -c 'from pwn import *' python -bb examples/text.py - + - name: Coverage doctests run: | python -bb -m coverage run -m sphinx -b doctest docs/source docs/build/doctest diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ac08c6abc..2c82bda248 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,12 +79,14 @@ The table below shows which release corresponds to each branch, and what date th - [#2524][2524] Raise EOFError during `process.recv` when stdout closes on Windows - [#2526][2526] Properly make use of extra arguments in `packing` utilities. `sign` parameter requires keyword syntax to specify it. - [#2517][2517] Allow to passthru kwargs on `ssh.__getattr__` convenience function to fix SSH motd problems +- [#2529][2529] Add LoongArch64 support [2507]: https://github.com/Gallopsled/pwntools/pull/2507 [2522]: https://github.com/Gallopsled/pwntools/pull/2522 [2524]: https://github.com/Gallopsled/pwntools/pull/2524 [2526]: https://github.com/Gallopsled/pwntools/pull/2526 [2517]: https://github.com/Gallopsled/pwntools/pull/2517 +[2529]: https://github.com/Gallopsled/pwntools/pull/2529 ## 4.15.0 (`beta`) - [#2508][2508] Ignore a warning when compiling with asm on nix @@ -194,7 +196,7 @@ The table below shows which release corresponds to each branch, and what date th - [#2308][2308] Fix WinExec shellcraft to make sure it's 16 byte aligned - [#2279][2279] Make `pwn template` always set context.binary - [#2310][2310] Add support to start a process on Windows -- [#2335][2335] Add lookup optimizations in DynELF +- [#2335][2335] Add lookup optimizations in DynELF - [#2334][2334] Speed up disasm commandline tool with colored output - [#2328][2328] Lookup using $PATHEXT file extensions in `which` on Windows - [#2189][2189] Explicitly define p64/u64 functions for IDE support @@ -281,7 +283,7 @@ The table below shows which release corresponds to each branch, and what date th ## 4.11.0 -- [#2185][2185] make fmtstr module able to create payload without $ notation +- [#2185][2185] make fmtstr module able to create payload without $ notation - [#2103][2103] Add search for libc binary by leaked function addresses `libcdb.search_by_symbol_offsets()` - [#2177][2177] Support for RISC-V 64-bit architecture - [#2186][2186] Enhance `ELF.nx` and `ELF.execstack` diff --git a/docs/source/shellcraft/loongarch64.rst b/docs/source/shellcraft/loongarch64.rst new file mode 100644 index 0000000000..2f41e1ebeb --- /dev/null +++ b/docs/source/shellcraft/loongarch64.rst @@ -0,0 +1,22 @@ +.. testsetup:: * + + from pwn import * + context.clear(arch='loongarch64') + + import doctest + doctest_additional_flags = doctest.OPTIONFLAGS_BY_NAME['LINUX'] + +:mod:`pwnlib.shellcraft.loongarch64` --- Shellcode for LoongArch64 +========================================================== + +:mod:`pwnlib.shellcraft.loongarch64` +-------------------------------- + +.. automodule:: pwnlib.shellcraft.loongarch64 + :members: + +:mod:`pwnlib.shellcraft.loongarch64.linux` +-------------------------------------- + +.. automodule:: pwnlib.shellcraft.loongarch64.linux + :members: diff --git a/extra/docker/base/Dockerfile b/extra/docker/base/Dockerfile index 0d07c33f56..de3e92b08c 100644 --- a/extra/docker/base/Dockerfile +++ b/extra/docker/base/Dockerfile @@ -3,7 +3,7 @@ # Based on Ubuntu ############################################################ -FROM ubuntu:jammy +FROM ubuntu:noble MAINTAINER Maintainer Gallopsled et al. ENV LANG en_US.UTF-8 @@ -36,6 +36,7 @@ RUN apt-get update \ binutils-powerpc64-linux-gnu \ binutils-sparc64-linux-gnu \ binutils-riscv64-linux-gnu \ + binutils-loongarch64-linux-gnu \ tmux \ patchelf \ && locale-gen en_US.UTF-8 \ diff --git a/pwnlib/abi.py b/pwnlib/abi.py index 1ba669b0e2..05d2266bf0 100644 --- a/pwnlib/abi.py +++ b/pwnlib/abi.py @@ -27,9 +27,9 @@ class ABI(object): #: Indicates that this ABI returns to the next address on the slot returns = True - def __init__(self, stack, regs, align, minimum): + def __init__(self, stack, arg_regs, align, minimum): self.stack = stack - self.register_arguments = regs + self.register_arguments = arg_regs self.arg_alignment = align self.stack_minimum = minimum @@ -50,6 +50,7 @@ def default(): (64, 'powerpc', 'linux'): linux_ppc64, (32, 'riscv32', 'linux'): linux_riscv32, (64, 'riscv64', 'linux'): linux_riscv64, + (64, 'loongarch64', 'linux'): linux_loongarch64, (32, 'i386', 'freebsd'): freebsd_i386, (64, 'aarch64', 'freebsd'): freebsd_aarch64, (64, 'amd64', 'freebsd'): freebsd_amd64, @@ -82,6 +83,7 @@ def syscall(): (64, 'powerpc', 'linux'): linux_ppc64_syscall, (32, 'riscv32', 'linux'): linux_riscv32_syscall, (64, 'riscv64', 'linux'): linux_riscv64_syscall, + (64, 'loongarch64', 'linux'): linux_loongarch64_syscall, (32, 'i386', 'freebsd'): freebsd_i386_syscall, (64, 'amd64', 'freebsd'): freebsd_amd64_syscall, (64, 'aarch64', 'freebsd'): freebsd_aarch64_syscall, @@ -109,6 +111,7 @@ def sigreturn(): (64, 'aarch64', 'linux'): linux_aarch64_sigreturn, (32, 'riscv32', 'linux'): linux_riscv32_sigreturn, (64, 'riscv64', 'linux'): linux_riscv64_sigreturn, + (64, 'loongarch64', 'linux'): linux_loongarch64_sigreturn, (32, 'i386', 'freebsd'): freebsd_i386_sigreturn, (64, 'amd64', 'freebsd'): freebsd_amd64_sigreturn, (32, 'arm', 'freebsd'): freebsd_arm_sigreturn, @@ -148,6 +151,7 @@ class SigreturnABI(SyscallABI): linux_ppc64 = ABI('sp', ['r3', 'r4', 'r5', 'r6', 'r7', 'r8', 'r9', 'r10'], 8, 0) linux_riscv32 = ABI('sp', ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7'], 8, 0) linux_riscv64 = ABI('sp', ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7'], 8, 0) +linux_loongarch64 = ABI('sp', ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7'], 8, 0) sysv_i386 = linux_i386 sysv_amd64 = linux_amd64 @@ -158,6 +162,7 @@ class SigreturnABI(SyscallABI): sysv_ppc64 = linux_ppc64 sysv_riscv32 = linux_riscv32 sysv_riscv64 = linux_riscv64 +sysv_loongarch64 = linux_loongarch64 # Docs: https://man7.org/linux/man-pages/man2/syscall.2.html linux_i386_syscall = SyscallABI('esp', ['eax', 'ebx', 'ecx', 'edx', 'esi', 'edi', 'ebp'], 4, 0) @@ -169,6 +174,7 @@ class SigreturnABI(SyscallABI): linux_ppc64_syscall = SyscallABI('sp', ['r0', 'r3', 'r4', 'r5', 'r6', 'r7', 'r8'], 8, 0) linux_riscv32_syscall = SyscallABI('sp', ['a7', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5'], 4, 0) linux_riscv64_syscall = SyscallABI('sp', ['a7', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5'], 8, 0) +linux_loongarch64_syscall = SyscallABI('sp', ['a7', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6'], 8, 0) linux_i386_sigreturn = SigreturnABI('esp', ['eax'], 4, 0) linux_amd64_sigreturn = SigreturnABI('rsp', ['rax'], 8, 0) @@ -176,6 +182,7 @@ class SigreturnABI(SyscallABI): linux_aarch64_sigreturn = SigreturnABI('sp', ['x8'], 16, 0) linux_riscv32_sigreturn = SigreturnABI('sp', ['a7'], 4, 0) linux_riscv64_sigreturn = SigreturnABI('sp', ['a7'], 8, 0) +linux_loongarch64_sigreturn = SigreturnABI('sp', ['a7'], 8, 0) sysv_i386_sigreturn = linux_i386_sigreturn sysv_amd64_sigreturn = linux_amd64_sigreturn @@ -183,6 +190,7 @@ class SigreturnABI(SyscallABI): sysv_aarch64_sigreturn = linux_aarch64_sigreturn sysv_riscv32_sigreturn = linux_riscv32_sigreturn sysv_riscv64_sigreturn = linux_riscv64_sigreturn +sysv_loongarch64_sigreturn = linux_loongarch64_sigreturn freebsd_i386 = sysv_i386 freebsd_amd64 = sysv_amd64 diff --git a/pwnlib/asm.py b/pwnlib/asm.py index ee73079a49..a41352a91f 100644 --- a/pwnlib/asm.py +++ b/pwnlib/asm.py @@ -190,6 +190,7 @@ def which_binutils(util, check_version=False): 'sparc64': ['sparc'], 'riscv32': ['riscv32', 'riscv64', 'riscv'], 'riscv64': ['riscv64', 'riscv32', 'riscv'], + 'loongarch64': ['loongarch64', 'loong64'], }.get(arch, []) # If one of the candidate architectures matches the native @@ -275,6 +276,9 @@ def _assembler(): # riscv64-unknown-elf-as supports riscv32 as well as riscv64 'riscv32': [gas, '-march=rv32gc', '-mabi=ilp32'], 'riscv64': [gas, '-march=rv64gc', '-mabi=lp64'], + + # loongarch64 supports none of -64, -EB, -EL or -march + 'loongarch64' : [gas], } assembler = assemblers.get(context.arch, [gas]) @@ -376,6 +380,7 @@ def _bfdname(): 'powerpc64' : 'elf64-powerpc', 'riscv32' : 'elf%d-%sriscv' % (context.bits, E), 'riscv64' : 'elf%d-%sriscv' % (context.bits, E), + 'loongarch64' : 'elf%d-loongarch' % context.bits, 'vax' : 'elf32-vax', 's390' : 'elf%d-s390' % context.bits, 'sparc' : 'elf32-sparc', @@ -400,6 +405,7 @@ def _bfdarch(): 'thumb': 'arm', 'riscv32': 'riscv', 'riscv64': 'riscv', + 'loongarch64': 'loongarch64' } if arch in convert: diff --git a/pwnlib/constants/linux/loongarch64.py b/pwnlib/constants/linux/loongarch64.py new file mode 100644 index 0000000000..d21c4fc5db --- /dev/null +++ b/pwnlib/constants/linux/loongarch64.py @@ -0,0 +1,1323 @@ +from pwnlib.constants.constant import Constant +__NR_io_setup = Constant('__NR_io_setup',0) +__NR_io_destroy = Constant('__NR_io_destroy',1) +__NR_io_submit = Constant('__NR_io_submit',2) +__NR_io_cancel = Constant('__NR_io_cancel',3) +__NR_io_getevents = Constant('__NR_io_getevents',4) +__NR_setxattr = Constant('__NR_setxattr',5) +__NR_lsetxattr = Constant('__NR_lsetxattr',6) +__NR_fsetxattr = Constant('__NR_fsetxattr',7) +__NR_getxattr = Constant('__NR_getxattr',8) +__NR_lgetxattr = Constant('__NR_lgetxattr',9) +__NR_fgetxattr = Constant('__NR_fgetxattr',10) +__NR_listxattr = Constant('__NR_listxattr',11) +__NR_llistxattr = Constant('__NR_llistxattr',12) +__NR_flistxattr = Constant('__NR_flistxattr',13) +__NR_removexattr = Constant('__NR_removexattr',14) +__NR_lremovexattr = Constant('__NR_lremovexattr',15) +__NR_fremovexattr = Constant('__NR_fremovexattr',16) +__NR_getcwd = Constant('__NR_getcwd',17) +__NR_lookup_dcookie = Constant('__NR_lookup_dcookie',18) +__NR_eventfd2 = Constant('__NR_eventfd2',19) +__NR_epoll_create1 = Constant('__NR_epoll_create1',20) +__NR_epoll_ctl = Constant('__NR_epoll_ctl',21) +__NR_epoll_pwait = Constant('__NR_epoll_pwait',22) +__NR_dup = Constant('__NR_dup',23) +__NR_dup3 = Constant('__NR_dup3',24) +__NR3264_fcntl = Constant('__NR3264_fcntl',25) +__NR_inotify_init1 = Constant('__NR_inotify_init1',26) +__NR_inotify_add_watch = Constant('__NR_inotify_add_watch',27) +__NR_inotify_rm_watch = Constant('__NR_inotify_rm_watch',28) +__NR_ioctl = Constant('__NR_ioctl',29) +__NR_ioprio_set = Constant('__NR_ioprio_set',30) +__NR_ioprio_get = Constant('__NR_ioprio_get',31) +__NR_flock = Constant('__NR_flock',32) +__NR_mknodat = Constant('__NR_mknodat',33) +__NR_mkdirat = Constant('__NR_mkdirat',34) +__NR_unlinkat = Constant('__NR_unlinkat',35) +__NR_symlinkat = Constant('__NR_symlinkat',36) +__NR_linkat = Constant('__NR_linkat',37) +__NR_umount2 = Constant('__NR_umount2',39) +__NR_mount = Constant('__NR_mount',40) +__NR_pivot_root = Constant('__NR_pivot_root',41) +__NR_nfsservctl = Constant('__NR_nfsservctl',42) +__NR3264_statfs = Constant('__NR3264_statfs',43) +__NR3264_fstatfs = Constant('__NR3264_fstatfs',44) +__NR3264_truncate = Constant('__NR3264_truncate',45) +__NR3264_ftruncate = Constant('__NR3264_ftruncate',46) +__NR_fallocate = Constant('__NR_fallocate',47) +__NR_faccessat = Constant('__NR_faccessat',48) +__NR_chdir = Constant('__NR_chdir',49) +__NR_fchdir = Constant('__NR_fchdir',50) +__NR_chroot = Constant('__NR_chroot',51) +__NR_fchmod = Constant('__NR_fchmod',52) +__NR_fchmodat = Constant('__NR_fchmodat',53) +__NR_fchownat = Constant('__NR_fchownat',54) +__NR_fchown = Constant('__NR_fchown',55) +__NR_openat = Constant('__NR_openat',56) +__NR_close = Constant('__NR_close',57) +__NR_vhangup = Constant('__NR_vhangup',58) +__NR_pipe2 = Constant('__NR_pipe2',59) +__NR_quotactl = Constant('__NR_quotactl',60) +__NR_getdents64 = Constant('__NR_getdents64',61) +__NR3264_lseek = Constant('__NR3264_lseek',62) +__NR_read = Constant('__NR_read',63) +__NR_write = Constant('__NR_write',64) +__NR_readv = Constant('__NR_readv',65) +__NR_writev = Constant('__NR_writev',66) +__NR_pread64 = Constant('__NR_pread64',67) +__NR_pwrite64 = Constant('__NR_pwrite64',68) +__NR_preadv = Constant('__NR_preadv',69) +__NR_pwritev = Constant('__NR_pwritev',70) +__NR3264_sendfile = Constant('__NR3264_sendfile',71) +__NR_pselect6 = Constant('__NR_pselect6',72) +__NR_ppoll = Constant('__NR_ppoll',73) +__NR_signalfd4 = Constant('__NR_signalfd4',74) +__NR_vmsplice = Constant('__NR_vmsplice',75) +__NR_splice = Constant('__NR_splice',76) +__NR_tee = Constant('__NR_tee',77) +__NR_readlinkat = Constant('__NR_readlinkat',78) +__NR_sync = Constant('__NR_sync',81) +__NR_fsync = Constant('__NR_fsync',82) +__NR_fdatasync = Constant('__NR_fdatasync',83) +__NR_sync_file_range = Constant('__NR_sync_file_range',84) +__NR_timerfd_create = Constant('__NR_timerfd_create',85) +__NR_timerfd_settime = Constant('__NR_timerfd_settime',86) +__NR_timerfd_gettime = Constant('__NR_timerfd_gettime',87) +__NR_utimensat = Constant('__NR_utimensat',88) +__NR_acct = Constant('__NR_acct',89) +__NR_capget = Constant('__NR_capget',90) +__NR_capset = Constant('__NR_capset',91) +__NR_personality = Constant('__NR_personality',92) +__NR_exit = Constant('__NR_exit',93) +__NR_exit_group = Constant('__NR_exit_group',94) +__NR_waitid = Constant('__NR_waitid',95) +__NR_set_tid_address = Constant('__NR_set_tid_address',96) +__NR_unshare = Constant('__NR_unshare',97) +__NR_futex = Constant('__NR_futex',98) +__NR_set_robust_list = Constant('__NR_set_robust_list',99) +__NR_get_robust_list = Constant('__NR_get_robust_list',100) +__NR_nanosleep = Constant('__NR_nanosleep',101) +__NR_getitimer = Constant('__NR_getitimer',102) +__NR_setitimer = Constant('__NR_setitimer',103) +__NR_kexec_load = Constant('__NR_kexec_load',104) +__NR_init_module = Constant('__NR_init_module',105) +__NR_delete_module = Constant('__NR_delete_module',106) +__NR_timer_create = Constant('__NR_timer_create',107) +__NR_timer_gettime = Constant('__NR_timer_gettime',108) +__NR_timer_getoverrun = Constant('__NR_timer_getoverrun',109) +__NR_timer_settime = Constant('__NR_timer_settime',110) +__NR_timer_delete = Constant('__NR_timer_delete',111) +__NR_clock_settime = Constant('__NR_clock_settime',112) +__NR_clock_gettime = Constant('__NR_clock_gettime',113) +__NR_clock_getres = Constant('__NR_clock_getres',114) +__NR_clock_nanosleep = Constant('__NR_clock_nanosleep',115) +__NR_syslog = Constant('__NR_syslog',116) +__NR_ptrace = Constant('__NR_ptrace',117) +__NR_sched_setparam = Constant('__NR_sched_setparam',118) +__NR_sched_setscheduler = Constant('__NR_sched_setscheduler',119) +__NR_sched_getscheduler = Constant('__NR_sched_getscheduler',120) +__NR_sched_getparam = Constant('__NR_sched_getparam',121) +__NR_sched_setaffinity = Constant('__NR_sched_setaffinity',122) +__NR_sched_getaffinity = Constant('__NR_sched_getaffinity',123) +__NR_sched_yield = Constant('__NR_sched_yield',124) +__NR_sched_get_priority_max = Constant('__NR_sched_get_priority_max',125) +__NR_sched_get_priority_min = Constant('__NR_sched_get_priority_min',126) +__NR_sched_rr_get_interval = Constant('__NR_sched_rr_get_interval',127) +__NR_restart_syscall = Constant('__NR_restart_syscall',128) +__NR_kill = Constant('__NR_kill',129) +__NR_tkill = Constant('__NR_tkill',130) +__NR_tgkill = Constant('__NR_tgkill',131) +__NR_sigaltstack = Constant('__NR_sigaltstack',132) +__NR_rt_sigsuspend = Constant('__NR_rt_sigsuspend',133) +__NR_rt_sigaction = Constant('__NR_rt_sigaction',134) +__NR_rt_sigprocmask = Constant('__NR_rt_sigprocmask',135) +__NR_rt_sigpending = Constant('__NR_rt_sigpending',136) +__NR_rt_sigtimedwait = Constant('__NR_rt_sigtimedwait',137) +__NR_rt_sigqueueinfo = Constant('__NR_rt_sigqueueinfo',138) +__NR_rt_sigreturn = Constant('__NR_rt_sigreturn',139) +__NR_setpriority = Constant('__NR_setpriority',140) +__NR_getpriority = Constant('__NR_getpriority',141) +__NR_reboot = Constant('__NR_reboot',142) +__NR_setregid = Constant('__NR_setregid',143) +__NR_setgid = Constant('__NR_setgid',144) +__NR_setreuid = Constant('__NR_setreuid',145) +__NR_setuid = Constant('__NR_setuid',146) +__NR_setresuid = Constant('__NR_setresuid',147) +__NR_getresuid = Constant('__NR_getresuid',148) +__NR_setresgid = Constant('__NR_setresgid',149) +__NR_getresgid = Constant('__NR_getresgid',150) +__NR_setfsuid = Constant('__NR_setfsuid',151) +__NR_setfsgid = Constant('__NR_setfsgid',152) +__NR_times = Constant('__NR_times',153) +__NR_setpgid = Constant('__NR_setpgid',154) +__NR_getpgid = Constant('__NR_getpgid',155) +__NR_getsid = Constant('__NR_getsid',156) +__NR_setsid = Constant('__NR_setsid',157) +__NR_getgroups = Constant('__NR_getgroups',158) +__NR_setgroups = Constant('__NR_setgroups',159) +__NR_uname = Constant('__NR_uname',160) +__NR_sethostname = Constant('__NR_sethostname',161) +__NR_setdomainname = Constant('__NR_setdomainname',162) +__NR_getrusage = Constant('__NR_getrusage',165) +__NR_umask = Constant('__NR_umask',166) +__NR_prctl = Constant('__NR_prctl',167) +__NR_getcpu = Constant('__NR_getcpu',168) +__NR_gettimeofday = Constant('__NR_gettimeofday',169) +__NR_settimeofday = Constant('__NR_settimeofday',170) +__NR_adjtimex = Constant('__NR_adjtimex',171) +__NR_getpid = Constant('__NR_getpid',172) +__NR_getppid = Constant('__NR_getppid',173) +__NR_getuid = Constant('__NR_getuid',174) +__NR_geteuid = Constant('__NR_geteuid',175) +__NR_getgid = Constant('__NR_getgid',176) +__NR_getegid = Constant('__NR_getegid',177) +__NR_gettid = Constant('__NR_gettid',178) +__NR_sysinfo = Constant('__NR_sysinfo',179) +__NR_mq_open = Constant('__NR_mq_open',180) +__NR_mq_unlink = Constant('__NR_mq_unlink',181) +__NR_mq_timedsend = Constant('__NR_mq_timedsend',182) +__NR_mq_timedreceive = Constant('__NR_mq_timedreceive',183) +__NR_mq_notify = Constant('__NR_mq_notify',184) +__NR_mq_getsetattr = Constant('__NR_mq_getsetattr',185) +__NR_msgget = Constant('__NR_msgget',186) +__NR_msgctl = Constant('__NR_msgctl',187) +__NR_msgrcv = Constant('__NR_msgrcv',188) +__NR_msgsnd = Constant('__NR_msgsnd',189) +__NR_semget = Constant('__NR_semget',190) +__NR_semctl = Constant('__NR_semctl',191) +__NR_semtimedop = Constant('__NR_semtimedop',192) +__NR_semop = Constant('__NR_semop',193) +__NR_shmget = Constant('__NR_shmget',194) +__NR_shmctl = Constant('__NR_shmctl',195) +__NR_shmat = Constant('__NR_shmat',196) +__NR_shmdt = Constant('__NR_shmdt',197) +__NR_socket = Constant('__NR_socket',198) +__NR_socketpair = Constant('__NR_socketpair',199) +__NR_bind = Constant('__NR_bind',200) +__NR_listen = Constant('__NR_listen',201) +__NR_accept = Constant('__NR_accept',202) +__NR_connect = Constant('__NR_connect',203) +__NR_getsockname = Constant('__NR_getsockname',204) +__NR_getpeername = Constant('__NR_getpeername',205) +__NR_sendto = Constant('__NR_sendto',206) +__NR_recvfrom = Constant('__NR_recvfrom',207) +__NR_setsockopt = Constant('__NR_setsockopt',208) +__NR_getsockopt = Constant('__NR_getsockopt',209) +__NR_shutdown = Constant('__NR_shutdown',210) +__NR_sendmsg = Constant('__NR_sendmsg',211) +__NR_recvmsg = Constant('__NR_recvmsg',212) +__NR_readahead = Constant('__NR_readahead',213) +__NR_brk = Constant('__NR_brk',214) +__NR_munmap = Constant('__NR_munmap',215) +__NR_mremap = Constant('__NR_mremap',216) +__NR_add_key = Constant('__NR_add_key',217) +__NR_request_key = Constant('__NR_request_key',218) +__NR_keyctl = Constant('__NR_keyctl',219) +__NR_clone = Constant('__NR_clone',220) +__NR_execve = Constant('__NR_execve',221) +__NR3264_mmap = Constant('__NR3264_mmap',222) +__NR3264_fadvise64 = Constant('__NR3264_fadvise64',223) +__NR_swapon = Constant('__NR_swapon',224) +__NR_swapoff = Constant('__NR_swapoff',225) +__NR_mprotect = Constant('__NR_mprotect',226) +__NR_msync = Constant('__NR_msync',227) +__NR_mlock = Constant('__NR_mlock',228) +__NR_munlock = Constant('__NR_munlock',229) +__NR_mlockall = Constant('__NR_mlockall',230) +__NR_munlockall = Constant('__NR_munlockall',231) +__NR_mincore = Constant('__NR_mincore',232) +__NR_madvise = Constant('__NR_madvise',233) +__NR_remap_file_pages = Constant('__NR_remap_file_pages',234) +__NR_mbind = Constant('__NR_mbind',235) +__NR_get_mempolicy = Constant('__NR_get_mempolicy',236) +__NR_set_mempolicy = Constant('__NR_set_mempolicy',237) +__NR_migrate_pages = Constant('__NR_migrate_pages',238) +__NR_move_pages = Constant('__NR_move_pages',239) +__NR_rt_tgsigqueueinfo = Constant('__NR_rt_tgsigqueueinfo',240) +__NR_perf_event_open = Constant('__NR_perf_event_open',241) +__NR_accept4 = Constant('__NR_accept4',242) +__NR_recvmmsg = Constant('__NR_recvmmsg',243) +__NR_arch_specific_syscall = Constant('__NR_arch_specific_syscall',244) +__NR_wait4 = Constant('__NR_wait4',260) +__NR_prlimit64 = Constant('__NR_prlimit64',261) +__NR_fanotify_init = Constant('__NR_fanotify_init',262) +__NR_fanotify_mark = Constant('__NR_fanotify_mark',263) +__NR_name_to_handle_at = Constant('__NR_name_to_handle_at',264) +__NR_open_by_handle_at = Constant('__NR_open_by_handle_at',265) +__NR_clock_adjtime = Constant('__NR_clock_adjtime',266) +__NR_syncfs = Constant('__NR_syncfs',267) +__NR_setns = Constant('__NR_setns',268) +__NR_sendmmsg = Constant('__NR_sendmmsg',269) +__NR_process_vm_readv = Constant('__NR_process_vm_readv',270) +__NR_process_vm_writev = Constant('__NR_process_vm_writev',271) +__NR_kcmp = Constant('__NR_kcmp',272) +__NR_finit_module = Constant('__NR_finit_module',273) +__NR_sched_setattr = Constant('__NR_sched_setattr',274) +__NR_sched_getattr = Constant('__NR_sched_getattr',275) +__NR_renameat2 = Constant('__NR_renameat2',276) +__NR_seccomp = Constant('__NR_seccomp',277) +__NR_getrandom = Constant('__NR_getrandom',278) +__NR_memfd_create = Constant('__NR_memfd_create',279) +__NR_bpf = Constant('__NR_bpf',280) +__NR_execveat = Constant('__NR_execveat',281) +__NR_userfaultfd = Constant('__NR_userfaultfd',282) +__NR_membarrier = Constant('__NR_membarrier',283) +__NR_mlock2 = Constant('__NR_mlock2',284) +__NR_copy_file_range = Constant('__NR_copy_file_range',285) +__NR_preadv2 = Constant('__NR_preadv2',286) +__NR_pwritev2 = Constant('__NR_pwritev2',287) +__NR_pkey_mprotect = Constant('__NR_pkey_mprotect',288) +__NR_pkey_alloc = Constant('__NR_pkey_alloc',289) +__NR_pkey_free = Constant('__NR_pkey_free',290) +__NR_statx = Constant('__NR_statx',291) +__NR_io_pgetevents = Constant('__NR_io_pgetevents',292) +__NR_rseq = Constant('__NR_rseq',293) +__NR_kexec_file_load = Constant('__NR_kexec_file_load',294) +__NR_pidfd_send_signal = Constant('__NR_pidfd_send_signal',424) +__NR_io_uring_setup = Constant('__NR_io_uring_setup',425) +__NR_io_uring_enter = Constant('__NR_io_uring_enter',426) +__NR_io_uring_register = Constant('__NR_io_uring_register',427) +__NR_open_tree = Constant('__NR_open_tree',428) +__NR_move_mount = Constant('__NR_move_mount',429) +__NR_fsopen = Constant('__NR_fsopen',430) +__NR_fsconfig = Constant('__NR_fsconfig',431) +__NR_fsmount = Constant('__NR_fsmount',432) +__NR_fspick = Constant('__NR_fspick',433) +__NR_pidfd_open = Constant('__NR_pidfd_open',434) +__NR_clone3 = Constant('__NR_clone3',435) +__NR_close_range = Constant('__NR_close_range',436) +__NR_openat2 = Constant('__NR_openat2',437) +__NR_pidfd_getfd = Constant('__NR_pidfd_getfd',438) +__NR_faccessat2 = Constant('__NR_faccessat2',439) +__NR_process_madvise = Constant('__NR_process_madvise',440) +__NR_epoll_pwait2 = Constant('__NR_epoll_pwait2',441) +__NR_mount_setattr = Constant('__NR_mount_setattr',442) +__NR_quotactl_fd = Constant('__NR_quotactl_fd',443) +__NR_landlock_create_ruleset = Constant('__NR_landlock_create_ruleset',444) +__NR_landlock_add_rule = Constant('__NR_landlock_add_rule',445) +__NR_landlock_restrict_self = Constant('__NR_landlock_restrict_self',446) +__NR_process_mrelease = Constant('__NR_process_mrelease',448) +__NR_futex_waitv = Constant('__NR_futex_waitv',449) +__NR_set_mempolicy_home_node = Constant('__NR_set_mempolicy_home_node',450) +__NR_cachestat = Constant('__NR_cachestat',451) +__NR_fchmodat2 = Constant('__NR_fchmodat2',452) +__NR_map_shadow_stack = Constant('__NR_map_shadow_stack',453) +__NR_futex_wake = Constant('__NR_futex_wake',454) +__NR_futex_wait = Constant('__NR_futex_wait',455) +__NR_futex_requeue = Constant('__NR_futex_requeue',456) +__NR_fcntl = Constant('__NR_fcntl',25) +__NR_statfs = Constant('__NR_statfs',43) +__NR_fstatfs = Constant('__NR_fstatfs',44) +__NR_truncate = Constant('__NR_truncate',45) +__NR_ftruncate = Constant('__NR_ftruncate',46) +__NR_lseek = Constant('__NR_lseek',62) +__NR_sendfile = Constant('__NR_sendfile',71) +__NR_mmap = Constant('__NR_mmap',222) +__NR_fadvise64 = Constant('__NR_fadvise64',223) +MAP_32BIT = Constant('MAP_32BIT',0x40) +INADDR_ANY = Constant('INADDR_ANY',0) +INADDR_BROADCAST = Constant('INADDR_BROADCAST',0xffffffff) +INADDR_NONE = Constant('INADDR_NONE',0xffffffff) +INADDR_LOOPBACK = Constant('INADDR_LOOPBACK',0x7f000001) +EPERM = Constant('EPERM',1) +ENOENT = Constant('ENOENT',2) +ESRCH = Constant('ESRCH',3) +EINTR = Constant('EINTR',4) +EIO = Constant('EIO',5) +ENXIO = Constant('ENXIO',6) +E2BIG = Constant('E2BIG',7) +ENOEXEC = Constant('ENOEXEC',8) +EBADF = Constant('EBADF',9) +ECHILD = Constant('ECHILD',10) +EAGAIN = Constant('EAGAIN',11) +ENOMEM = Constant('ENOMEM',12) +EACCES = Constant('EACCES',13) +EFAULT = Constant('EFAULT',14) +ENOTBLK = Constant('ENOTBLK',15) +EBUSY = Constant('EBUSY',16) +EEXIST = Constant('EEXIST',17) +EXDEV = Constant('EXDEV',18) +ENODEV = Constant('ENODEV',19) +ENOTDIR = Constant('ENOTDIR',20) +EISDIR = Constant('EISDIR',21) +EINVAL = Constant('EINVAL',22) +ENFILE = Constant('ENFILE',23) +EMFILE = Constant('EMFILE',24) +ENOTTY = Constant('ENOTTY',25) +ETXTBSY = Constant('ETXTBSY',26) +EFBIG = Constant('EFBIG',27) +ENOSPC = Constant('ENOSPC',28) +ESPIPE = Constant('ESPIPE',29) +EROFS = Constant('EROFS',30) +EMLINK = Constant('EMLINK',31) +EPIPE = Constant('EPIPE',32) +EDOM = Constant('EDOM',33) +ERANGE = Constant('ERANGE',34) +EDEADLK = Constant('EDEADLK',35) +ENAMETOOLONG = Constant('ENAMETOOLONG',36) +ENOLCK = Constant('ENOLCK',37) +ENOSYS = Constant('ENOSYS',38) +ENOTEMPTY = Constant('ENOTEMPTY',39) +ELOOP = Constant('ELOOP',40) +EWOULDBLOCK = Constant('EWOULDBLOCK',11) +ENOMSG = Constant('ENOMSG',42) +EIDRM = Constant('EIDRM',43) +ECHRNG = Constant('ECHRNG',44) +EL2NSYNC = Constant('EL2NSYNC',45) +EL3HLT = Constant('EL3HLT',46) +EL3RST = Constant('EL3RST',47) +ELNRNG = Constant('ELNRNG',48) +EUNATCH = Constant('EUNATCH',49) +ENOCSI = Constant('ENOCSI',50) +EL2HLT = Constant('EL2HLT',51) +EBADE = Constant('EBADE',52) +EBADR = Constant('EBADR',53) +EXFULL = Constant('EXFULL',54) +ENOANO = Constant('ENOANO',55) +EBADRQC = Constant('EBADRQC',56) +EBADSLT = Constant('EBADSLT',57) +EDEADLOCK = Constant('EDEADLOCK',35) +EBFONT = Constant('EBFONT',59) +ENOSTR = Constant('ENOSTR',60) +ENODATA = Constant('ENODATA',61) +ETIME = Constant('ETIME',62) +ENOSR = Constant('ENOSR',63) +ENONET = Constant('ENONET',64) +ENOPKG = Constant('ENOPKG',65) +EREMOTE = Constant('EREMOTE',66) +ENOLINK = Constant('ENOLINK',67) +EADV = Constant('EADV',68) +ESRMNT = Constant('ESRMNT',69) +ECOMM = Constant('ECOMM',70) +EPROTO = Constant('EPROTO',71) +EMULTIHOP = Constant('EMULTIHOP',72) +EDOTDOT = Constant('EDOTDOT',73) +EBADMSG = Constant('EBADMSG',74) +EOVERFLOW = Constant('EOVERFLOW',75) +ENOTUNIQ = Constant('ENOTUNIQ',76) +EBADFD = Constant('EBADFD',77) +EREMCHG = Constant('EREMCHG',78) +ELIBACC = Constant('ELIBACC',79) +ELIBBAD = Constant('ELIBBAD',80) +ELIBSCN = Constant('ELIBSCN',81) +ELIBMAX = Constant('ELIBMAX',82) +ELIBEXEC = Constant('ELIBEXEC',83) +EILSEQ = Constant('EILSEQ',84) +ERESTART = Constant('ERESTART',85) +ESTRPIPE = Constant('ESTRPIPE',86) +EUSERS = Constant('EUSERS',87) +ENOTSOCK = Constant('ENOTSOCK',88) +EDESTADDRREQ = Constant('EDESTADDRREQ',89) +EMSGSIZE = Constant('EMSGSIZE',90) +EPROTOTYPE = Constant('EPROTOTYPE',91) +ENOPROTOOPT = Constant('ENOPROTOOPT',92) +EPROTONOSUPPORT = Constant('EPROTONOSUPPORT',93) +ESOCKTNOSUPPORT = Constant('ESOCKTNOSUPPORT',94) +EOPNOTSUPP = Constant('EOPNOTSUPP',95) +ENOTSUP = Constant('ENOTSUP',95) +EPFNOSUPPORT = Constant('EPFNOSUPPORT',96) +EAFNOSUPPORT = Constant('EAFNOSUPPORT',97) +EADDRINUSE = Constant('EADDRINUSE',98) +EADDRNOTAVAIL = Constant('EADDRNOTAVAIL',99) +ENETDOWN = Constant('ENETDOWN',100) +ENETUNREACH = Constant('ENETUNREACH',101) +ENETRESET = Constant('ENETRESET',102) +ECONNABORTED = Constant('ECONNABORTED',103) +ECONNRESET = Constant('ECONNRESET',104) +ENOBUFS = Constant('ENOBUFS',105) +EISCONN = Constant('EISCONN',106) +ENOTCONN = Constant('ENOTCONN',107) +ESHUTDOWN = Constant('ESHUTDOWN',108) +ETOOMANYREFS = Constant('ETOOMANYREFS',109) +ETIMEDOUT = Constant('ETIMEDOUT',110) +ECONNREFUSED = Constant('ECONNREFUSED',111) +EHOSTDOWN = Constant('EHOSTDOWN',112) +EHOSTUNREACH = Constant('EHOSTUNREACH',113) +EALREADY = Constant('EALREADY',114) +EINPROGRESS = Constant('EINPROGRESS',115) +ESTALE = Constant('ESTALE',116) +EUCLEAN = Constant('EUCLEAN',117) +ENOTNAM = Constant('ENOTNAM',118) +ENAVAIL = Constant('ENAVAIL',119) +EISNAM = Constant('EISNAM',120) +EREMOTEIO = Constant('EREMOTEIO',121) +EDQUOT = Constant('EDQUOT',122) +ENOMEDIUM = Constant('ENOMEDIUM',123) +EMEDIUMTYPE = Constant('EMEDIUMTYPE',124) +ECANCELED = Constant('ECANCELED',125) +ENOKEY = Constant('ENOKEY',126) +EKEYEXPIRED = Constant('EKEYEXPIRED',127) +EKEYREVOKED = Constant('EKEYREVOKED',128) +EKEYREJECTED = Constant('EKEYREJECTED',129) +EOWNERDEAD = Constant('EOWNERDEAD',130) +ENOTRECOVERABLE = Constant('ENOTRECOVERABLE',131) +ERFKILL = Constant('ERFKILL',132) +EHWPOISON = Constant('EHWPOISON',133) +__SYS_NERR = Constant('__SYS_NERR',((133) + 1)) +__LITTLE_ENDIAN = Constant('__LITTLE_ENDIAN',1234) +__BIG_ENDIAN = Constant('__BIG_ENDIAN',4321) +__BYTE_ORDER = Constant('__BYTE_ORDER',4321) +__FLOAT_WORD_ORDER = Constant('__FLOAT_WORD_ORDER',4321) +LITTLE_ENDIAN = Constant('LITTLE_ENDIAN',1234) +BIG_ENDIAN = Constant('BIG_ENDIAN',4321) +BYTE_ORDER = Constant('BYTE_ORDER',4321) +__WORDSIZE = Constant('__WORDSIZE',32) +INT8_MAX = Constant('INT8_MAX',(127)) +INT16_MAX = Constant('INT16_MAX',(32767)) +INT32_MAX = Constant('INT32_MAX',(2147483647)) +INT64_MAX = Constant('INT64_MAX',(9223372036854775807)) +INT8_MIN = Constant('INT8_MIN',(-1 - (127))) +INT16_MIN = Constant('INT16_MIN',(-1 - (32767))) +INT32_MIN = Constant('INT32_MIN',(-1 - (2147483647))) +INT64_MIN = Constant('INT64_MIN',(-1 - (9223372036854775807))) +INT_LEAST8_MAX = Constant('INT_LEAST8_MAX',(127)) +INT_LEAST8_MIN = Constant('INT_LEAST8_MIN',(-1 - (127))) +INT_LEAST16_MAX = Constant('INT_LEAST16_MAX',(32767)) +INT_LEAST16_MIN = Constant('INT_LEAST16_MIN',(-1 - (32767))) +INT_LEAST32_MAX = Constant('INT_LEAST32_MAX',(2147483647)) +INT_LEAST32_MIN = Constant('INT_LEAST32_MIN',(-1 - (2147483647))) +INT_LEAST64_MAX = Constant('INT_LEAST64_MAX',(9223372036854775807)) +INT_LEAST64_MIN = Constant('INT_LEAST64_MIN',(-1 - (9223372036854775807))) +UINT8_MAX = Constant('UINT8_MAX',0xff) +UINT16_MAX = Constant('UINT16_MAX',0xffff) +UINT32_MAX = Constant('UINT32_MAX',0xffffffff) +UINT64_MAX = Constant('UINT64_MAX',0xffffffffffffffff) +UINT_LEAST8_MAX = Constant('UINT_LEAST8_MAX',0xff) +UINT_LEAST16_MAX = Constant('UINT_LEAST16_MAX',0xffff) +UINT_LEAST32_MAX = Constant('UINT_LEAST32_MAX',0xffffffff) +UINT_LEAST64_MAX = Constant('UINT_LEAST64_MAX',0xffffffffffffffff) +INTPTR_MIN = Constant('INTPTR_MIN',(-1 - (2147483647))) +INTPTR_MAX = Constant('INTPTR_MAX',(2147483647)) +UINTPTR_MAX = Constant('UINTPTR_MAX',0xffffffff) +SIZE_MAX = Constant('SIZE_MAX',0xffffffff) +PTRDIFF_MIN = Constant('PTRDIFF_MIN',(-1 - (2147483647))) +PTRDIFF_MAX = Constant('PTRDIFF_MAX',(2147483647)) +INTMAX_MIN = Constant('INTMAX_MIN',(-1 - (9223372036854775807))) +INTMAX_MAX = Constant('INTMAX_MAX',(9223372036854775807)) +UINTMAX_MAX = Constant('UINTMAX_MAX',0xffffffffffffffff) +INT_FAST8_MIN = Constant('INT_FAST8_MIN',(-1 - (127))) +INT_FAST8_MAX = Constant('INT_FAST8_MAX',(127)) +INT_FAST64_MIN = Constant('INT_FAST64_MIN',(-1 - (9223372036854775807))) +INT_FAST64_MAX = Constant('INT_FAST64_MAX',(9223372036854775807)) +UINT_FAST8_MAX = Constant('UINT_FAST8_MAX',0xff) +UINT_FAST64_MAX = Constant('UINT_FAST64_MAX',0xffffffffffffffff) +INT_FAST16_MIN = Constant('INT_FAST16_MIN',(-1 - (2147483647))) +INT_FAST16_MAX = Constant('INT_FAST16_MAX',(2147483647)) +UINT_FAST16_MAX = Constant('UINT_FAST16_MAX',0xffffffff) +INT_FAST32_MIN = Constant('INT_FAST32_MIN',(-1 - (2147483647))) +INT_FAST32_MAX = Constant('INT_FAST32_MAX',(2147483647)) +UINT_FAST32_MAX = Constant('UINT_FAST32_MAX',0xffffffff) +WINT_MIN = Constant('WINT_MIN',0) +__FSUID_H = Constant('__FSUID_H',1) +NSIG = Constant('NSIG',32) +_NSIG = Constant('_NSIG',65) +SIGHUP = Constant('SIGHUP',1) +SIGINT = Constant('SIGINT',2) +SIGQUIT = Constant('SIGQUIT',3) +SIGILL = Constant('SIGILL',4) +SIGTRAP = Constant('SIGTRAP',5) +SIGABRT = Constant('SIGABRT',6) +SIGIOT = Constant('SIGIOT',6) +SIGFPE = Constant('SIGFPE',8) +SIGKILL = Constant('SIGKILL',9) +SIGSEGV = Constant('SIGSEGV',11) +SIGPIPE = Constant('SIGPIPE',13) +SIGALRM = Constant('SIGALRM',14) +SIGTERM = Constant('SIGTERM',15) +SIGUNUSED = Constant('SIGUNUSED',31) +SIGRTMIN = Constant('SIGRTMIN',32) +SIGRTMAX = Constant('SIGRTMAX',(65-1)) +SA_NOCLDSTOP = Constant('SA_NOCLDSTOP',0x00000001) +SA_NOCLDWAIT = Constant('SA_NOCLDWAIT',0x00000002) +SA_SIGINFO = Constant('SA_SIGINFO',0x00000004) +SA_RESTORER = Constant('SA_RESTORER',0x04000000) +SA_ONSTACK = Constant('SA_ONSTACK',0x08000000) +SA_RESTART = Constant('SA_RESTART',0x10000000) +SA_INTERRUPT = Constant('SA_INTERRUPT',0x20000000) +SA_NODEFER = Constant('SA_NODEFER',0x40000000) +SA_RESETHAND = Constant('SA_RESETHAND',0x80000000) +SA_NOMASK = Constant('SA_NOMASK',0x40000000) +SA_ONESHOT = Constant('SA_ONESHOT',0x80000000) +SS_ONSTACK = Constant('SS_ONSTACK',1) +SS_DISABLE = Constant('SS_DISABLE',2) +MINSIGSTKSZ = Constant('MINSIGSTKSZ',2048) +SIGSTKSZ = Constant('SIGSTKSZ',8192) +SIG_BLOCK = Constant('SIG_BLOCK',0) +SIG_UNBLOCK = Constant('SIG_UNBLOCK',1) +SIG_SETMASK = Constant('SIG_SETMASK',2) +SI_MAX_SIZE = Constant('SI_MAX_SIZE',128) +SIGEV_SIGNAL = Constant('SIGEV_SIGNAL',0) +SIGEV_NONE = Constant('SIGEV_NONE',1) +SIGEV_THREAD = Constant('SIGEV_THREAD',2) +SIGEV_THREAD_ID = Constant('SIGEV_THREAD_ID',4) +SIGEV_MAX_SIZE = Constant('SIGEV_MAX_SIZE',64) +_SYS_TIME_H = Constant('_SYS_TIME_H',1) +ITIMER_REAL = Constant('ITIMER_REAL',0) +ITIMER_VIRTUAL = Constant('ITIMER_VIRTUAL',1) +ITIMER_PROF = Constant('ITIMER_PROF',2) +FD_SETSIZE = Constant('FD_SETSIZE',1024) +R_OK = Constant('R_OK',4) +W_OK = Constant('W_OK',2) +X_OK = Constant('X_OK',1) +F_OK = Constant('F_OK',0) +SEEK_SET = Constant('SEEK_SET',0) +SEEK_CUR = Constant('SEEK_CUR',1) +SEEK_END = Constant('SEEK_END',2) +STDIN_FILENO = Constant('STDIN_FILENO',0) +STDOUT_FILENO = Constant('STDOUT_FILENO',1) +STDERR_FILENO = Constant('STDERR_FILENO',2) +_CS_PATH = Constant('_CS_PATH',1) +_SC_CLK_TCK = Constant('_SC_CLK_TCK',1) +_SC_ARG_MAX = Constant('_SC_ARG_MAX',2) +_SC_NGROUPS_MAX = Constant('_SC_NGROUPS_MAX',3) +_SC_OPEN_MAX = Constant('_SC_OPEN_MAX',4) +_SC_PAGESIZE = Constant('_SC_PAGESIZE',5) +_SC_NPROCESSORS_ONLN = Constant('_SC_NPROCESSORS_ONLN',6) +_SC_NPROCESSORS_CONF = Constant('_SC_NPROCESSORS_CONF',6) +_SC_PHYS_PAGES = Constant('_SC_PHYS_PAGES',7) +_SC_GETPW_R_SIZE_MAX = Constant('_SC_GETPW_R_SIZE_MAX',8) +_SC_GETGR_R_SIZE_MAX = Constant('_SC_GETGR_R_SIZE_MAX',9) +_PC_PATH_MAX = Constant('_PC_PATH_MAX',1) +_PC_VDISABLE = Constant('_PC_VDISABLE',2) +L_cuserid = Constant('L_cuserid',17) +_POSIX_VERSION = Constant('_POSIX_VERSION',199506) +F_ULOCK = Constant('F_ULOCK',0) +F_LOCK = Constant('F_LOCK',1) +F_TLOCK = Constant('F_TLOCK',2) +F_TEST = Constant('F_TEST',3) +_POSIX_MAPPED_FILES = Constant('_POSIX_MAPPED_FILES',200809) +S_IFMT = Constant('S_IFMT',0o0170000) +S_IFSOCK = Constant('S_IFSOCK',0o140000) +S_IFLNK = Constant('S_IFLNK',0o120000) +S_IFREG = Constant('S_IFREG',0o100000) +S_IFBLK = Constant('S_IFBLK',0o060000) +S_IFDIR = Constant('S_IFDIR',0o040000) +S_IFCHR = Constant('S_IFCHR',0o020000) +S_IFIFO = Constant('S_IFIFO',0o010000) +S_ISUID = Constant('S_ISUID',0o004000) +S_ISGID = Constant('S_ISGID',0o002000) +S_ISVTX = Constant('S_ISVTX',0o001000) +S_IRWXU = Constant('S_IRWXU',0o0700) +S_IRUSR = Constant('S_IRUSR',0o0400) +S_IWUSR = Constant('S_IWUSR',0o0200) +S_IXUSR = Constant('S_IXUSR',0o0100) +S_IRWXG = Constant('S_IRWXG',0o0070) +S_IRGRP = Constant('S_IRGRP',0o0040) +S_IWGRP = Constant('S_IWGRP',0o0020) +S_IXGRP = Constant('S_IXGRP',0o0010) +S_IRWXO = Constant('S_IRWXO',0o0007) +S_IROTH = Constant('S_IROTH',0o0004) +S_IWOTH = Constant('S_IWOTH',0o0002) +S_IXOTH = Constant('S_IXOTH',0o0001) +S_IREAD = Constant('S_IREAD',0o0400) +S_IWRITE = Constant('S_IWRITE',0o0200) +S_IEXEC = Constant('S_IEXEC',0o0100) +_SYS_UIO = Constant('_SYS_UIO',1) +SOL_SOCKET = Constant('SOL_SOCKET',1) +SO_DEBUG = Constant('SO_DEBUG',1) +SO_REUSEADDR = Constant('SO_REUSEADDR',2) +SO_TYPE = Constant('SO_TYPE',3) +SO_ERROR = Constant('SO_ERROR',4) +SO_DONTROUTE = Constant('SO_DONTROUTE',5) +SO_BROADCAST = Constant('SO_BROADCAST',6) +SO_SNDBUF = Constant('SO_SNDBUF',7) +SO_RCVBUF = Constant('SO_RCVBUF',8) +SO_KEEPALIVE = Constant('SO_KEEPALIVE',9) +SO_OOBINLINE = Constant('SO_OOBINLINE',10) +SO_NO_CHECK = Constant('SO_NO_CHECK',11) +SO_PRIORITY = Constant('SO_PRIORITY',12) +SO_LINGER = Constant('SO_LINGER',13) +SO_BSDCOMPAT = Constant('SO_BSDCOMPAT',14) +SO_REUSEPORT = Constant('SO_REUSEPORT',15) +SO_PASSCRED = Constant('SO_PASSCRED',16) +SO_PEERCRED = Constant('SO_PEERCRED',17) +SO_RCVLOWAT = Constant('SO_RCVLOWAT',18) +SO_SNDLOWAT = Constant('SO_SNDLOWAT',19) +SO_RCVTIMEO = Constant('SO_RCVTIMEO',20) +SO_SNDTIMEO = Constant('SO_SNDTIMEO',21) +SO_SECURITY_AUTHENTICATION = Constant('SO_SECURITY_AUTHENTICATION',22) +SO_SECURITY_ENCRYPTION_TRANSPORT = Constant('SO_SECURITY_ENCRYPTION_TRANSPORT',23) +SO_SECURITY_ENCRYPTION_NETWORK = Constant('SO_SECURITY_ENCRYPTION_NETWORK',24) +SO_BINDTODEVICE = Constant('SO_BINDTODEVICE',25) +SO_ATTACH_FILTER = Constant('SO_ATTACH_FILTER',26) +SO_DETACH_FILTER = Constant('SO_DETACH_FILTER',27) +SO_GET_FILTER = Constant('SO_GET_FILTER',26) +SO_PEERNAME = Constant('SO_PEERNAME',28) +SO_TIMESTAMP = Constant('SO_TIMESTAMP',29) +SCM_TIMESTAMP = Constant('SCM_TIMESTAMP',29) +SO_ACCEPTCONN = Constant('SO_ACCEPTCONN',30) +SO_PEERSEC = Constant('SO_PEERSEC',31) +SO_SNDBUFFORCE = Constant('SO_SNDBUFFORCE',32) +SO_RCVBUFFORCE = Constant('SO_RCVBUFFORCE',33) +SO_PASSSEC = Constant('SO_PASSSEC',34) +SO_TIMESTAMPNS = Constant('SO_TIMESTAMPNS',35) +SCM_TIMESTAMPNS = Constant('SCM_TIMESTAMPNS',35) +SO_MARK = Constant('SO_MARK',36) +SO_TIMESTAMPING = Constant('SO_TIMESTAMPING',37) +SCM_TIMESTAMPING = Constant('SCM_TIMESTAMPING',37) +SO_PROTOCOL = Constant('SO_PROTOCOL',38) +SO_DOMAIN = Constant('SO_DOMAIN',39) +SO_RXQ_OVFL = Constant('SO_RXQ_OVFL',40) +SO_WIFI_STATUS = Constant('SO_WIFI_STATUS',41) +SCM_WIFI_STATUS = Constant('SCM_WIFI_STATUS',41) +SO_PEEK_OFF = Constant('SO_PEEK_OFF',42) +SO_NOFCS = Constant('SO_NOFCS',43) +SO_LOCK_FILTER = Constant('SO_LOCK_FILTER',44) +SO_SELECT_ERR_QUEUE = Constant('SO_SELECT_ERR_QUEUE',45) +SO_BUSY_POLL = Constant('SO_BUSY_POLL',46) +SO_MAX_PACING_RATE = Constant('SO_MAX_PACING_RATE',47) +SO_BPF_EXTENSIONS = Constant('SO_BPF_EXTENSIONS',48) +SO_INCOMING_CPU = Constant('SO_INCOMING_CPU',49) +SO_ATTACH_BPF = Constant('SO_ATTACH_BPF',50) +SO_DETACH_BPF = Constant('SO_DETACH_BPF',27) +SO_ATTACH_REUSEPORT_CBPF = Constant('SO_ATTACH_REUSEPORT_CBPF',51) +SO_ATTACH_REUSEPORT_EBPF = Constant('SO_ATTACH_REUSEPORT_EBPF',52) +SO_CNX_ADVICE = Constant('SO_CNX_ADVICE',53) +SCM_TIMESTAMPING_OPT_STATS = Constant('SCM_TIMESTAMPING_OPT_STATS',54) +SO_MEMINFO = Constant('SO_MEMINFO',55) +SO_INCOMING_NAPI_ID = Constant('SO_INCOMING_NAPI_ID',56) +SO_COOKIE = Constant('SO_COOKIE',57) +SCM_TIMESTAMPING_PKTINFO = Constant('SCM_TIMESTAMPING_PKTINFO',58) +SO_PEERGROUPS = Constant('SO_PEERGROUPS',59) +SO_ZEROCOPY = Constant('SO_ZEROCOPY',60) +SOCK_STREAM = Constant('SOCK_STREAM',1) +SOCK_DGRAM = Constant('SOCK_DGRAM',2) +SOCK_RAW = Constant('SOCK_RAW',3) +SOCK_RDM = Constant('SOCK_RDM',4) +SOCK_SEQPACKET = Constant('SOCK_SEQPACKET',5) +SOCK_DCCP = Constant('SOCK_DCCP',6) +SOCK_PACKET = Constant('SOCK_PACKET',10) +UIO_FASTIOV = Constant('UIO_FASTIOV',8) +UIO_MAXIOV = Constant('UIO_MAXIOV',1024) +SCM_RIGHTS = Constant('SCM_RIGHTS',0x01) +SCM_CREDENTIALS = Constant('SCM_CREDENTIALS',0x02) +SCM_CONNECT = Constant('SCM_CONNECT',0x03) +AF_UNSPEC = Constant('AF_UNSPEC',0) +AF_UNIX = Constant('AF_UNIX',1) +AF_LOCAL = Constant('AF_LOCAL',1) +AF_INET = Constant('AF_INET',2) +AF_AX25 = Constant('AF_AX25',3) +AF_IPX = Constant('AF_IPX',4) +AF_APPLETALK = Constant('AF_APPLETALK',5) +AF_NETROM = Constant('AF_NETROM',6) +AF_BRIDGE = Constant('AF_BRIDGE',7) +AF_ATMPVC = Constant('AF_ATMPVC',8) +AF_X25 = Constant('AF_X25',9) +AF_INET6 = Constant('AF_INET6',10) +AF_ROSE = Constant('AF_ROSE',11) +AF_DECnet = Constant('AF_DECnet',12) +AF_NETBEUI = Constant('AF_NETBEUI',13) +AF_SECURITY = Constant('AF_SECURITY',14) +AF_KEY = Constant('AF_KEY',15) +AF_NETLINK = Constant('AF_NETLINK',16) +AF_ROUTE = Constant('AF_ROUTE',16) +AF_PACKET = Constant('AF_PACKET',17) +AF_ASH = Constant('AF_ASH',18) +AF_ECONET = Constant('AF_ECONET',19) +AF_ATMSVC = Constant('AF_ATMSVC',20) +AF_SNA = Constant('AF_SNA',22) +AF_IRDA = Constant('AF_IRDA',23) +AF_PPPOX = Constant('AF_PPPOX',24) +AF_WANPIPE = Constant('AF_WANPIPE',25) +AF_LLC = Constant('AF_LLC',26) +AF_IB = Constant('AF_IB',27) +AF_MPLS = Constant('AF_MPLS',28) +AF_CAN = Constant('AF_CAN',29) +AF_TIPC = Constant('AF_TIPC',30) +AF_BLUETOOTH = Constant('AF_BLUETOOTH',31) +AF_IUCV = Constant('AF_IUCV',32) +AF_RXRPC = Constant('AF_RXRPC',33) +AF_ISDN = Constant('AF_ISDN',34) +AF_PHONET = Constant('AF_PHONET',35) +AF_IEEE802154 = Constant('AF_IEEE802154',36) +AF_CAIF = Constant('AF_CAIF',37) +AF_ALG = Constant('AF_ALG',38) +AF_NFC = Constant('AF_NFC',39) +AF_VSOCK = Constant('AF_VSOCK',40) +AF_KCM = Constant('AF_KCM',41) +AF_QIPCRTR = Constant('AF_QIPCRTR',42) +AF_SMC = Constant('AF_SMC',43) +AF_MAX = Constant('AF_MAX',44) +PF_UNSPEC = Constant('PF_UNSPEC',0) +PF_UNIX = Constant('PF_UNIX',1) +PF_LOCAL = Constant('PF_LOCAL',1) +PF_INET = Constant('PF_INET',2) +PF_AX25 = Constant('PF_AX25',3) +PF_IPX = Constant('PF_IPX',4) +PF_APPLETALK = Constant('PF_APPLETALK',5) +PF_NETROM = Constant('PF_NETROM',6) +PF_BRIDGE = Constant('PF_BRIDGE',7) +PF_ATMPVC = Constant('PF_ATMPVC',8) +PF_X25 = Constant('PF_X25',9) +PF_INET6 = Constant('PF_INET6',10) +PF_ROSE = Constant('PF_ROSE',11) +PF_DECnet = Constant('PF_DECnet',12) +PF_NETBEUI = Constant('PF_NETBEUI',13) +PF_SECURITY = Constant('PF_SECURITY',14) +PF_KEY = Constant('PF_KEY',15) +PF_NETLINK = Constant('PF_NETLINK',16) +PF_ROUTE = Constant('PF_ROUTE',16) +PF_PACKET = Constant('PF_PACKET',17) +PF_ASH = Constant('PF_ASH',18) +PF_ECONET = Constant('PF_ECONET',19) +PF_ATMSVC = Constant('PF_ATMSVC',20) +PF_SNA = Constant('PF_SNA',22) +PF_IRDA = Constant('PF_IRDA',23) +PF_PPPOX = Constant('PF_PPPOX',24) +PF_WANPIPE = Constant('PF_WANPIPE',25) +PF_LLC = Constant('PF_LLC',26) +PF_IB = Constant('PF_IB',27) +PF_MPLS = Constant('PF_MPLS',28) +PF_CAN = Constant('PF_CAN',29) +PF_TIPC = Constant('PF_TIPC',30) +PF_BLUETOOTH = Constant('PF_BLUETOOTH',31) +PF_IUCV = Constant('PF_IUCV',32) +PF_RXRPC = Constant('PF_RXRPC',33) +PF_ISDN = Constant('PF_ISDN',34) +PF_PHONET = Constant('PF_PHONET',35) +PF_IEEE802154 = Constant('PF_IEEE802154',36) +PF_CAIF = Constant('PF_CAIF',37) +PF_ALG = Constant('PF_ALG',38) +PF_NFC = Constant('PF_NFC',39) +PF_VSOCK = Constant('PF_VSOCK',40) +PF_KCM = Constant('PF_KCM',41) +PF_QIPCRTR = Constant('PF_QIPCRTR',42) +PF_SMC = Constant('PF_SMC',43) +PF_MAX = Constant('PF_MAX',44) +SOMAXCONN = Constant('SOMAXCONN',128) +MSG_OOB = Constant('MSG_OOB',1) +MSG_PEEK = Constant('MSG_PEEK',2) +MSG_DONTROUTE = Constant('MSG_DONTROUTE',4) +MSG_TRYHARD = Constant('MSG_TRYHARD',4) +MSG_CTRUNC = Constant('MSG_CTRUNC',8) +MSG_PROBE = Constant('MSG_PROBE',0x10) +MSG_TRUNC = Constant('MSG_TRUNC',0x20) +MSG_DONTWAIT = Constant('MSG_DONTWAIT',0x40) +MSG_EOR = Constant('MSG_EOR',0x80) +MSG_WAITALL = Constant('MSG_WAITALL',0x100) +MSG_FIN = Constant('MSG_FIN',0x200) +MSG_SYN = Constant('MSG_SYN',0x400) +MSG_CONFIRM = Constant('MSG_CONFIRM',0x800) +MSG_RST = Constant('MSG_RST',0x1000) +MSG_ERRQUEUE = Constant('MSG_ERRQUEUE',0x2000) +MSG_NOSIGNAL = Constant('MSG_NOSIGNAL',0x4000) +MSG_MORE = Constant('MSG_MORE',0x8000) +MSG_WAITFORONE = Constant('MSG_WAITFORONE',0x10000) +MSG_SENDPAGE_NOTLAST = Constant('MSG_SENDPAGE_NOTLAST',0x20000) +MSG_BATCH = Constant('MSG_BATCH',0x40000) +MSG_EOF = Constant('MSG_EOF',0x200) +MSG_ZEROCOPY = Constant('MSG_ZEROCOPY',0x4000000) +MSG_FASTOPEN = Constant('MSG_FASTOPEN',0x20000000) +MSG_CMSG_CLOEXEC = Constant('MSG_CMSG_CLOEXEC',0x40000000) +SOL_IP = Constant('SOL_IP',0) +SOL_TCP = Constant('SOL_TCP',6) +SOL_UDP = Constant('SOL_UDP',17) +SOL_IPV6 = Constant('SOL_IPV6',41) +SOL_ICMPV6 = Constant('SOL_ICMPV6',58) +SOL_SCTP = Constant('SOL_SCTP',132) +SOL_UDPLITE = Constant('SOL_UDPLITE',136) +SOL_RAW = Constant('SOL_RAW',255) +SOL_IPX = Constant('SOL_IPX',256) +SOL_AX25 = Constant('SOL_AX25',257) +SOL_ATALK = Constant('SOL_ATALK',258) +SOL_NETROM = Constant('SOL_NETROM',259) +SOL_ROSE = Constant('SOL_ROSE',260) +SOL_DECNET = Constant('SOL_DECNET',261) +SOL_X25 = Constant('SOL_X25',262) +SOL_PACKET = Constant('SOL_PACKET',263) +SOL_ATM = Constant('SOL_ATM',264) +SOL_AAL = Constant('SOL_AAL',265) +SOL_IRDA = Constant('SOL_IRDA',266) +SOL_NETBEUI = Constant('SOL_NETBEUI',267) +SOL_LLC = Constant('SOL_LLC',268) +SOL_DCCP = Constant('SOL_DCCP',269) +SOL_NETLINK = Constant('SOL_NETLINK',270) +SOL_TIPC = Constant('SOL_TIPC',271) +SOL_RXRPC = Constant('SOL_RXRPC',272) +SOL_PPPOL2TP = Constant('SOL_PPPOL2TP',273) +SOL_BLUETOOTH = Constant('SOL_BLUETOOTH',274) +SOL_PNPIPE = Constant('SOL_PNPIPE',275) +SOL_RDS = Constant('SOL_RDS',276) +SOL_IUCV = Constant('SOL_IUCV',277) +SOL_CAIF = Constant('SOL_CAIF',278) +SOL_ALG = Constant('SOL_ALG',279) +SOL_NFC = Constant('SOL_NFC',280) +SOL_KCM = Constant('SOL_KCM',281) +SOL_TLS = Constant('SOL_TLS',282) +IPX_TYPE = Constant('IPX_TYPE',1) +SHUT_RD = Constant('SHUT_RD',0) +SHUT_WR = Constant('SHUT_WR',1) +SHUT_RDWR = Constant('SHUT_RDWR',2) +NI_NOFQDN = Constant('NI_NOFQDN',1) +NI_NUMERICHOST = Constant('NI_NUMERICHOST',2) +NI_NAMEREQD = Constant('NI_NAMEREQD',4) +NI_NUMERICSERV = Constant('NI_NUMERICSERV',8) +NI_DGRAM = Constant('NI_DGRAM',16) +EAI_FAMILY = Constant('EAI_FAMILY',-1) +EAI_SOCKTYPE = Constant('EAI_SOCKTYPE',-2) +EAI_BADFLAGS = Constant('EAI_BADFLAGS',-3) +EAI_NONAME = Constant('EAI_NONAME',-4) +EAI_SERVICE = Constant('EAI_SERVICE',-5) +EAI_ADDRFAMILY = Constant('EAI_ADDRFAMILY',-6) +EAI_NODATA = Constant('EAI_NODATA',-7) +EAI_MEMORY = Constant('EAI_MEMORY',-8) +EAI_FAIL = Constant('EAI_FAIL',-9) +EAI_AGAIN = Constant('EAI_AGAIN',-10) +EAI_SYSTEM = Constant('EAI_SYSTEM',-11) +AI_NUMERICHOST = Constant('AI_NUMERICHOST',1) +AI_CANONNAME = Constant('AI_CANONNAME',2) +AI_PASSIVE = Constant('AI_PASSIVE',4) +AI_NUMERICSERV = Constant('AI_NUMERICSERV',8) +AI_ADDRCONFIG = Constant('AI_ADDRCONFIG',16) +AI_V4MAPPED = Constant('AI_V4MAPPED',32) +AI_ALL = Constant('AI_ALL',64) +SIOCADDRT = Constant('SIOCADDRT',0x890B) +SIOCDELRT = Constant('SIOCDELRT',0x890C) +SIOCRTMSG = Constant('SIOCRTMSG',0x890D) +SIOCGIFNAME = Constant('SIOCGIFNAME',0x8910) +SIOCSIFLINK = Constant('SIOCSIFLINK',0x8911) +SIOCGIFCONF = Constant('SIOCGIFCONF',0x8912) +SIOCGIFFLAGS = Constant('SIOCGIFFLAGS',0x8913) +SIOCSIFFLAGS = Constant('SIOCSIFFLAGS',0x8914) +SIOCGIFADDR = Constant('SIOCGIFADDR',0x8915) +SIOCSIFADDR = Constant('SIOCSIFADDR',0x8916) +SIOCGIFDSTADDR = Constant('SIOCGIFDSTADDR',0x8917) +SIOCSIFDSTADDR = Constant('SIOCSIFDSTADDR',0x8918) +SIOCGIFBRDADDR = Constant('SIOCGIFBRDADDR',0x8919) +SIOCSIFBRDADDR = Constant('SIOCSIFBRDADDR',0x891a) +SIOCGIFNETMASK = Constant('SIOCGIFNETMASK',0x891b) +SIOCSIFNETMASK = Constant('SIOCSIFNETMASK',0x891c) +SIOCGIFMETRIC = Constant('SIOCGIFMETRIC',0x891d) +SIOCSIFMETRIC = Constant('SIOCSIFMETRIC',0x891e) +SIOCGIFMEM = Constant('SIOCGIFMEM',0x891f) +SIOCSIFMEM = Constant('SIOCSIFMEM',0x8920) +SIOCGIFMTU = Constant('SIOCGIFMTU',0x8921) +SIOCSIFMTU = Constant('SIOCSIFMTU',0x8922) +SIOCSIFNAME = Constant('SIOCSIFNAME',0x8923) +SIOCSIFHWADDR = Constant('SIOCSIFHWADDR',0x8924) +SIOCGIFENCAP = Constant('SIOCGIFENCAP',0x8925) +SIOCSIFENCAP = Constant('SIOCSIFENCAP',0x8926) +SIOCGIFHWADDR = Constant('SIOCGIFHWADDR',0x8927) +SIOCGIFSLAVE = Constant('SIOCGIFSLAVE',0x8929) +SIOCSIFSLAVE = Constant('SIOCSIFSLAVE',0x8930) +SIOCADDMULTI = Constant('SIOCADDMULTI',0x8931) +SIOCDELMULTI = Constant('SIOCDELMULTI',0x8932) +SIOCGIFINDEX = Constant('SIOCGIFINDEX',0x8933) +SIOGIFINDEX = Constant('SIOGIFINDEX',0x8933) +SIOCSIFPFLAGS = Constant('SIOCSIFPFLAGS',0x8934) +SIOCGIFPFLAGS = Constant('SIOCGIFPFLAGS',0x8935) +SIOCDIFADDR = Constant('SIOCDIFADDR',0x8936) +SIOCSIFHWBROADCAST = Constant('SIOCSIFHWBROADCAST',0x8937) +SIOCGIFCOUNT = Constant('SIOCGIFCOUNT',0x8938) +SIOCGIFBR = Constant('SIOCGIFBR',0x8940) +SIOCSIFBR = Constant('SIOCSIFBR',0x8941) +SIOCGIFTXQLEN = Constant('SIOCGIFTXQLEN',0x8942) +SIOCSIFTXQLEN = Constant('SIOCSIFTXQLEN',0x8943) +SIOCGIFDIVERT = Constant('SIOCGIFDIVERT',0x8944) +SIOCSIFDIVERT = Constant('SIOCSIFDIVERT',0x8945) +SIOCETHTOOL = Constant('SIOCETHTOOL',0x8946) +SIOCDARP = Constant('SIOCDARP',0x8953) +SIOCGARP = Constant('SIOCGARP',0x8954) +SIOCSARP = Constant('SIOCSARP',0x8955) +SIOCDRARP = Constant('SIOCDRARP',0x8960) +SIOCGRARP = Constant('SIOCGRARP',0x8961) +SIOCSRARP = Constant('SIOCSRARP',0x8962) +SIOCGIFMAP = Constant('SIOCGIFMAP',0x8970) +SIOCSIFMAP = Constant('SIOCSIFMAP',0x8971) +SIOCADDDLCI = Constant('SIOCADDDLCI',0x8980) +SIOCDELDLCI = Constant('SIOCDELDLCI',0x8981) +SIOCDEVPRIVATE = Constant('SIOCDEVPRIVATE',0x89F0) +F_LINUX_SPECIFIC_BASE = Constant('F_LINUX_SPECIFIC_BASE',1024) +F_SETOWN_EX = Constant('F_SETOWN_EX',15) +F_GETOWN_EX = Constant('F_GETOWN_EX',16) +F_GETOWNER_UIDS = Constant('F_GETOWNER_UIDS',17) +F_OFD_GETLK = Constant('F_OFD_GETLK',36) +F_OFD_SETLK = Constant('F_OFD_SETLK',37) +F_OFD_SETLKW = Constant('F_OFD_SETLKW',38) +F_OWNER_TID = Constant('F_OWNER_TID',0) +F_OWNER_PID = Constant('F_OWNER_PID',1) +F_OWNER_PGRP = Constant('F_OWNER_PGRP',2) +AT_FDCWD = Constant('AT_FDCWD',-100) +AT_SYMLINK_NOFOLLOW = Constant('AT_SYMLINK_NOFOLLOW',0x100) +AT_REMOVEDIR = Constant('AT_REMOVEDIR',0x200) +AT_SYMLINK_FOLLOW = Constant('AT_SYMLINK_FOLLOW',0x400) +AT_NO_AUTOMOUNT = Constant('AT_NO_AUTOMOUNT',0x800) +AT_EMPTY_PATH = Constant('AT_EMPTY_PATH',0x1000) +AT_EACCESS = Constant('AT_EACCESS',0x200) +MREMAP_MAYMOVE = Constant('MREMAP_MAYMOVE',1) +MREMAP_FIXED = Constant('MREMAP_FIXED',2) +PROT_READ = Constant('PROT_READ',0x1) +PROT_WRITE = Constant('PROT_WRITE',0x2) +PROT_EXEC = Constant('PROT_EXEC',0x4) +PROT_SEM = Constant('PROT_SEM',0x8) +PROT_NONE = Constant('PROT_NONE',0x0) +PROT_GROWSDOWN = Constant('PROT_GROWSDOWN',0x01000000) +PROT_GROWSUP = Constant('PROT_GROWSUP',0x02000000) +MAP_SHARED = Constant('MAP_SHARED',0x01) +MAP_PRIVATE = Constant('MAP_PRIVATE',0x02) +MAP_TYPE = Constant('MAP_TYPE',0xf) +MADV_REMOVE = Constant('MADV_REMOVE',9) +MADV_DONTFORK = Constant('MADV_DONTFORK',10) +MADV_DOFORK = Constant('MADV_DOFORK',11) +MADV_MERGEABLE = Constant('MADV_MERGEABLE',12) +MADV_UNMERGEABLE = Constant('MADV_UNMERGEABLE',13) +MADV_HUGEPAGE = Constant('MADV_HUGEPAGE',14) +MADV_NOHUGEPAGE = Constant('MADV_NOHUGEPAGE',15) +MADV_DONTDUMP = Constant('MADV_DONTDUMP',16) +MADV_DODUMP = Constant('MADV_DODUMP',17) +MADV_HWPOISON = Constant('MADV_HWPOISON',100) +MADV_SOFT_OFFLINE = Constant('MADV_SOFT_OFFLINE',101) +MLOCK_ONFAULT = Constant('MLOCK_ONFAULT',1) +MAP_FILE = Constant('MAP_FILE',0) +PTRACE_TRACEME = Constant('PTRACE_TRACEME',0) +PTRACE_PEEKTEXT = Constant('PTRACE_PEEKTEXT',1) +PTRACE_PEEKDATA = Constant('PTRACE_PEEKDATA',2) +PTRACE_PEEKUSR = Constant('PTRACE_PEEKUSR',3) +PTRACE_PEEKUSER = Constant('PTRACE_PEEKUSER',3) +PTRACE_POKETEXT = Constant('PTRACE_POKETEXT',4) +PTRACE_POKEDATA = Constant('PTRACE_POKEDATA',5) +PTRACE_POKEUSR = Constant('PTRACE_POKEUSR',6) +PTRACE_POKEUSER = Constant('PTRACE_POKEUSER',6) +PTRACE_CONT = Constant('PTRACE_CONT',7) +PTRACE_KILL = Constant('PTRACE_KILL',8) +PTRACE_SINGLESTEP = Constant('PTRACE_SINGLESTEP',9) +PTRACE_ATTACH = Constant('PTRACE_ATTACH',0x10) +PTRACE_DETACH = Constant('PTRACE_DETACH',0x11) +PTRACE_SYSCALL = Constant('PTRACE_SYSCALL',24) +PTRACE_GETEVENTMSG = Constant('PTRACE_GETEVENTMSG',0x4201) +PTRACE_GETSIGINFO = Constant('PTRACE_GETSIGINFO',0x4202) +PTRACE_SETSIGINFO = Constant('PTRACE_SETSIGINFO',0x4203) +PTRACE_O_TRACESYSGOOD = Constant('PTRACE_O_TRACESYSGOOD',0x00000001) +PTRACE_O_TRACEFORK = Constant('PTRACE_O_TRACEFORK',0x00000002) +PTRACE_O_TRACEVFORK = Constant('PTRACE_O_TRACEVFORK',0x00000004) +PTRACE_O_TRACECLONE = Constant('PTRACE_O_TRACECLONE',0x00000008) +PTRACE_O_TRACEEXEC = Constant('PTRACE_O_TRACEEXEC',0x00000010) +PTRACE_O_TRACEVFORKDONE = Constant('PTRACE_O_TRACEVFORKDONE',0x00000020) +PTRACE_O_TRACEEXIT = Constant('PTRACE_O_TRACEEXIT',0x00000040) +PTRACE_O_MASK = Constant('PTRACE_O_MASK',0x0000007f) +PTRACE_EVENT_FORK = Constant('PTRACE_EVENT_FORK',1) +PTRACE_EVENT_VFORK = Constant('PTRACE_EVENT_VFORK',2) +PTRACE_EVENT_CLONE = Constant('PTRACE_EVENT_CLONE',3) +PTRACE_EVENT_EXEC = Constant('PTRACE_EVENT_EXEC',4) +PTRACE_EVENT_VFORK_DONE = Constant('PTRACE_EVENT_VFORK_DONE',5) +PTRACE_EVENT_EXIT = Constant('PTRACE_EVENT_EXIT',6) +PT_TRACE_ME = Constant('PT_TRACE_ME',0) +PT_READ_I = Constant('PT_READ_I',1) +PT_READ_D = Constant('PT_READ_D',2) +PT_READ_U = Constant('PT_READ_U',3) +PT_WRITE_I = Constant('PT_WRITE_I',4) +PT_WRITE_D = Constant('PT_WRITE_D',5) +PT_WRITE_U = Constant('PT_WRITE_U',6) +PT_CONTINUE = Constant('PT_CONTINUE',7) +PT_KILL = Constant('PT_KILL',8) +PT_STEP = Constant('PT_STEP',9) +PT_ATTACH = Constant('PT_ATTACH',0x10) +PT_DETACH = Constant('PT_DETACH',0x11) +SYS_accept = Constant('SYS_accept',202) +SYS_accept4 = Constant('SYS_accept4',242) +SYS_acct = Constant('SYS_acct',89) +SYS_add_key = Constant('SYS_add_key',217) +SYS_adjtimex = Constant('SYS_adjtimex',171) +SYS_arch_specific_syscall = Constant('SYS_arch_specific_syscall',244) +SYS_bind = Constant('SYS_bind',200) +SYS_bpf = Constant('SYS_bpf',280) +SYS_brk = Constant('SYS_brk',214) +SYS_cachestat = Constant('SYS_cachestat',451) +SYS_capget = Constant('SYS_capget',90) +SYS_capset = Constant('SYS_capset',91) +SYS_chdir = Constant('SYS_chdir',49) +SYS_chroot = Constant('SYS_chroot',51) +SYS_clock_adjtime = Constant('SYS_clock_adjtime',266) +SYS_clock_getres = Constant('SYS_clock_getres',114) +SYS_clock_gettime = Constant('SYS_clock_gettime',113) +SYS_clock_nanosleep = Constant('SYS_clock_nanosleep',115) +SYS_clock_settime = Constant('SYS_clock_settime',112) +SYS_clone = Constant('SYS_clone',220) +SYS_clone3 = Constant('SYS_clone3',435) +SYS_close = Constant('SYS_close',57) +SYS_close_range = Constant('SYS_close_range',436) +SYS_connect = Constant('SYS_connect',203) +SYS_copy_file_range = Constant('SYS_copy_file_range',285) +SYS_delete_module = Constant('SYS_delete_module',106) +SYS_dup = Constant('SYS_dup',23) +SYS_dup3 = Constant('SYS_dup3',24) +SYS_epoll_create1 = Constant('SYS_epoll_create1',20) +SYS_epoll_ctl = Constant('SYS_epoll_ctl',21) +SYS_epoll_pwait = Constant('SYS_epoll_pwait',22) +SYS_epoll_pwait2 = Constant('SYS_epoll_pwait2',441) +SYS_eventfd2 = Constant('SYS_eventfd2',19) +SYS_execve = Constant('SYS_execve',221) +SYS_execveat = Constant('SYS_execveat',281) +SYS_exit = Constant('SYS_exit',93) +SYS_exit_group = Constant('SYS_exit_group',94) +SYS_faccessat = Constant('SYS_faccessat',48) +SYS_faccessat2 = Constant('SYS_faccessat2',439) +SYS_fadvise64 = Constant('SYS_fadvise64',223) +SYS_fallocate = Constant('SYS_fallocate',47) +SYS_fanotify_init = Constant('SYS_fanotify_init',262) +SYS_fanotify_mark = Constant('SYS_fanotify_mark',263) +SYS_fchdir = Constant('SYS_fchdir',50) +SYS_fchmod = Constant('SYS_fchmod',52) +SYS_fchmodat = Constant('SYS_fchmodat',53) +SYS_fchmodat2 = Constant('SYS_fchmodat2',452) +SYS_fchown = Constant('SYS_fchown',55) +SYS_fchownat = Constant('SYS_fchownat',54) +SYS_fcntl = Constant('SYS_fcntl',25) +SYS_fdatasync = Constant('SYS_fdatasync',83) +SYS_fgetxattr = Constant('SYS_fgetxattr',10) +SYS_finit_module = Constant('SYS_finit_module',273) +SYS_flistxattr = Constant('SYS_flistxattr',13) +SYS_flock = Constant('SYS_flock',32) +SYS_fremovexattr = Constant('SYS_fremovexattr',16) +SYS_fsconfig = Constant('SYS_fsconfig',431) +SYS_fsetxattr = Constant('SYS_fsetxattr',7) +SYS_fsmount = Constant('SYS_fsmount',432) +SYS_fsopen = Constant('SYS_fsopen',430) +SYS_fspick = Constant('SYS_fspick',433) +SYS_fstatfs = Constant('SYS_fstatfs',44) +SYS_fsync = Constant('SYS_fsync',82) +SYS_ftruncate = Constant('SYS_ftruncate',46) +SYS_futex = Constant('SYS_futex',98) +SYS_futex_requeue = Constant('SYS_futex_requeue',456) +SYS_futex_wait = Constant('SYS_futex_wait',455) +SYS_futex_waitv = Constant('SYS_futex_waitv',449) +SYS_futex_wake = Constant('SYS_futex_wake',454) +SYS_getcpu = Constant('SYS_getcpu',168) +SYS_getcwd = Constant('SYS_getcwd',17) +SYS_getdents64 = Constant('SYS_getdents64',61) +SYS_getegid = Constant('SYS_getegid',177) +SYS_geteuid = Constant('SYS_geteuid',175) +SYS_getgid = Constant('SYS_getgid',176) +SYS_getgroups = Constant('SYS_getgroups',158) +SYS_getitimer = Constant('SYS_getitimer',102) +SYS_get_mempolicy = Constant('SYS_get_mempolicy',236) +SYS_getpeername = Constant('SYS_getpeername',205) +SYS_getpgid = Constant('SYS_getpgid',155) +SYS_getpid = Constant('SYS_getpid',172) +SYS_getppid = Constant('SYS_getppid',173) +SYS_getpriority = Constant('SYS_getpriority',141) +SYS_getrandom = Constant('SYS_getrandom',278) +SYS_getresgid = Constant('SYS_getresgid',150) +SYS_getresuid = Constant('SYS_getresuid',148) +SYS_get_robust_list = Constant('SYS_get_robust_list',100) +SYS_getrusage = Constant('SYS_getrusage',165) +SYS_getsid = Constant('SYS_getsid',156) +SYS_getsockname = Constant('SYS_getsockname',204) +SYS_getsockopt = Constant('SYS_getsockopt',209) +SYS_gettid = Constant('SYS_gettid',178) +SYS_gettimeofday = Constant('SYS_gettimeofday',169) +SYS_getuid = Constant('SYS_getuid',174) +SYS_getxattr = Constant('SYS_getxattr',8) +SYS_init_module = Constant('SYS_init_module',105) +SYS_inotify_add_watch = Constant('SYS_inotify_add_watch',27) +SYS_inotify_init1 = Constant('SYS_inotify_init1',26) +SYS_inotify_rm_watch = Constant('SYS_inotify_rm_watch',28) +SYS_io_cancel = Constant('SYS_io_cancel',3) +SYS_ioctl = Constant('SYS_ioctl',29) +SYS_io_destroy = Constant('SYS_io_destroy',1) +SYS_io_getevents = Constant('SYS_io_getevents',4) +SYS_io_pgetevents = Constant('SYS_io_pgetevents',292) +SYS_ioprio_get = Constant('SYS_ioprio_get',31) +SYS_ioprio_set = Constant('SYS_ioprio_set',30) +SYS_io_setup = Constant('SYS_io_setup',0) +SYS_io_submit = Constant('SYS_io_submit',2) +SYS_io_uring_enter = Constant('SYS_io_uring_enter',426) +SYS_io_uring_register = Constant('SYS_io_uring_register',427) +SYS_io_uring_setup = Constant('SYS_io_uring_setup',425) +SYS_kcmp = Constant('SYS_kcmp',272) +SYS_kexec_file_load = Constant('SYS_kexec_file_load',294) +SYS_kexec_load = Constant('SYS_kexec_load',104) +SYS_keyctl = Constant('SYS_keyctl',219) +SYS_kill = Constant('SYS_kill',129) +SYS_landlock_add_rule = Constant('SYS_landlock_add_rule',445) +SYS_landlock_create_ruleset = Constant('SYS_landlock_create_ruleset',444) +SYS_landlock_restrict_self = Constant('SYS_landlock_restrict_self',446) +SYS_lgetxattr = Constant('SYS_lgetxattr',9) +SYS_linkat = Constant('SYS_linkat',37) +SYS_listen = Constant('SYS_listen',201) +SYS_listxattr = Constant('SYS_listxattr',11) +SYS_llistxattr = Constant('SYS_llistxattr',12) +SYS_lookup_dcookie = Constant('SYS_lookup_dcookie',18) +SYS_lremovexattr = Constant('SYS_lremovexattr',15) +SYS_lseek = Constant('SYS_lseek',62) +SYS_lsetxattr = Constant('SYS_lsetxattr',6) +SYS_madvise = Constant('SYS_madvise',233) +SYS_map_shadow_stack = Constant('SYS_map_shadow_stack',453) +SYS_mbind = Constant('SYS_mbind',235) +SYS_membarrier = Constant('SYS_membarrier',283) +SYS_memfd_create = Constant('SYS_memfd_create',279) +SYS_migrate_pages = Constant('SYS_migrate_pages',238) +SYS_mincore = Constant('SYS_mincore',232) +SYS_mkdirat = Constant('SYS_mkdirat',34) +SYS_mknodat = Constant('SYS_mknodat',33) +SYS_mlock = Constant('SYS_mlock',228) +SYS_mlock2 = Constant('SYS_mlock2',284) +SYS_mlockall = Constant('SYS_mlockall',230) +SYS_mmap = Constant('SYS_mmap',222) +SYS_mount = Constant('SYS_mount',40) +SYS_mount_setattr = Constant('SYS_mount_setattr',442) +SYS_move_mount = Constant('SYS_move_mount',429) +SYS_move_pages = Constant('SYS_move_pages',239) +SYS_mprotect = Constant('SYS_mprotect',226) +SYS_mq_getsetattr = Constant('SYS_mq_getsetattr',185) +SYS_mq_notify = Constant('SYS_mq_notify',184) +SYS_mq_open = Constant('SYS_mq_open',180) +SYS_mq_timedreceive = Constant('SYS_mq_timedreceive',183) +SYS_mq_timedsend = Constant('SYS_mq_timedsend',182) +SYS_mq_unlink = Constant('SYS_mq_unlink',181) +SYS_mremap = Constant('SYS_mremap',216) +SYS_msgctl = Constant('SYS_msgctl',187) +SYS_msgget = Constant('SYS_msgget',186) +SYS_msgrcv = Constant('SYS_msgrcv',188) +SYS_msgsnd = Constant('SYS_msgsnd',189) +SYS_msync = Constant('SYS_msync',227) +SYS_munlock = Constant('SYS_munlock',229) +SYS_munlockall = Constant('SYS_munlockall',231) +SYS_munmap = Constant('SYS_munmap',215) +SYS_name_to_handle_at = Constant('SYS_name_to_handle_at',264) +SYS_nanosleep = Constant('SYS_nanosleep',101) +SYS_nfsservctl = Constant('SYS_nfsservctl',42) +SYS_openat = Constant('SYS_openat',56) +SYS_openat2 = Constant('SYS_openat2',437) +SYS_open_by_handle_at = Constant('SYS_open_by_handle_at',265) +SYS_open_tree = Constant('SYS_open_tree',428) +SYS_perf_event_open = Constant('SYS_perf_event_open',241) +SYS_personality = Constant('SYS_personality',92) +SYS_pidfd_getfd = Constant('SYS_pidfd_getfd',438) +SYS_pidfd_open = Constant('SYS_pidfd_open',434) +SYS_pidfd_send_signal = Constant('SYS_pidfd_send_signal',424) +SYS_pipe2 = Constant('SYS_pipe2',59) +SYS_pivot_root = Constant('SYS_pivot_root',41) +SYS_pkey_alloc = Constant('SYS_pkey_alloc',289) +SYS_pkey_free = Constant('SYS_pkey_free',290) +SYS_pkey_mprotect = Constant('SYS_pkey_mprotect',288) +SYS_ppoll = Constant('SYS_ppoll',73) +SYS_prctl = Constant('SYS_prctl',167) +SYS_pread64 = Constant('SYS_pread64',67) +SYS_preadv = Constant('SYS_preadv',69) +SYS_preadv2 = Constant('SYS_preadv2',286) +SYS_prlimit64 = Constant('SYS_prlimit64',261) +SYS_process_madvise = Constant('SYS_process_madvise',440) +SYS_process_mrelease = Constant('SYS_process_mrelease',448) +SYS_process_vm_readv = Constant('SYS_process_vm_readv',270) +SYS_process_vm_writev = Constant('SYS_process_vm_writev',271) +SYS_pselect6 = Constant('SYS_pselect6',72) +SYS_ptrace = Constant('SYS_ptrace',117) +SYS_pwrite64 = Constant('SYS_pwrite64',68) +SYS_pwritev = Constant('SYS_pwritev',70) +SYS_pwritev2 = Constant('SYS_pwritev2',287) +SYS_quotactl = Constant('SYS_quotactl',60) +SYS_quotactl_fd = Constant('SYS_quotactl_fd',443) +SYS_read = Constant('SYS_read',63) +SYS_readahead = Constant('SYS_readahead',213) +SYS_readlinkat = Constant('SYS_readlinkat',78) +SYS_readv = Constant('SYS_readv',65) +SYS_reboot = Constant('SYS_reboot',142) +SYS_recvfrom = Constant('SYS_recvfrom',207) +SYS_recvmmsg = Constant('SYS_recvmmsg',243) +SYS_recvmsg = Constant('SYS_recvmsg',212) +SYS_remap_file_pages = Constant('SYS_remap_file_pages',234) +SYS_removexattr = Constant('SYS_removexattr',14) +SYS_renameat2 = Constant('SYS_renameat2',276) +SYS_request_key = Constant('SYS_request_key',218) +SYS_restart_syscall = Constant('SYS_restart_syscall',128) +SYS_rseq = Constant('SYS_rseq',293) +SYS_rt_sigaction = Constant('SYS_rt_sigaction',134) +SYS_rt_sigpending = Constant('SYS_rt_sigpending',136) +SYS_rt_sigprocmask = Constant('SYS_rt_sigprocmask',135) +SYS_rt_sigqueueinfo = Constant('SYS_rt_sigqueueinfo',138) +SYS_rt_sigreturn = Constant('SYS_rt_sigreturn',139) +SYS_rt_sigsuspend = Constant('SYS_rt_sigsuspend',133) +SYS_rt_sigtimedwait = Constant('SYS_rt_sigtimedwait',137) +SYS_rt_tgsigqueueinfo = Constant('SYS_rt_tgsigqueueinfo',240) +SYS_sched_getaffinity = Constant('SYS_sched_getaffinity',123) +SYS_sched_getattr = Constant('SYS_sched_getattr',275) +SYS_sched_getparam = Constant('SYS_sched_getparam',121) +SYS_sched_get_priority_max = Constant('SYS_sched_get_priority_max',125) +SYS_sched_get_priority_min = Constant('SYS_sched_get_priority_min',126) +SYS_sched_getscheduler = Constant('SYS_sched_getscheduler',120) +SYS_sched_rr_get_interval = Constant('SYS_sched_rr_get_interval',127) +SYS_sched_setaffinity = Constant('SYS_sched_setaffinity',122) +SYS_sched_setattr = Constant('SYS_sched_setattr',274) +SYS_sched_setparam = Constant('SYS_sched_setparam',118) +SYS_sched_setscheduler = Constant('SYS_sched_setscheduler',119) +SYS_sched_yield = Constant('SYS_sched_yield',124) +SYS_seccomp = Constant('SYS_seccomp',277) +SYS_semctl = Constant('SYS_semctl',191) +SYS_semget = Constant('SYS_semget',190) +SYS_semop = Constant('SYS_semop',193) +SYS_semtimedop = Constant('SYS_semtimedop',192) +SYS_sendfile = Constant('SYS_sendfile',71) +SYS_sendmmsg = Constant('SYS_sendmmsg',269) +SYS_sendmsg = Constant('SYS_sendmsg',211) +SYS_sendto = Constant('SYS_sendto',206) +SYS_setdomainname = Constant('SYS_setdomainname',162) +SYS_setfsgid = Constant('SYS_setfsgid',152) +SYS_setfsuid = Constant('SYS_setfsuid',151) +SYS_setgid = Constant('SYS_setgid',144) +SYS_setgroups = Constant('SYS_setgroups',159) +SYS_sethostname = Constant('SYS_sethostname',161) +SYS_setitimer = Constant('SYS_setitimer',103) +SYS_set_mempolicy = Constant('SYS_set_mempolicy',237) +SYS_set_mempolicy_home_node = Constant('SYS_set_mempolicy_home_node',450) +SYS_setns = Constant('SYS_setns',268) +SYS_setpgid = Constant('SYS_setpgid',154) +SYS_setpriority = Constant('SYS_setpriority',140) +SYS_setregid = Constant('SYS_setregid',143) +SYS_setresgid = Constant('SYS_setresgid',149) +SYS_setresuid = Constant('SYS_setresuid',147) +SYS_setreuid = Constant('SYS_setreuid',145) +SYS_set_robust_list = Constant('SYS_set_robust_list',99) +SYS_setsid = Constant('SYS_setsid',157) +SYS_setsockopt = Constant('SYS_setsockopt',208) +SYS_set_tid_address = Constant('SYS_set_tid_address',96) +SYS_settimeofday = Constant('SYS_settimeofday',170) +SYS_setuid = Constant('SYS_setuid',146) +SYS_setxattr = Constant('SYS_setxattr',5) +SYS_shmat = Constant('SYS_shmat',196) +SYS_shmctl = Constant('SYS_shmctl',195) +SYS_shmdt = Constant('SYS_shmdt',197) +SYS_shmget = Constant('SYS_shmget',194) +SYS_shutdown = Constant('SYS_shutdown',210) +SYS_sigaltstack = Constant('SYS_sigaltstack',132) +SYS_signalfd4 = Constant('SYS_signalfd4',74) +SYS_socket = Constant('SYS_socket',198) +SYS_socketpair = Constant('SYS_socketpair',199) +SYS_splice = Constant('SYS_splice',76) +SYS_statfs = Constant('SYS_statfs',43) +SYS_statx = Constant('SYS_statx',291) +SYS_swapoff = Constant('SYS_swapoff',225) +SYS_swapon = Constant('SYS_swapon',224) +SYS_symlinkat = Constant('SYS_symlinkat',36) +SYS_sync = Constant('SYS_sync',81) +SYS_sync_file_range = Constant('SYS_sync_file_range',84) +SYS_syncfs = Constant('SYS_syncfs',267) +SYS_sysinfo = Constant('SYS_sysinfo',179) +SYS_syslog = Constant('SYS_syslog',116) +SYS_tee = Constant('SYS_tee',77) +SYS_tgkill = Constant('SYS_tgkill',131) +SYS_timer_create = Constant('SYS_timer_create',107) +SYS_timer_delete = Constant('SYS_timer_delete',111) +SYS_timerfd_create = Constant('SYS_timerfd_create',85) +SYS_timerfd_gettime = Constant('SYS_timerfd_gettime',87) +SYS_timerfd_settime = Constant('SYS_timerfd_settime',86) +SYS_timer_getoverrun = Constant('SYS_timer_getoverrun',109) +SYS_timer_gettime = Constant('SYS_timer_gettime',108) +SYS_timer_settime = Constant('SYS_timer_settime',110) +SYS_times = Constant('SYS_times',153) +SYS_tkill = Constant('SYS_tkill',130) +SYS_truncate = Constant('SYS_truncate',45) +SYS_umask = Constant('SYS_umask',166) +SYS_umount2 = Constant('SYS_umount2',39) +SYS_uname = Constant('SYS_uname',160) +SYS_unlinkat = Constant('SYS_unlinkat',35) +SYS_unshare = Constant('SYS_unshare',97) +SYS_userfaultfd = Constant('SYS_userfaultfd',282) +SYS_utimensat = Constant('SYS_utimensat',88) +SYS_vhangup = Constant('SYS_vhangup',58) +SYS_vmsplice = Constant('SYS_vmsplice',75) +SYS_wait4 = Constant('SYS_wait4',260) +SYS_waitid = Constant('SYS_waitid',95) +SYS_write = Constant('SYS_write',64) +SYS_writev = Constant('SYS_writev',66) diff --git a/pwnlib/context/__init__.py b/pwnlib/context/__init__.py index 82f71c3155..7cb1adb0c0 100644 --- a/pwnlib/context/__init__.py +++ b/pwnlib/context/__init__.py @@ -423,6 +423,7 @@ class ContextType(object): 'powerpc64': big_64, 'riscv32': little_32, 'riscv64': little_64, + 'loongarch64': little_64, 's390': big_32, 'sparc': big_32, 'sparc64': big_64, @@ -795,7 +796,9 @@ def arch(self, arch): ('armeabi', 'arm'), ('arm64', 'aarch64'), ('rv32', 'riscv32'), - ('rv64', 'riscv64')] + ('rv64', 'riscv64'), + ('loong64', 'loongarch64'), + ('la64', 'loongarch64')] for k, v in transform: if arch.startswith(k): arch = v @@ -1095,7 +1098,7 @@ def log_console(self, stream): @_validator def local_libcdb(self, path): - """ + """ Sets path to local libc-database, get more information for libc-database: https://github.com/niklasb/libc-database @@ -1509,7 +1512,7 @@ def newline(self, v): # circular imports from pwnlib.util.packing import _need_bytes return _need_bytes(v) - + @_validator def throw_eof_on_incomplete_line(self, v): """Whether to raise an :class:`EOFError` if an EOF is received before a newline in ``tube.recvline``. diff --git a/pwnlib/data/includes/generator/linux/diet/loongarch64/syscalls.h b/pwnlib/data/includes/generator/linux/diet/loongarch64/syscalls.h new file mode 100644 index 0000000000..2afb4ea16d --- /dev/null +++ b/pwnlib/data/includes/generator/linux/diet/loongarch64/syscalls.h @@ -0,0 +1,316 @@ +#define __NR_io_setup 0 +#define __NR_io_destroy 1 +#define __NR_io_submit 2 +#define __NR_io_cancel 3 +#define __NR_io_getevents 4 +#define __NR_setxattr 5 +#define __NR_lsetxattr 6 +#define __NR_fsetxattr 7 +#define __NR_getxattr 8 +#define __NR_lgetxattr 9 +#define __NR_fgetxattr 10 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_flistxattr 13 +#define __NR_removexattr 14 +#define __NR_lremovexattr 15 +#define __NR_fremovexattr 16 +#define __NR_getcwd 17 +#define __NR_lookup_dcookie 18 +#define __NR_eventfd2 19 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR3264_fcntl 25 +#define __NR_inotify_init1 26 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_rm_watch 28 +#define __NR_ioctl 29 +#define __NR_ioprio_set 30 +#define __NR_ioprio_get 31 +#define __NR_flock 32 +#define __NR_mknodat 33 +#define __NR_mkdirat 34 +#define __NR_unlinkat 35 +#define __NR_symlinkat 36 +#define __NR_linkat 37 +#define __NR_umount2 39 +#define __NR_mount 40 +#define __NR_pivot_root 41 +#define __NR_nfsservctl 42 +#define __NR3264_statfs 43 +#define __NR3264_fstatfs 44 +#define __NR3264_truncate 45 +#define __NR3264_ftruncate 46 +#define __NR_fallocate 47 +#define __NR_faccessat 48 +#define __NR_chdir 49 +#define __NR_fchdir 50 +#define __NR_chroot 51 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchownat 54 +#define __NR_fchown 55 +#define __NR_openat 56 +#define __NR_close 57 +#define __NR_vhangup 58 +#define __NR_pipe2 59 +#define __NR_quotactl 60 +#define __NR_getdents64 61 +#define __NR3264_lseek 62 +#define __NR_read 63 +#define __NR_write 64 +#define __NR_readv 65 +#define __NR_writev 66 +#define __NR_pread64 67 +#define __NR_pwrite64 68 +#define __NR_preadv 69 +#define __NR_pwritev 70 +#define __NR3264_sendfile 71 +#define __NR_pselect6 72 +#define __NR_ppoll 73 +#define __NR_signalfd4 74 +#define __NR_vmsplice 75 +#define __NR_splice 76 +#define __NR_tee 77 +#define __NR_readlinkat 78 +#define __NR_sync 81 +#define __NR_fsync 82 +#define __NR_fdatasync 83 +#define __NR_sync_file_range 84 +#define __NR_timerfd_create 85 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_gettime 87 +#define __NR_utimensat 88 +#define __NR_acct 89 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_personality 92 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_waitid 95 +#define __NR_set_tid_address 96 +#define __NR_unshare 97 +#define __NR_futex 98 +#define __NR_set_robust_list 99 +#define __NR_get_robust_list 100 +#define __NR_nanosleep 101 +#define __NR_getitimer 102 +#define __NR_setitimer 103 +#define __NR_kexec_load 104 +#define __NR_init_module 105 +#define __NR_delete_module 106 +#define __NR_timer_create 107 +#define __NR_timer_gettime 108 +#define __NR_timer_getoverrun 109 +#define __NR_timer_settime 110 +#define __NR_timer_delete 111 +#define __NR_clock_settime 112 +#define __NR_clock_gettime 113 +#define __NR_clock_getres 114 +#define __NR_clock_nanosleep 115 +#define __NR_syslog 116 +#define __NR_ptrace 117 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_getscheduler 120 +#define __NR_sched_getparam 121 +#define __NR_sched_setaffinity 122 +#define __NR_sched_getaffinity 123 +#define __NR_sched_yield 124 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_rr_get_interval 127 +#define __NR_restart_syscall 128 +#define __NR_kill 129 +#define __NR_tkill 130 +#define __NR_tgkill 131 +#define __NR_sigaltstack 132 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_setpriority 140 +#define __NR_getpriority 141 +#define __NR_reboot 142 +#define __NR_setregid 143 +#define __NR_setgid 144 +#define __NR_setreuid 145 +#define __NR_setuid 146 +#define __NR_setresuid 147 +#define __NR_getresuid 148 +#define __NR_setresgid 149 +#define __NR_getresgid 150 +#define __NR_setfsuid 151 +#define __NR_setfsgid 152 +#define __NR_times 153 +#define __NR_setpgid 154 +#define __NR_getpgid 155 +#define __NR_getsid 156 +#define __NR_setsid 157 +#define __NR_getgroups 158 +#define __NR_setgroups 159 +#define __NR_uname 160 +#define __NR_sethostname 161 +#define __NR_setdomainname 162 +#define __NR_getrusage 165 +#define __NR_umask 166 +#define __NR_prctl 167 +#define __NR_getcpu 168 +#define __NR_gettimeofday 169 +#define __NR_settimeofday 170 +#define __NR_adjtimex 171 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getuid 174 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getegid 177 +#define __NR_gettid 178 +#define __NR_sysinfo 179 +#define __NR_mq_open 180 +#define __NR_mq_unlink 181 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedreceive 183 +#define __NR_mq_notify 184 +#define __NR_mq_getsetattr 185 +#define __NR_msgget 186 +#define __NR_msgctl 187 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_semget 190 +#define __NR_semctl 191 +#define __NR_semtimedop 192 +#define __NR_semop 193 +#define __NR_shmget 194 +#define __NR_shmctl 195 +#define __NR_shmat 196 +#define __NR_shmdt 197 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_bind 200 +#define __NR_listen 201 +#define __NR_accept 202 +#define __NR_connect 203 +#define __NR_getsockname 204 +#define __NR_getpeername 205 +#define __NR_sendto 206 +#define __NR_recvfrom 207 +#define __NR_setsockopt 208 +#define __NR_getsockopt 209 +#define __NR_shutdown 210 +#define __NR_sendmsg 211 +#define __NR_recvmsg 212 +#define __NR_readahead 213 +#define __NR_brk 214 +#define __NR_munmap 215 +#define __NR_mremap 216 +#define __NR_add_key 217 +#define __NR_request_key 218 +#define __NR_keyctl 219 +#define __NR_clone 220 +#define __NR_execve 221 +#define __NR3264_mmap 222 +#define __NR3264_fadvise64 223 +#define __NR_swapon 224 +#define __NR_swapoff 225 +#define __NR_mprotect 226 +#define __NR_msync 227 +#define __NR_mlock 228 +#define __NR_munlock 229 +#define __NR_mlockall 230 +#define __NR_munlockall 231 +#define __NR_mincore 232 +#define __NR_madvise 233 +#define __NR_remap_file_pages 234 +#define __NR_mbind 235 +#define __NR_get_mempolicy 236 +#define __NR_set_mempolicy 237 +#define __NR_migrate_pages 238 +#define __NR_move_pages 239 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_perf_event_open 241 +#define __NR_accept4 242 +#define __NR_recvmmsg 243 +#define __NR_arch_specific_syscall 244 +#define __NR_wait4 260 +#define __NR_prlimit64 261 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_name_to_handle_at 264 +#define __NR_open_by_handle_at 265 +#define __NR_clock_adjtime 266 +#define __NR_syncfs 267 +#define __NR_setns 268 +#define __NR_sendmmsg 269 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_kcmp 272 +#define __NR_finit_module 273 +#define __NR_sched_setattr 274 +#define __NR_sched_getattr 275 +#define __NR_renameat2 276 +#define __NR_seccomp 277 +#define __NR_getrandom 278 +#define __NR_memfd_create 279 +#define __NR_bpf 280 +#define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 +#define __NR_mlock2 284 +#define __NR_copy_file_range 285 +#define __NR_preadv2 286 +#define __NR_pwritev2 287 +#define __NR_pkey_mprotect 288 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_statx 291 +#define __NR_io_pgetevents 292 +#define __NR_rseq 293 +#define __NR_kexec_file_load 294 +#define __NR_pidfd_send_signal 424 +#define __NR_io_uring_setup 425 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_open_tree 428 +#define __NR_move_mount 429 +#define __NR_fsopen 430 +#define __NR_fsconfig 431 +#define __NR_fsmount 432 +#define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 +#define __NR_close_range 436 +#define __NR_openat2 437 +#define __NR_pidfd_getfd 438 +#define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_quotactl_fd 443 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 +#define __NR_process_mrelease 448 +#define __NR_futex_waitv 449 +#define __NR_set_mempolicy_home_node 450 +#define __NR_cachestat 451 +#define __NR_fchmodat2 452 +#define __NR_map_shadow_stack 453 +#define __NR_futex_wake 454 +#define __NR_futex_wait 455 +#define __NR_futex_requeue 456 +#define __NR_fcntl __NR3264_fcntl +#define __NR_statfs __NR3264_statfs +#define __NR_fstatfs __NR3264_fstatfs +#define __NR_truncate __NR3264_truncate +#define __NR_ftruncate __NR3264_ftruncate +#define __NR_lseek __NR3264_lseek +#define __NR_sendfile __NR3264_sendfile +#define __NR_mmap __NR3264_mmap +#define __NR_fadvise64 __NR3264_fadvise64 diff --git a/pwnlib/data/includes/generator/linux/loongarch64.h b/pwnlib/data/includes/generator/linux/loongarch64.h new file mode 100644 index 0000000000..e252eeb127 --- /dev/null +++ b/pwnlib/data/includes/generator/linux/loongarch64.h @@ -0,0 +1,4 @@ +// https://git.musl-libc.org/cgit/musl/plain/arch/loongarch64/bits/syscall.h.in +#define __loongarch64 +#include +#include diff --git a/pwnlib/data/includes/generator/linux/syscall_map.h b/pwnlib/data/includes/generator/linux/syscall_map.h index ec8bd658f4..cd0276f3c3 100644 --- a/pwnlib/data/includes/generator/linux/syscall_map.h +++ b/pwnlib/data/includes/generator/linux/syscall_map.h @@ -23,6 +23,7 @@ #define SYS_brk __NR_brk #define SYS_cachectl __NR_cachectl #define SYS_cacheflush __NR_cacheflush +#define SYS_cachestat __NR_cachestat #define SYS_capget __NR_capget #define SYS_capset __NR_capset #define SYS_chdir __NR_chdir @@ -80,6 +81,7 @@ #define SYS_fchdir __NR_fchdir #define SYS_fchmod __NR_fchmod #define SYS_fchmodat __NR_fchmodat +#define SYS_fchmodat2 __NR_fchmodat2 #define SYS_fchown __NR_fchown #define SYS_fchown32 __NR_fchown32 #define SYS_fchownat __NR_fchownat @@ -109,7 +111,11 @@ #define SYS_ftruncate __NR_ftruncate #define SYS_ftruncate64 __NR_ftruncate64 #define SYS_futex __NR_futex +#define SYS_futex_requeue __NR_futex_requeue #define SYS_futex_time64 __NR_futex_time64 +#define SYS_futex_wait __NR_futex_wait +#define SYS_futex_waitv __NR_futex_waitv +#define SYS_futex_wake __NR_futex_wake #define SYS_futimesat __NR_futimesat #define SYS_getcpu __NR_getcpu #define SYS_getcwd __NR_getcwd @@ -217,6 +223,7 @@ #define SYS_lstat64 __NR_lstat64 #define SYS_madvise __NR_madvise #define SYS_madvise1 __NR_madvise1 +#define SYS_map_shadow_stack __NR_map_shadow_stack #define SYS_mbind __NR_mbind #define SYS_membarrier __NR_membarrier #define SYS_memfd_create __NR_memfd_create @@ -410,6 +417,7 @@ #define SYS_preadv2 __NR_preadv2 #define SYS_prlimit64 __NR_prlimit64 #define SYS_process_madvise __NR_process_madvise +#define SYS_process_mrelease __NR_process_mrelease #define SYS_process_vm_readv __NR_process_vm_readv #define SYS_process_vm_writev __NR_process_vm_writev #define SYS_prof __NR_prof @@ -425,6 +433,7 @@ #define SYS_pwritev2 __NR_pwritev2 #define SYS_query_module __NR_query_module #define SYS_quotactl __NR_quotactl +#define SYS_quotactl_fd __NR_quotactl_fd #define SYS_read __NR_read #define SYS_readahead __NR_readahead #define SYS_readdir __NR_readdir @@ -506,6 +515,7 @@ #define SYS_sethostname __NR_sethostname #define SYS_setitimer __NR_setitimer #define SYS_set_mempolicy __NR_set_mempolicy +#define SYS_set_mempolicy_home_node __NR_set_mempolicy_home_node #define SYS_setns __NR_setns #define SYS_setpgid __NR_setpgid #define SYS_setpgrp __NR_setpgrp diff --git a/pwnlib/data/includes/linux/loongarch64.h b/pwnlib/data/includes/linux/loongarch64.h new file mode 100644 index 0000000000..c4aef8a959 --- /dev/null +++ b/pwnlib/data/includes/linux/loongarch64.h @@ -0,0 +1,1322 @@ +#define __NR_io_setup 0 +#define __NR_io_destroy 1 +#define __NR_io_submit 2 +#define __NR_io_cancel 3 +#define __NR_io_getevents 4 +#define __NR_setxattr 5 +#define __NR_lsetxattr 6 +#define __NR_fsetxattr 7 +#define __NR_getxattr 8 +#define __NR_lgetxattr 9 +#define __NR_fgetxattr 10 +#define __NR_listxattr 11 +#define __NR_llistxattr 12 +#define __NR_flistxattr 13 +#define __NR_removexattr 14 +#define __NR_lremovexattr 15 +#define __NR_fremovexattr 16 +#define __NR_getcwd 17 +#define __NR_lookup_dcookie 18 +#define __NR_eventfd2 19 +#define __NR_epoll_create1 20 +#define __NR_epoll_ctl 21 +#define __NR_epoll_pwait 22 +#define __NR_dup 23 +#define __NR_dup3 24 +#define __NR3264_fcntl 25 +#define __NR_inotify_init1 26 +#define __NR_inotify_add_watch 27 +#define __NR_inotify_rm_watch 28 +#define __NR_ioctl 29 +#define __NR_ioprio_set 30 +#define __NR_ioprio_get 31 +#define __NR_flock 32 +#define __NR_mknodat 33 +#define __NR_mkdirat 34 +#define __NR_unlinkat 35 +#define __NR_symlinkat 36 +#define __NR_linkat 37 +#define __NR_umount2 39 +#define __NR_mount 40 +#define __NR_pivot_root 41 +#define __NR_nfsservctl 42 +#define __NR3264_statfs 43 +#define __NR3264_fstatfs 44 +#define __NR3264_truncate 45 +#define __NR3264_ftruncate 46 +#define __NR_fallocate 47 +#define __NR_faccessat 48 +#define __NR_chdir 49 +#define __NR_fchdir 50 +#define __NR_chroot 51 +#define __NR_fchmod 52 +#define __NR_fchmodat 53 +#define __NR_fchownat 54 +#define __NR_fchown 55 +#define __NR_openat 56 +#define __NR_close 57 +#define __NR_vhangup 58 +#define __NR_pipe2 59 +#define __NR_quotactl 60 +#define __NR_getdents64 61 +#define __NR3264_lseek 62 +#define __NR_read 63 +#define __NR_write 64 +#define __NR_readv 65 +#define __NR_writev 66 +#define __NR_pread64 67 +#define __NR_pwrite64 68 +#define __NR_preadv 69 +#define __NR_pwritev 70 +#define __NR3264_sendfile 71 +#define __NR_pselect6 72 +#define __NR_ppoll 73 +#define __NR_signalfd4 74 +#define __NR_vmsplice 75 +#define __NR_splice 76 +#define __NR_tee 77 +#define __NR_readlinkat 78 +#define __NR_sync 81 +#define __NR_fsync 82 +#define __NR_fdatasync 83 +#define __NR_sync_file_range 84 +#define __NR_timerfd_create 85 +#define __NR_timerfd_settime 86 +#define __NR_timerfd_gettime 87 +#define __NR_utimensat 88 +#define __NR_acct 89 +#define __NR_capget 90 +#define __NR_capset 91 +#define __NR_personality 92 +#define __NR_exit 93 +#define __NR_exit_group 94 +#define __NR_waitid 95 +#define __NR_set_tid_address 96 +#define __NR_unshare 97 +#define __NR_futex 98 +#define __NR_set_robust_list 99 +#define __NR_get_robust_list 100 +#define __NR_nanosleep 101 +#define __NR_getitimer 102 +#define __NR_setitimer 103 +#define __NR_kexec_load 104 +#define __NR_init_module 105 +#define __NR_delete_module 106 +#define __NR_timer_create 107 +#define __NR_timer_gettime 108 +#define __NR_timer_getoverrun 109 +#define __NR_timer_settime 110 +#define __NR_timer_delete 111 +#define __NR_clock_settime 112 +#define __NR_clock_gettime 113 +#define __NR_clock_getres 114 +#define __NR_clock_nanosleep 115 +#define __NR_syslog 116 +#define __NR_ptrace 117 +#define __NR_sched_setparam 118 +#define __NR_sched_setscheduler 119 +#define __NR_sched_getscheduler 120 +#define __NR_sched_getparam 121 +#define __NR_sched_setaffinity 122 +#define __NR_sched_getaffinity 123 +#define __NR_sched_yield 124 +#define __NR_sched_get_priority_max 125 +#define __NR_sched_get_priority_min 126 +#define __NR_sched_rr_get_interval 127 +#define __NR_restart_syscall 128 +#define __NR_kill 129 +#define __NR_tkill 130 +#define __NR_tgkill 131 +#define __NR_sigaltstack 132 +#define __NR_rt_sigsuspend 133 +#define __NR_rt_sigaction 134 +#define __NR_rt_sigprocmask 135 +#define __NR_rt_sigpending 136 +#define __NR_rt_sigtimedwait 137 +#define __NR_rt_sigqueueinfo 138 +#define __NR_rt_sigreturn 139 +#define __NR_setpriority 140 +#define __NR_getpriority 141 +#define __NR_reboot 142 +#define __NR_setregid 143 +#define __NR_setgid 144 +#define __NR_setreuid 145 +#define __NR_setuid 146 +#define __NR_setresuid 147 +#define __NR_getresuid 148 +#define __NR_setresgid 149 +#define __NR_getresgid 150 +#define __NR_setfsuid 151 +#define __NR_setfsgid 152 +#define __NR_times 153 +#define __NR_setpgid 154 +#define __NR_getpgid 155 +#define __NR_getsid 156 +#define __NR_setsid 157 +#define __NR_getgroups 158 +#define __NR_setgroups 159 +#define __NR_uname 160 +#define __NR_sethostname 161 +#define __NR_setdomainname 162 +#define __NR_getrusage 165 +#define __NR_umask 166 +#define __NR_prctl 167 +#define __NR_getcpu 168 +#define __NR_gettimeofday 169 +#define __NR_settimeofday 170 +#define __NR_adjtimex 171 +#define __NR_getpid 172 +#define __NR_getppid 173 +#define __NR_getuid 174 +#define __NR_geteuid 175 +#define __NR_getgid 176 +#define __NR_getegid 177 +#define __NR_gettid 178 +#define __NR_sysinfo 179 +#define __NR_mq_open 180 +#define __NR_mq_unlink 181 +#define __NR_mq_timedsend 182 +#define __NR_mq_timedreceive 183 +#define __NR_mq_notify 184 +#define __NR_mq_getsetattr 185 +#define __NR_msgget 186 +#define __NR_msgctl 187 +#define __NR_msgrcv 188 +#define __NR_msgsnd 189 +#define __NR_semget 190 +#define __NR_semctl 191 +#define __NR_semtimedop 192 +#define __NR_semop 193 +#define __NR_shmget 194 +#define __NR_shmctl 195 +#define __NR_shmat 196 +#define __NR_shmdt 197 +#define __NR_socket 198 +#define __NR_socketpair 199 +#define __NR_bind 200 +#define __NR_listen 201 +#define __NR_accept 202 +#define __NR_connect 203 +#define __NR_getsockname 204 +#define __NR_getpeername 205 +#define __NR_sendto 206 +#define __NR_recvfrom 207 +#define __NR_setsockopt 208 +#define __NR_getsockopt 209 +#define __NR_shutdown 210 +#define __NR_sendmsg 211 +#define __NR_recvmsg 212 +#define __NR_readahead 213 +#define __NR_brk 214 +#define __NR_munmap 215 +#define __NR_mremap 216 +#define __NR_add_key 217 +#define __NR_request_key 218 +#define __NR_keyctl 219 +#define __NR_clone 220 +#define __NR_execve 221 +#define __NR3264_mmap 222 +#define __NR3264_fadvise64 223 +#define __NR_swapon 224 +#define __NR_swapoff 225 +#define __NR_mprotect 226 +#define __NR_msync 227 +#define __NR_mlock 228 +#define __NR_munlock 229 +#define __NR_mlockall 230 +#define __NR_munlockall 231 +#define __NR_mincore 232 +#define __NR_madvise 233 +#define __NR_remap_file_pages 234 +#define __NR_mbind 235 +#define __NR_get_mempolicy 236 +#define __NR_set_mempolicy 237 +#define __NR_migrate_pages 238 +#define __NR_move_pages 239 +#define __NR_rt_tgsigqueueinfo 240 +#define __NR_perf_event_open 241 +#define __NR_accept4 242 +#define __NR_recvmmsg 243 +#define __NR_arch_specific_syscall 244 +#define __NR_wait4 260 +#define __NR_prlimit64 261 +#define __NR_fanotify_init 262 +#define __NR_fanotify_mark 263 +#define __NR_name_to_handle_at 264 +#define __NR_open_by_handle_at 265 +#define __NR_clock_adjtime 266 +#define __NR_syncfs 267 +#define __NR_setns 268 +#define __NR_sendmmsg 269 +#define __NR_process_vm_readv 270 +#define __NR_process_vm_writev 271 +#define __NR_kcmp 272 +#define __NR_finit_module 273 +#define __NR_sched_setattr 274 +#define __NR_sched_getattr 275 +#define __NR_renameat2 276 +#define __NR_seccomp 277 +#define __NR_getrandom 278 +#define __NR_memfd_create 279 +#define __NR_bpf 280 +#define __NR_execveat 281 +#define __NR_userfaultfd 282 +#define __NR_membarrier 283 +#define __NR_mlock2 284 +#define __NR_copy_file_range 285 +#define __NR_preadv2 286 +#define __NR_pwritev2 287 +#define __NR_pkey_mprotect 288 +#define __NR_pkey_alloc 289 +#define __NR_pkey_free 290 +#define __NR_statx 291 +#define __NR_io_pgetevents 292 +#define __NR_rseq 293 +#define __NR_kexec_file_load 294 +#define __NR_pidfd_send_signal 424 +#define __NR_io_uring_setup 425 +#define __NR_io_uring_enter 426 +#define __NR_io_uring_register 427 +#define __NR_open_tree 428 +#define __NR_move_mount 429 +#define __NR_fsopen 430 +#define __NR_fsconfig 431 +#define __NR_fsmount 432 +#define __NR_fspick 433 +#define __NR_pidfd_open 434 +#define __NR_clone3 435 +#define __NR_close_range 436 +#define __NR_openat2 437 +#define __NR_pidfd_getfd 438 +#define __NR_faccessat2 439 +#define __NR_process_madvise 440 +#define __NR_epoll_pwait2 441 +#define __NR_mount_setattr 442 +#define __NR_quotactl_fd 443 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 +#define __NR_process_mrelease 448 +#define __NR_futex_waitv 449 +#define __NR_set_mempolicy_home_node 450 +#define __NR_cachestat 451 +#define __NR_fchmodat2 452 +#define __NR_map_shadow_stack 453 +#define __NR_futex_wake 454 +#define __NR_futex_wait 455 +#define __NR_futex_requeue 456 +#define __NR_fcntl 25 +#define __NR_statfs 43 +#define __NR_fstatfs 44 +#define __NR_truncate 45 +#define __NR_ftruncate 46 +#define __NR_lseek 62 +#define __NR_sendfile 71 +#define __NR_mmap 222 +#define __NR_fadvise64 223 +#define MAP_32BIT 0x40 +#define INADDR_ANY 0 +#define INADDR_BROADCAST 0xffffffff +#define INADDR_NONE 0xffffffff +#define INADDR_LOOPBACK 0x7f000001 +#define EPERM 1 +#define ENOENT 2 +#define ESRCH 3 +#define EINTR 4 +#define EIO 5 +#define ENXIO 6 +#define E2BIG 7 +#define ENOEXEC 8 +#define EBADF 9 +#define ECHILD 10 +#define EAGAIN 11 +#define ENOMEM 12 +#define EACCES 13 +#define EFAULT 14 +#define ENOTBLK 15 +#define EBUSY 16 +#define EEXIST 17 +#define EXDEV 18 +#define ENODEV 19 +#define ENOTDIR 20 +#define EISDIR 21 +#define EINVAL 22 +#define ENFILE 23 +#define EMFILE 24 +#define ENOTTY 25 +#define ETXTBSY 26 +#define EFBIG 27 +#define ENOSPC 28 +#define ESPIPE 29 +#define EROFS 30 +#define EMLINK 31 +#define EPIPE 32 +#define EDOM 33 +#define ERANGE 34 +#define EDEADLK 35 +#define ENAMETOOLONG 36 +#define ENOLCK 37 +#define ENOSYS 38 +#define ENOTEMPTY 39 +#define ELOOP 40 +#define EWOULDBLOCK 11 +#define ENOMSG 42 +#define EIDRM 43 +#define ECHRNG 44 +#define EL2NSYNC 45 +#define EL3HLT 46 +#define EL3RST 47 +#define ELNRNG 48 +#define EUNATCH 49 +#define ENOCSI 50 +#define EL2HLT 51 +#define EBADE 52 +#define EBADR 53 +#define EXFULL 54 +#define ENOANO 55 +#define EBADRQC 56 +#define EBADSLT 57 +#define EDEADLOCK 35 +#define EBFONT 59 +#define ENOSTR 60 +#define ENODATA 61 +#define ETIME 62 +#define ENOSR 63 +#define ENONET 64 +#define ENOPKG 65 +#define EREMOTE 66 +#define ENOLINK 67 +#define EADV 68 +#define ESRMNT 69 +#define ECOMM 70 +#define EPROTO 71 +#define EMULTIHOP 72 +#define EDOTDOT 73 +#define EBADMSG 74 +#define EOVERFLOW 75 +#define ENOTUNIQ 76 +#define EBADFD 77 +#define EREMCHG 78 +#define ELIBACC 79 +#define ELIBBAD 80 +#define ELIBSCN 81 +#define ELIBMAX 82 +#define ELIBEXEC 83 +#define EILSEQ 84 +#define ERESTART 85 +#define ESTRPIPE 86 +#define EUSERS 87 +#define ENOTSOCK 88 +#define EDESTADDRREQ 89 +#define EMSGSIZE 90 +#define EPROTOTYPE 91 +#define ENOPROTOOPT 92 +#define EPROTONOSUPPORT 93 +#define ESOCKTNOSUPPORT 94 +#define EOPNOTSUPP 95 +#define ENOTSUP 95 +#define EPFNOSUPPORT 96 +#define EAFNOSUPPORT 97 +#define EADDRINUSE 98 +#define EADDRNOTAVAIL 99 +#define ENETDOWN 100 +#define ENETUNREACH 101 +#define ENETRESET 102 +#define ECONNABORTED 103 +#define ECONNRESET 104 +#define ENOBUFS 105 +#define EISCONN 106 +#define ENOTCONN 107 +#define ESHUTDOWN 108 +#define ETOOMANYREFS 109 +#define ETIMEDOUT 110 +#define ECONNREFUSED 111 +#define EHOSTDOWN 112 +#define EHOSTUNREACH 113 +#define EALREADY 114 +#define EINPROGRESS 115 +#define ESTALE 116 +#define EUCLEAN 117 +#define ENOTNAM 118 +#define ENAVAIL 119 +#define EISNAM 120 +#define EREMOTEIO 121 +#define EDQUOT 122 +#define ENOMEDIUM 123 +#define EMEDIUMTYPE 124 +#define ECANCELED 125 +#define ENOKEY 126 +#define EKEYEXPIRED 127 +#define EKEYREVOKED 128 +#define EKEYREJECTED 129 +#define EOWNERDEAD 130 +#define ENOTRECOVERABLE 131 +#define ERFKILL 132 +#define EHWPOISON 133 +#define __SYS_NERR ((133) + 1) +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __BYTE_ORDER 4321 +#define __FLOAT_WORD_ORDER 4321 +#define LITTLE_ENDIAN 1234 +#define BIG_ENDIAN 4321 +#define BYTE_ORDER 4321 +#define __WORDSIZE 32 +#define INT8_MAX (127) +#define INT16_MAX (32767) +#define INT32_MAX (2147483647) +#define INT64_MAX (9223372036854775807) +#define INT8_MIN (-1 - (127)) +#define INT16_MIN (-1 - (32767)) +#define INT32_MIN (-1 - (2147483647)) +#define INT64_MIN (-1 - (9223372036854775807)) +#define INT_LEAST8_MAX (127) +#define INT_LEAST8_MIN (-1 - (127)) +#define INT_LEAST16_MAX (32767) +#define INT_LEAST16_MIN (-1 - (32767)) +#define INT_LEAST32_MAX (2147483647) +#define INT_LEAST32_MIN (-1 - (2147483647)) +#define INT_LEAST64_MAX (9223372036854775807) +#define INT_LEAST64_MIN (-1 - (9223372036854775807)) +#define UINT8_MAX 0xff +#define UINT16_MAX 0xffff +#define UINT32_MAX 0xffffffff +#define UINT64_MAX 0xffffffffffffffff +#define UINT_LEAST8_MAX 0xff +#define UINT_LEAST16_MAX 0xffff +#define UINT_LEAST32_MAX 0xffffffff +#define UINT_LEAST64_MAX 0xffffffffffffffff +#define INTPTR_MIN (-1 - (2147483647)) +#define INTPTR_MAX (2147483647) +#define UINTPTR_MAX 0xffffffff +#define SIZE_MAX 0xffffffff +#define PTRDIFF_MIN (-1 - (2147483647)) +#define PTRDIFF_MAX (2147483647) +#define INTMAX_MIN (-1 - (9223372036854775807)) +#define INTMAX_MAX (9223372036854775807) +#define UINTMAX_MAX 0xffffffffffffffff +#define INT_FAST8_MIN (-1 - (127)) +#define INT_FAST8_MAX (127) +#define INT_FAST64_MIN (-1 - (9223372036854775807)) +#define INT_FAST64_MAX (9223372036854775807) +#define UINT_FAST8_MAX 0xff +#define UINT_FAST64_MAX 0xffffffffffffffff +#define INT_FAST16_MIN (-1 - (2147483647)) +#define INT_FAST16_MAX (2147483647) +#define UINT_FAST16_MAX 0xffffffff +#define INT_FAST32_MIN (-1 - (2147483647)) +#define INT_FAST32_MAX (2147483647) +#define UINT_FAST32_MAX 0xffffffff +#define WINT_MIN 0 +#define __FSUID_H 1 +#define NSIG 32 +#define _NSIG 65 +#define SIGHUP 1 +#define SIGINT 2 +#define SIGQUIT 3 +#define SIGILL 4 +#define SIGTRAP 5 +#define SIGABRT 6 +#define SIGIOT 6 +#define SIGFPE 8 +#define SIGKILL 9 +#define SIGSEGV 11 +#define SIGPIPE 13 +#define SIGALRM 14 +#define SIGTERM 15 +#define SIGUNUSED 31 +#define SIGRTMIN 32 +#define SIGRTMAX (65-1) +#define SA_NOCLDSTOP 0x00000001 +#define SA_NOCLDWAIT 0x00000002 +#define SA_SIGINFO 0x00000004 +#define SA_RESTORER 0x04000000 +#define SA_ONSTACK 0x08000000 +#define SA_RESTART 0x10000000 +#define SA_INTERRUPT 0x20000000 +#define SA_NODEFER 0x40000000 +#define SA_RESETHAND 0x80000000 +#define SA_NOMASK 0x40000000 +#define SA_ONESHOT 0x80000000 +#define SS_ONSTACK 1 +#define SS_DISABLE 2 +#define MINSIGSTKSZ 2048 +#define SIGSTKSZ 8192 +#define SIG_BLOCK 0 +#define SIG_UNBLOCK 1 +#define SIG_SETMASK 2 +#define SI_MAX_SIZE 128 +#define SIGEV_SIGNAL 0 +#define SIGEV_NONE 1 +#define SIGEV_THREAD 2 +#define SIGEV_THREAD_ID 4 +#define SIGEV_MAX_SIZE 64 +#define _SYS_TIME_H 1 +#define ITIMER_REAL 0 +#define ITIMER_VIRTUAL 1 +#define ITIMER_PROF 2 +#define FD_SETSIZE 1024 +#define R_OK 4 +#define W_OK 2 +#define X_OK 1 +#define F_OK 0 +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 +#define _CS_PATH 1 +#define _SC_CLK_TCK 1 +#define _SC_ARG_MAX 2 +#define _SC_NGROUPS_MAX 3 +#define _SC_OPEN_MAX 4 +#define _SC_PAGESIZE 5 +#define _SC_NPROCESSORS_ONLN 6 +#define _SC_NPROCESSORS_CONF 6 +#define _SC_PHYS_PAGES 7 +#define _SC_GETPW_R_SIZE_MAX 8 +#define _SC_GETGR_R_SIZE_MAX 9 +#define _PC_PATH_MAX 1 +#define _PC_VDISABLE 2 +#define L_cuserid 17 +#define _POSIX_VERSION 199506 +#define F_ULOCK 0 +#define F_LOCK 1 +#define F_TLOCK 2 +#define F_TEST 3 +#define _POSIX_MAPPED_FILES 200809 +#define S_IFMT 0xf000 +#define S_IFSOCK 0xc000 +#define S_IFLNK 0xa000 +#define S_IFREG 0x8000 +#define S_IFBLK 0x6000 +#define S_IFDIR 0x4000 +#define S_IFCHR 0x2000 +#define S_IFIFO 0x1000 +#define S_ISUID 0x800 +#define S_ISGID 0x400 +#define S_ISVTX 0x200 +#define S_IRWXU 0x1c0 +#define S_IRUSR 0x100 +#define S_IWUSR 0x80 +#define S_IXUSR 0x40 +#define S_IRWXG 0x38 +#define S_IRGRP 0x20 +#define S_IWGRP 0x10 +#define S_IXGRP 0x8 +#define S_IRWXO 0x7 +#define S_IROTH 0x4 +#define S_IWOTH 0x2 +#define S_IXOTH 0x1 +#define S_IREAD 0x100 +#define S_IWRITE 0x80 +#define S_IEXEC 0x40 +#define _SYS_UIO 1 +#define SOL_SOCKET 1 +#define SO_DEBUG 1 +#define SO_REUSEADDR 2 +#define SO_TYPE 3 +#define SO_ERROR 4 +#define SO_DONTROUTE 5 +#define SO_BROADCAST 6 +#define SO_SNDBUF 7 +#define SO_RCVBUF 8 +#define SO_KEEPALIVE 9 +#define SO_OOBINLINE 10 +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_LINGER 13 +#define SO_BSDCOMPAT 14 +#define SO_REUSEPORT 15 +#define SO_PASSCRED 16 +#define SO_PEERCRED 17 +#define SO_RCVLOWAT 18 +#define SO_SNDLOWAT 19 +#define SO_RCVTIMEO 20 +#define SO_SNDTIMEO 21 +#define SO_SECURITY_AUTHENTICATION 22 +#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define SO_SECURITY_ENCRYPTION_NETWORK 24 +#define SO_BINDTODEVICE 25 +#define SO_ATTACH_FILTER 26 +#define SO_DETACH_FILTER 27 +#define SO_GET_FILTER 26 +#define SO_PEERNAME 28 +#define SO_TIMESTAMP 29 +#define SCM_TIMESTAMP 29 +#define SO_ACCEPTCONN 30 +#define SO_PEERSEC 31 +#define SO_SNDBUFFORCE 32 +#define SO_RCVBUFFORCE 33 +#define SO_PASSSEC 34 +#define SO_TIMESTAMPNS 35 +#define SCM_TIMESTAMPNS 35 +#define SO_MARK 36 +#define SO_TIMESTAMPING 37 +#define SCM_TIMESTAMPING 37 +#define SO_PROTOCOL 38 +#define SO_DOMAIN 39 +#define SO_RXQ_OVFL 40 +#define SO_WIFI_STATUS 41 +#define SCM_WIFI_STATUS 41 +#define SO_PEEK_OFF 42 +#define SO_NOFCS 43 +#define SO_LOCK_FILTER 44 +#define SO_SELECT_ERR_QUEUE 45 +#define SO_BUSY_POLL 46 +#define SO_MAX_PACING_RATE 47 +#define SO_BPF_EXTENSIONS 48 +#define SO_INCOMING_CPU 49 +#define SO_ATTACH_BPF 50 +#define SO_DETACH_BPF 27 +#define SO_ATTACH_REUSEPORT_CBPF 51 +#define SO_ATTACH_REUSEPORT_EBPF 52 +#define SO_CNX_ADVICE 53 +#define SCM_TIMESTAMPING_OPT_STATS 54 +#define SO_MEMINFO 55 +#define SO_INCOMING_NAPI_ID 56 +#define SO_COOKIE 57 +#define SCM_TIMESTAMPING_PKTINFO 58 +#define SO_PEERGROUPS 59 +#define SO_ZEROCOPY 60 +#define SOCK_STREAM 1 +#define SOCK_DGRAM 2 +#define SOCK_RAW 3 +#define SOCK_RDM 4 +#define SOCK_SEQPACKET 5 +#define SOCK_DCCP 6 +#define SOCK_PACKET 10 +#define UIO_FASTIOV 8 +#define UIO_MAXIOV 1024 +#define SCM_RIGHTS 0x01 +#define SCM_CREDENTIALS 0x02 +#define SCM_CONNECT 0x03 +#define AF_UNSPEC 0 +#define AF_UNIX 1 +#define AF_LOCAL 1 +#define AF_INET 2 +#define AF_AX25 3 +#define AF_IPX 4 +#define AF_APPLETALK 5 +#define AF_NETROM 6 +#define AF_BRIDGE 7 +#define AF_ATMPVC 8 +#define AF_X25 9 +#define AF_INET6 10 +#define AF_ROSE 11 +#define AF_DECnet 12 +#define AF_NETBEUI 13 +#define AF_SECURITY 14 +#define AF_KEY 15 +#define AF_NETLINK 16 +#define AF_ROUTE 16 +#define AF_PACKET 17 +#define AF_ASH 18 +#define AF_ECONET 19 +#define AF_ATMSVC 20 +#define AF_SNA 22 +#define AF_IRDA 23 +#define AF_PPPOX 24 +#define AF_WANPIPE 25 +#define AF_LLC 26 +#define AF_IB 27 +#define AF_MPLS 28 +#define AF_CAN 29 +#define AF_TIPC 30 +#define AF_BLUETOOTH 31 +#define AF_IUCV 32 +#define AF_RXRPC 33 +#define AF_ISDN 34 +#define AF_PHONET 35 +#define AF_IEEE802154 36 +#define AF_CAIF 37 +#define AF_ALG 38 +#define AF_NFC 39 +#define AF_VSOCK 40 +#define AF_KCM 41 +#define AF_QIPCRTR 42 +#define AF_SMC 43 +#define AF_MAX 44 +#define PF_UNSPEC 0 +#define PF_UNIX 1 +#define PF_LOCAL 1 +#define PF_INET 2 +#define PF_AX25 3 +#define PF_IPX 4 +#define PF_APPLETALK 5 +#define PF_NETROM 6 +#define PF_BRIDGE 7 +#define PF_ATMPVC 8 +#define PF_X25 9 +#define PF_INET6 10 +#define PF_ROSE 11 +#define PF_DECnet 12 +#define PF_NETBEUI 13 +#define PF_SECURITY 14 +#define PF_KEY 15 +#define PF_NETLINK 16 +#define PF_ROUTE 16 +#define PF_PACKET 17 +#define PF_ASH 18 +#define PF_ECONET 19 +#define PF_ATMSVC 20 +#define PF_SNA 22 +#define PF_IRDA 23 +#define PF_PPPOX 24 +#define PF_WANPIPE 25 +#define PF_LLC 26 +#define PF_IB 27 +#define PF_MPLS 28 +#define PF_CAN 29 +#define PF_TIPC 30 +#define PF_BLUETOOTH 31 +#define PF_IUCV 32 +#define PF_RXRPC 33 +#define PF_ISDN 34 +#define PF_PHONET 35 +#define PF_IEEE802154 36 +#define PF_CAIF 37 +#define PF_ALG 38 +#define PF_NFC 39 +#define PF_VSOCK 40 +#define PF_KCM 41 +#define PF_QIPCRTR 42 +#define PF_SMC 43 +#define PF_MAX 44 +#define SOMAXCONN 128 +#define MSG_OOB 1 +#define MSG_PEEK 2 +#define MSG_DONTROUTE 4 +#define MSG_TRYHARD 4 +#define MSG_CTRUNC 8 +#define MSG_PROBE 0x10 +#define MSG_TRUNC 0x20 +#define MSG_DONTWAIT 0x40 +#define MSG_EOR 0x80 +#define MSG_WAITALL 0x100 +#define MSG_FIN 0x200 +#define MSG_SYN 0x400 +#define MSG_CONFIRM 0x800 +#define MSG_RST 0x1000 +#define MSG_ERRQUEUE 0x2000 +#define MSG_NOSIGNAL 0x4000 +#define MSG_MORE 0x8000 +#define MSG_WAITFORONE 0x10000 +#define MSG_SENDPAGE_NOTLAST 0x20000 +#define MSG_BATCH 0x40000 +#define MSG_EOF 0x200 +#define MSG_ZEROCOPY 0x4000000 +#define MSG_FASTOPEN 0x20000000 +#define MSG_CMSG_CLOEXEC 0x40000000 +#define SOL_IP 0 +#define SOL_TCP 6 +#define SOL_UDP 17 +#define SOL_IPV6 41 +#define SOL_ICMPV6 58 +#define SOL_SCTP 132 +#define SOL_UDPLITE 136 +#define SOL_RAW 255 +#define SOL_IPX 256 +#define SOL_AX25 257 +#define SOL_ATALK 258 +#define SOL_NETROM 259 +#define SOL_ROSE 260 +#define SOL_DECNET 261 +#define SOL_X25 262 +#define SOL_PACKET 263 +#define SOL_ATM 264 +#define SOL_AAL 265 +#define SOL_IRDA 266 +#define SOL_NETBEUI 267 +#define SOL_LLC 268 +#define SOL_DCCP 269 +#define SOL_NETLINK 270 +#define SOL_TIPC 271 +#define SOL_RXRPC 272 +#define SOL_PPPOL2TP 273 +#define SOL_BLUETOOTH 274 +#define SOL_PNPIPE 275 +#define SOL_RDS 276 +#define SOL_IUCV 277 +#define SOL_CAIF 278 +#define SOL_ALG 279 +#define SOL_NFC 280 +#define SOL_KCM 281 +#define SOL_TLS 282 +#define IPX_TYPE 1 +#define SHUT_RD 0 +#define SHUT_WR 1 +#define SHUT_RDWR 2 +#define NI_NOFQDN 1 +#define NI_NUMERICHOST 2 +#define NI_NAMEREQD 4 +#define NI_NUMERICSERV 8 +#define NI_DGRAM 16 +#define EAI_FAMILY -1 +#define EAI_SOCKTYPE -2 +#define EAI_BADFLAGS -3 +#define EAI_NONAME -4 +#define EAI_SERVICE -5 +#define EAI_ADDRFAMILY -6 +#define EAI_NODATA -7 +#define EAI_MEMORY -8 +#define EAI_FAIL -9 +#define EAI_AGAIN -10 +#define EAI_SYSTEM -11 +#define AI_NUMERICHOST 1 +#define AI_CANONNAME 2 +#define AI_PASSIVE 4 +#define AI_NUMERICSERV 8 +#define AI_ADDRCONFIG 16 +#define AI_V4MAPPED 32 +#define AI_ALL 64 +#define SIOCADDRT 0x890B +#define SIOCDELRT 0x890C +#define SIOCRTMSG 0x890D +#define SIOCGIFNAME 0x8910 +#define SIOCSIFLINK 0x8911 +#define SIOCGIFCONF 0x8912 +#define SIOCGIFFLAGS 0x8913 +#define SIOCSIFFLAGS 0x8914 +#define SIOCGIFADDR 0x8915 +#define SIOCSIFADDR 0x8916 +#define SIOCGIFDSTADDR 0x8917 +#define SIOCSIFDSTADDR 0x8918 +#define SIOCGIFBRDADDR 0x8919 +#define SIOCSIFBRDADDR 0x891a +#define SIOCGIFNETMASK 0x891b +#define SIOCSIFNETMASK 0x891c +#define SIOCGIFMETRIC 0x891d +#define SIOCSIFMETRIC 0x891e +#define SIOCGIFMEM 0x891f +#define SIOCSIFMEM 0x8920 +#define SIOCGIFMTU 0x8921 +#define SIOCSIFMTU 0x8922 +#define SIOCSIFNAME 0x8923 +#define SIOCSIFHWADDR 0x8924 +#define SIOCGIFENCAP 0x8925 +#define SIOCSIFENCAP 0x8926 +#define SIOCGIFHWADDR 0x8927 +#define SIOCGIFSLAVE 0x8929 +#define SIOCSIFSLAVE 0x8930 +#define SIOCADDMULTI 0x8931 +#define SIOCDELMULTI 0x8932 +#define SIOCGIFINDEX 0x8933 +#define SIOGIFINDEX 0x8933 +#define SIOCSIFPFLAGS 0x8934 +#define SIOCGIFPFLAGS 0x8935 +#define SIOCDIFADDR 0x8936 +#define SIOCSIFHWBROADCAST 0x8937 +#define SIOCGIFCOUNT 0x8938 +#define SIOCGIFBR 0x8940 +#define SIOCSIFBR 0x8941 +#define SIOCGIFTXQLEN 0x8942 +#define SIOCSIFTXQLEN 0x8943 +#define SIOCGIFDIVERT 0x8944 +#define SIOCSIFDIVERT 0x8945 +#define SIOCETHTOOL 0x8946 +#define SIOCDARP 0x8953 +#define SIOCGARP 0x8954 +#define SIOCSARP 0x8955 +#define SIOCDRARP 0x8960 +#define SIOCGRARP 0x8961 +#define SIOCSRARP 0x8962 +#define SIOCGIFMAP 0x8970 +#define SIOCSIFMAP 0x8971 +#define SIOCADDDLCI 0x8980 +#define SIOCDELDLCI 0x8981 +#define SIOCDEVPRIVATE 0x89F0 +#define F_LINUX_SPECIFIC_BASE 1024 +#define F_SETOWN_EX 15 +#define F_GETOWN_EX 16 +#define F_GETOWNER_UIDS 17 +#define F_OFD_GETLK 36 +#define F_OFD_SETLK 37 +#define F_OFD_SETLKW 38 +#define F_OWNER_TID 0 +#define F_OWNER_PID 1 +#define F_OWNER_PGRP 2 +#define AT_FDCWD -100 +#define AT_SYMLINK_NOFOLLOW 0x100 +#define AT_REMOVEDIR 0x200 +#define AT_SYMLINK_FOLLOW 0x400 +#define AT_NO_AUTOMOUNT 0x800 +#define AT_EMPTY_PATH 0x1000 +#define AT_EACCESS 0x200 +#define MREMAP_MAYMOVE 1 +#define MREMAP_FIXED 2 +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +#define PROT_EXEC 0x4 +#define PROT_SEM 0x8 +#define PROT_NONE 0x0 +#define PROT_GROWSDOWN 0x01000000 +#define PROT_GROWSUP 0x02000000 +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_TYPE 0xf +#define MADV_REMOVE 9 +#define MADV_DONTFORK 10 +#define MADV_DOFORK 11 +#define MADV_MERGEABLE 12 +#define MADV_UNMERGEABLE 13 +#define MADV_HUGEPAGE 14 +#define MADV_NOHUGEPAGE 15 +#define MADV_DONTDUMP 16 +#define MADV_DODUMP 17 +#define MADV_HWPOISON 100 +#define MADV_SOFT_OFFLINE 101 +#define MLOCK_ONFAULT 1 +#define MAP_FILE 0 +#define PTRACE_TRACEME 0 +#define PTRACE_PEEKTEXT 1 +#define PTRACE_PEEKDATA 2 +#define PTRACE_PEEKUSR 3 +#define PTRACE_PEEKUSER 3 +#define PTRACE_POKETEXT 4 +#define PTRACE_POKEDATA 5 +#define PTRACE_POKEUSR 6 +#define PTRACE_POKEUSER 6 +#define PTRACE_CONT 7 +#define PTRACE_KILL 8 +#define PTRACE_SINGLESTEP 9 +#define PTRACE_ATTACH 0x10 +#define PTRACE_DETACH 0x11 +#define PTRACE_SYSCALL 24 +#define PTRACE_GETEVENTMSG 0x4201 +#define PTRACE_GETSIGINFO 0x4202 +#define PTRACE_SETSIGINFO 0x4203 +#define PTRACE_O_TRACESYSGOOD 0x00000001 +#define PTRACE_O_TRACEFORK 0x00000002 +#define PTRACE_O_TRACEVFORK 0x00000004 +#define PTRACE_O_TRACECLONE 0x00000008 +#define PTRACE_O_TRACEEXEC 0x00000010 +#define PTRACE_O_TRACEVFORKDONE 0x00000020 +#define PTRACE_O_TRACEEXIT 0x00000040 +#define PTRACE_O_MASK 0x0000007f +#define PTRACE_EVENT_FORK 1 +#define PTRACE_EVENT_VFORK 2 +#define PTRACE_EVENT_CLONE 3 +#define PTRACE_EVENT_EXEC 4 +#define PTRACE_EVENT_VFORK_DONE 5 +#define PTRACE_EVENT_EXIT 6 +#define PT_TRACE_ME 0 +#define PT_READ_I 1 +#define PT_READ_D 2 +#define PT_READ_U 3 +#define PT_WRITE_I 4 +#define PT_WRITE_D 5 +#define PT_WRITE_U 6 +#define PT_CONTINUE 7 +#define PT_KILL 8 +#define PT_STEP 9 +#define PT_ATTACH 0x10 +#define PT_DETACH 0x11 +#define SYS_accept 202 +#define SYS_accept4 242 +#define SYS_acct 89 +#define SYS_add_key 217 +#define SYS_adjtimex 171 +#define SYS_arch_specific_syscall 244 +#define SYS_bind 200 +#define SYS_bpf 280 +#define SYS_brk 214 +#define SYS_cachestat 451 +#define SYS_capget 90 +#define SYS_capset 91 +#define SYS_chdir 49 +#define SYS_chroot 51 +#define SYS_clock_adjtime 266 +#define SYS_clock_getres 114 +#define SYS_clock_gettime 113 +#define SYS_clock_nanosleep 115 +#define SYS_clock_settime 112 +#define SYS_clone 220 +#define SYS_clone3 435 +#define SYS_close 57 +#define SYS_close_range 436 +#define SYS_connect 203 +#define SYS_copy_file_range 285 +#define SYS_delete_module 106 +#define SYS_dup 23 +#define SYS_dup3 24 +#define SYS_epoll_create1 20 +#define SYS_epoll_ctl 21 +#define SYS_epoll_pwait 22 +#define SYS_epoll_pwait2 441 +#define SYS_eventfd2 19 +#define SYS_execve 221 +#define SYS_execveat 281 +#define SYS_exit 93 +#define SYS_exit_group 94 +#define SYS_faccessat 48 +#define SYS_faccessat2 439 +#define SYS_fadvise64 223 +#define SYS_fallocate 47 +#define SYS_fanotify_init 262 +#define SYS_fanotify_mark 263 +#define SYS_fchdir 50 +#define SYS_fchmod 52 +#define SYS_fchmodat 53 +#define SYS_fchmodat2 452 +#define SYS_fchown 55 +#define SYS_fchownat 54 +#define SYS_fcntl 25 +#define SYS_fdatasync 83 +#define SYS_fgetxattr 10 +#define SYS_finit_module 273 +#define SYS_flistxattr 13 +#define SYS_flock 32 +#define SYS_fremovexattr 16 +#define SYS_fsconfig 431 +#define SYS_fsetxattr 7 +#define SYS_fsmount 432 +#define SYS_fsopen 430 +#define SYS_fspick 433 +#define SYS_fstatfs 44 +#define SYS_fsync 82 +#define SYS_ftruncate 46 +#define SYS_futex 98 +#define SYS_futex_requeue 456 +#define SYS_futex_wait 455 +#define SYS_futex_waitv 449 +#define SYS_futex_wake 454 +#define SYS_getcpu 168 +#define SYS_getcwd 17 +#define SYS_getdents64 61 +#define SYS_getegid 177 +#define SYS_geteuid 175 +#define SYS_getgid 176 +#define SYS_getgroups 158 +#define SYS_getitimer 102 +#define SYS_get_mempolicy 236 +#define SYS_getpeername 205 +#define SYS_getpgid 155 +#define SYS_getpid 172 +#define SYS_getppid 173 +#define SYS_getpriority 141 +#define SYS_getrandom 278 +#define SYS_getresgid 150 +#define SYS_getresuid 148 +#define SYS_get_robust_list 100 +#define SYS_getrusage 165 +#define SYS_getsid 156 +#define SYS_getsockname 204 +#define SYS_getsockopt 209 +#define SYS_gettid 178 +#define SYS_gettimeofday 169 +#define SYS_getuid 174 +#define SYS_getxattr 8 +#define SYS_init_module 105 +#define SYS_inotify_add_watch 27 +#define SYS_inotify_init1 26 +#define SYS_inotify_rm_watch 28 +#define SYS_io_cancel 3 +#define SYS_ioctl 29 +#define SYS_io_destroy 1 +#define SYS_io_getevents 4 +#define SYS_io_pgetevents 292 +#define SYS_ioprio_get 31 +#define SYS_ioprio_set 30 +#define SYS_io_setup 0 +#define SYS_io_submit 2 +#define SYS_io_uring_enter 426 +#define SYS_io_uring_register 427 +#define SYS_io_uring_setup 425 +#define SYS_kcmp 272 +#define SYS_kexec_file_load 294 +#define SYS_kexec_load 104 +#define SYS_keyctl 219 +#define SYS_kill 129 +#define SYS_landlock_add_rule 445 +#define SYS_landlock_create_ruleset 444 +#define SYS_landlock_restrict_self 446 +#define SYS_lgetxattr 9 +#define SYS_linkat 37 +#define SYS_listen 201 +#define SYS_listxattr 11 +#define SYS_llistxattr 12 +#define SYS_lookup_dcookie 18 +#define SYS_lremovexattr 15 +#define SYS_lseek 62 +#define SYS_lsetxattr 6 +#define SYS_madvise 233 +#define SYS_map_shadow_stack 453 +#define SYS_mbind 235 +#define SYS_membarrier 283 +#define SYS_memfd_create 279 +#define SYS_migrate_pages 238 +#define SYS_mincore 232 +#define SYS_mkdirat 34 +#define SYS_mknodat 33 +#define SYS_mlock 228 +#define SYS_mlock2 284 +#define SYS_mlockall 230 +#define SYS_mmap 222 +#define SYS_mount 40 +#define SYS_mount_setattr 442 +#define SYS_move_mount 429 +#define SYS_move_pages 239 +#define SYS_mprotect 226 +#define SYS_mq_getsetattr 185 +#define SYS_mq_notify 184 +#define SYS_mq_open 180 +#define SYS_mq_timedreceive 183 +#define SYS_mq_timedsend 182 +#define SYS_mq_unlink 181 +#define SYS_mremap 216 +#define SYS_msgctl 187 +#define SYS_msgget 186 +#define SYS_msgrcv 188 +#define SYS_msgsnd 189 +#define SYS_msync 227 +#define SYS_munlock 229 +#define SYS_munlockall 231 +#define SYS_munmap 215 +#define SYS_name_to_handle_at 264 +#define SYS_nanosleep 101 +#define SYS_nfsservctl 42 +#define SYS_openat 56 +#define SYS_openat2 437 +#define SYS_open_by_handle_at 265 +#define SYS_open_tree 428 +#define SYS_perf_event_open 241 +#define SYS_personality 92 +#define SYS_pidfd_getfd 438 +#define SYS_pidfd_open 434 +#define SYS_pidfd_send_signal 424 +#define SYS_pipe2 59 +#define SYS_pivot_root 41 +#define SYS_pkey_alloc 289 +#define SYS_pkey_free 290 +#define SYS_pkey_mprotect 288 +#define SYS_ppoll 73 +#define SYS_prctl 167 +#define SYS_pread64 67 +#define SYS_preadv 69 +#define SYS_preadv2 286 +#define SYS_prlimit64 261 +#define SYS_process_madvise 440 +#define SYS_process_mrelease 448 +#define SYS_process_vm_readv 270 +#define SYS_process_vm_writev 271 +#define SYS_pselect6 72 +#define SYS_ptrace 117 +#define SYS_pwrite64 68 +#define SYS_pwritev 70 +#define SYS_pwritev2 287 +#define SYS_quotactl 60 +#define SYS_quotactl_fd 443 +#define SYS_read 63 +#define SYS_readahead 213 +#define SYS_readlinkat 78 +#define SYS_readv 65 +#define SYS_reboot 142 +#define SYS_recvfrom 207 +#define SYS_recvmmsg 243 +#define SYS_recvmsg 212 +#define SYS_remap_file_pages 234 +#define SYS_removexattr 14 +#define SYS_renameat2 276 +#define SYS_request_key 218 +#define SYS_restart_syscall 128 +#define SYS_rseq 293 +#define SYS_rt_sigaction 134 +#define SYS_rt_sigpending 136 +#define SYS_rt_sigprocmask 135 +#define SYS_rt_sigqueueinfo 138 +#define SYS_rt_sigreturn 139 +#define SYS_rt_sigsuspend 133 +#define SYS_rt_sigtimedwait 137 +#define SYS_rt_tgsigqueueinfo 240 +#define SYS_sched_getaffinity 123 +#define SYS_sched_getattr 275 +#define SYS_sched_getparam 121 +#define SYS_sched_get_priority_max 125 +#define SYS_sched_get_priority_min 126 +#define SYS_sched_getscheduler 120 +#define SYS_sched_rr_get_interval 127 +#define SYS_sched_setaffinity 122 +#define SYS_sched_setattr 274 +#define SYS_sched_setparam 118 +#define SYS_sched_setscheduler 119 +#define SYS_sched_yield 124 +#define SYS_seccomp 277 +#define SYS_semctl 191 +#define SYS_semget 190 +#define SYS_semop 193 +#define SYS_semtimedop 192 +#define SYS_sendfile 71 +#define SYS_sendmmsg 269 +#define SYS_sendmsg 211 +#define SYS_sendto 206 +#define SYS_setdomainname 162 +#define SYS_setfsgid 152 +#define SYS_setfsuid 151 +#define SYS_setgid 144 +#define SYS_setgroups 159 +#define SYS_sethostname 161 +#define SYS_setitimer 103 +#define SYS_set_mempolicy 237 +#define SYS_set_mempolicy_home_node 450 +#define SYS_setns 268 +#define SYS_setpgid 154 +#define SYS_setpriority 140 +#define SYS_setregid 143 +#define SYS_setresgid 149 +#define SYS_setresuid 147 +#define SYS_setreuid 145 +#define SYS_set_robust_list 99 +#define SYS_setsid 157 +#define SYS_setsockopt 208 +#define SYS_set_tid_address 96 +#define SYS_settimeofday 170 +#define SYS_setuid 146 +#define SYS_setxattr 5 +#define SYS_shmat 196 +#define SYS_shmctl 195 +#define SYS_shmdt 197 +#define SYS_shmget 194 +#define SYS_shutdown 210 +#define SYS_sigaltstack 132 +#define SYS_signalfd4 74 +#define SYS_socket 198 +#define SYS_socketpair 199 +#define SYS_splice 76 +#define SYS_statfs 43 +#define SYS_statx 291 +#define SYS_swapoff 225 +#define SYS_swapon 224 +#define SYS_symlinkat 36 +#define SYS_sync 81 +#define SYS_sync_file_range 84 +#define SYS_syncfs 267 +#define SYS_sysinfo 179 +#define SYS_syslog 116 +#define SYS_tee 77 +#define SYS_tgkill 131 +#define SYS_timer_create 107 +#define SYS_timer_delete 111 +#define SYS_timerfd_create 85 +#define SYS_timerfd_gettime 87 +#define SYS_timerfd_settime 86 +#define SYS_timer_getoverrun 109 +#define SYS_timer_gettime 108 +#define SYS_timer_settime 110 +#define SYS_times 153 +#define SYS_tkill 130 +#define SYS_truncate 45 +#define SYS_umask 166 +#define SYS_umount2 39 +#define SYS_uname 160 +#define SYS_unlinkat 35 +#define SYS_unshare 97 +#define SYS_userfaultfd 282 +#define SYS_utimensat 88 +#define SYS_vhangup 58 +#define SYS_vmsplice 75 +#define SYS_wait4 260 +#define SYS_waitid 95 +#define SYS_write 64 +#define SYS_writev 66 diff --git a/pwnlib/elf/elf.py b/pwnlib/elf/elf.py index d93bfca8b4..5e74aa5068 100644 --- a/pwnlib/elf/elf.py +++ b/pwnlib/elf/elf.py @@ -484,6 +484,7 @@ def get_machine_arch(self): ('EM_IA_64', 64): 'ia64', ('EM_RISCV', 32): 'riscv32', ('EM_RISCV', 64): 'riscv64', + ('EM_LOONGARCH', 64): 'loongarch64', }.get((self['e_machine'], self.bits), self['e_machine']) @property @@ -523,7 +524,7 @@ def iter_segments_by_type(self, t): yield seg def iter_notes(self): - """ + """ Yields: All the notes in the PT_NOTE segments. Each result is a dictionary- like object with ``n_name``, ``n_type``, and ``n_desc`` fields, amongst @@ -544,7 +545,7 @@ def iter_properties(self): continue for prop in note.n_desc: yield prop - + def get_segment_for_address(self, address, size=1): """get_segment_for_address(address, size=1) -> Segment @@ -1736,7 +1737,7 @@ def nx(self): Unfortunately, :class:`ELF` is not context-aware, so it's not always possible to determine whether the process of a binary that's missing ``PT_GNU_STACK`` will have NX or not. - + The rules are as follows: +-----------+--------------+---------------------------+------------------------------------------------+----------+ @@ -1891,7 +1892,7 @@ def nx(self): /* stripped */ # define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \\ (exec_stk == EXSTACK_DEFAULT) : 0) - #else + #else # define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT) #endif /* __powerpc64__ */ @@ -1919,7 +1920,7 @@ def nx(self): """ if not self.executable: return True - + exec_bit = None for seg in self.iter_segments_by_type('GNU_STACK'): exec_bit = bool(seg.header.p_flags & P_FLAGS.PF_X) @@ -1996,7 +1997,7 @@ def execstack(self): # If the ``PT_GNU_STACK`` program header is preset, use it's premissions. for seg in self.iter_segments_by_type('GNU_STACK'): return bool(seg.header.p_flags & P_FLAGS.PF_X) - + # If the ``PT_GNU_STACK`` program header is missing, then use the # default rules. Out of the supported architectures, only AArch64, # IA-64, and RISC-V get a non-executable stack by default. @@ -2124,16 +2125,16 @@ def checksec(self, banner=True, color=True): if self.ubsan: res.append("UBSAN:".ljust(12) + green("Enabled")) - + if self.shadowstack: res.append("SHSTK:".ljust(12) + green("Enabled")) - + if self.ibt: res.append("IBT:".ljust(12) + green("Enabled")) - + if not self.stripped: res.append("Stripped:".ljust(12) + red("No")) - + if self.debuginfo: res.append("Debuginfo:".ljust(12) + red("Yes")) @@ -2193,10 +2194,10 @@ def ubsan(self): """:class:`bool`: Whether the current binary was built with Undefined Behavior Sanitizer (``UBSAN``).""" return any(s.startswith('__ubsan_') for s in self.symbols) - + @property def shadowstack(self): - """:class:`bool`: Whether the current binary was built with + """:class:`bool`: Whether the current binary was built with Shadow Stack (``SHSTK``)""" if self.arch not in ['i386', 'amd64']: return False @@ -2348,7 +2349,7 @@ def disable_nx(self): return log.error("Could not find PT_GNU_STACK, stack should already be executable") - + @staticmethod def set_runpath(exepath, runpath): r"""set_runpath(exepath, runpath) -> ELF @@ -2450,7 +2451,7 @@ def patch_custom_libraries(exe_path, custom_library_path, create_copy=True, suff if not which('patchelf'): log.error('"patchelf" tool not installed. See https://github.com/NixOS/patchelf') return None - + # Create a copy of the ELF to patch instead of the original file. if create_copy: import shutil diff --git a/pwnlib/elf/plt.py b/pwnlib/elf/plt.py index 70846177f5..8b64db9766 100644 --- a/pwnlib/elf/plt.py +++ b/pwnlib/elf/plt.py @@ -93,6 +93,7 @@ def prepare_unicorn_and_context(elf, got, address, data): 'thumb': U.UC_ARCH_ARM, 'riscv32': U.UC_ARCH_RISCV, 'riscv64': U.UC_ARCH_RISCV, + # 'loongarch64': U.UC_ARCH_LOONGARCH, <-- Not actually supported }.get(elf.arch, None) if arch is None: diff --git a/pwnlib/gdb.py b/pwnlib/gdb.py index 9dd509360b..5839db4094 100644 --- a/pwnlib/gdb.py +++ b/pwnlib/gdb.py @@ -250,7 +250,7 @@ def debug_shellcode(data, gdbscript=None, vma=None, api=False): def _execve_script(argv, executable, env, ssh): """_execve_script(argv, executable, env, ssh) -> str - Returns the filename of a python script that calls + Returns the filename of a python script that calls execve the specified program with the specified arguments. This script is suitable to call with gdbservers ``--wrapper`` option, so we have more control over the environment of the debugged process. @@ -281,7 +281,7 @@ def _execve_script(argv, executable, env, ssh): log.debug("Created execve wrapper script %s:\n%s", tmp.name, script) return tmp.name - + def _gdbserver_args(pid=None, path=None, port=0, gdbserver_args=None, args=None, which=None, env=None, python_wrapper_script=None): """_gdbserver_args(pid=None, path=None, args=None, which=None, env=None) -> list @@ -348,7 +348,7 @@ def _gdbserver_args(pid=None, path=None, port=0, gdbserver_args=None, args=None, env_args.append(b'%s=%s' % (key, env.pop(key))) else: env_args.append(b'%s=%s' % (key, env[key])) - + if python_wrapper_script is not None: gdbserver_args += ['--wrapper', python_wrapper_script, '--'] elif env is not None: @@ -521,7 +521,7 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por >>> io.interactive() # doctest: +SKIP >>> io.close() - + Start a new process with modified argv[0] >>> io = gdb.debug(args=[b'\xde\xad\xbe\xef'], gdbscript='continue', exe="/bin/sh") @@ -660,7 +660,7 @@ def debug(args, gdbscript=None, gdb_args=None, exe=None, ssh=None, env=None, por if ssh or context.native or (context.os == 'android'): if len(args) > 0 and which(packing._decode(args[0])) == packing._decode(exe): args = _gdbserver_args(gdbserver_args=gdbserver_args, args=args, port=port, which=which, env=env) - + else: # GDBServer is limited in it's ability to manipulate argv[0] # but can use the ``--wrapper`` option to execute commands and catches @@ -737,6 +737,7 @@ def get_gdb_arch(): 'sparc64': 'sparc:v9', 'riscv32': 'riscv:rv32', 'riscv64': 'riscv:rv64', + 'loongarch64': 'Loongarch64', }.get(context.arch, context.arch) def binary(): @@ -1163,7 +1164,7 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr if proc.exe(pid).endswith('/socat') and time.sleep(0.1) and proc.children(pid): pid = proc.children(pid)[0] - # We may attach to the remote process after the fork but before it performs an exec. + # We may attach to the remote process after the fork but before it performs an exec. # If an exe is provided, wait until the process is actually running the expected exe # before we attach the debugger. t = Timeout() diff --git a/pwnlib/shellcraft/registers.py b/pwnlib/shellcraft/registers.py index fe366f70c7..667014ce27 100644 --- a/pwnlib/shellcraft/registers.py +++ b/pwnlib/shellcraft/registers.py @@ -110,6 +110,43 @@ riscv_list = list(riscv) +loongarch64 = { + 'r0' : 0, 'zero': 0, + 'r1' : 1, 'ra': 1, + 'r2' : 2, 'tp': 2, + 'r3' : 3, 'sp': 3, + 'r4' : 4, 'a0': 4, 'v0': 4, + 'r5' : 5, 'a1': 5, 'v1': 5, + 'r6' : 6, 'a2': 6, + 'r7' : 7, 'a3': 7, + 'r8' : 8, 'a4': 8, + 'r9' : 9, 'a5': 9, + 'r10': 10, 'a6': 10, + 'r11': 11, 'a7': 11, + 'r12': 12, 't0': 12, + 'r13': 13, 't1': 13, + 'r14': 14, 't2': 14, + 'r15': 15, 't3': 15, + 'r16': 16, 't4': 16, + 'r17': 17, 't5': 17, + 'r18': 18, 't6': 18, + 'r19': 19, 't7': 19, + 'r20': 20, 't8': 20, + 'r21': 21, 'u0': 21, # u0 is only used by Linux kernel + 'r22': 22, 'fp': 22, 's9': 22, + 'r23': 23, 's0': 23, + 'r24': 24, 's1': 24, + 'r25': 25, 's2': 25, + 'r26': 26, 's3': 26, + 'r27': 27, 's4': 27, + 'r28': 28, 't5': 28, + 'r29': 29, 't6': 29, + 'r30': 30, 't7': 30, + 'r31': 31, 't8': 31, +} + +loongarch64_list = list(loongarch64) + # x86/amd64 registers in decreasing size i386_ordered = [ ['rax', 'eax', 'ax', 'al'], @@ -253,6 +290,7 @@ def current(): 'powerpc': powerpc, 'riscv32': riscv, 'riscv64': riscv, + 'loongarch64': loongarch64, }[context.arch] # def is_register(sz): diff --git a/pwnlib/shellcraft/templates/loongarch64/__doc__ b/pwnlib/shellcraft/templates/loongarch64/__doc__ new file mode 100644 index 0000000000..8b823d815c --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/__doc__ @@ -0,0 +1 @@ +Shellcraft module containing generic LoongArch64 shellcodes. diff --git a/pwnlib/shellcraft/templates/loongarch64/linux/__doc__ b/pwnlib/shellcraft/templates/loongarch64/linux/__doc__ new file mode 100644 index 0000000000..a4c44edc9f --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/linux/__doc__ @@ -0,0 +1 @@ +Shellcraft module containing LoongArch64 shellcodes for Linux. diff --git a/pwnlib/shellcraft/templates/loongarch64/linux/syscall.asm b/pwnlib/shellcraft/templates/loongarch64/linux/syscall.asm new file mode 100644 index 0000000000..aeb8da332f --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/linux/syscall.asm @@ -0,0 +1,111 @@ +<% + from pwnlib.shellcraft import loongarch64, pretty + from pwnlib.constants import Constant + from pwnlib.abi import linux_loongarch64_syscall as abi + from six import text_type +%> +<%page args="syscall = None, arg0 = None, arg1 = None, arg2 = None, arg3 = None, arg4=None, arg5=None"/> +<%docstring> +Args: [syscall_number, \*args] + Does a syscall + +Any of the arguments can be expressions to be evaluated by :func:`pwnlib.constants.eval`. + +Example: + + >>> print(pwnlib.shellcraft.loongarch64.linux.syscall('SYS_execve', 1, 'sp', 2, 0).rstrip()) + addi.d $a0, $r0, 1 + addi.d $a1, $sp, 0 + addi.d $a2, $r0, 2 + addi.d $a3, $r0, 0 + addi.d $a7, $r0, 221 + syscall 0 + >>> print(pwnlib.shellcraft.loongarch64.linux.syscall('SYS_execve', 2, 1, 0, 20).rstrip()) + addi.d $a0, $r0, 2 + addi.d $a1, $r0, 1 + addi.d $a2, $r0, 0 + addi.d $a3, $r0, 20 + addi.d $a7, $r0, 221 + syscall 0 + >>> print(pwnlib.shellcraft.loongarch64.linux.syscall().rstrip()) + syscall 0 + >>> print(pwnlib.shellcraft.loongarch64.linux.syscall('a7', 'a0', 'a1').rstrip()) + syscall 0 + >>> print(pwnlib.shellcraft.loongarch64.linux.syscall('a3', None, None, 1).rstrip()) + addi.d $a2, $r0, 1 + addi.d $a7, $a3, 0 + syscall 0 + >>> print(pwnlib.shellcraft.loongarch64.linux.syscall( + ... 'SYS_mmap', 0, 0x1000, + ... 'PROT_READ | PROT_WRITE | PROT_EXEC', + ... 'MAP_PRIVATE', + ... -1, 0).rstrip()) + addi.d $a0, $r0, 0 + addi.d $a1, $r0, 1 + lu52i.d $a1, $a1, 0 + addi.d $a2, $r0, 7 + addi.d $a3, $r0, 2 + addi.d $a4, $r0, 15 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + addi.d $a5, $r0, 0 + addi.d $a7, $r0, 222 + syscall 0 + >>> print(pwnlib.shellcraft.loongarch64.linux.syscall( + ... 'SYS_mmap', 0, 0x1000, + ... 'PROT_READ | PROT_WRITE | PROT_EXEC', + ... 'MAP_PRIVATE', + ... -1, 0).rstrip()) + addi.d $a0, $r0, 0 + addi.d $a1, $r0, 1 + lu52i.d $a1, $a1, 0 + addi.d $a2, $r0, 7 + addi.d $a3, $r0, 2 + addi.d $a4, $r0, 15 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + lu52i.d $a4, $a4, -1 + addi.d $a5, $r0, 0 + addi.d $a7, $r0, 222 + syscall 0 + >>> print(pwnlib.shellcraft.loongarch64.openat('AT_FDCWD', '/home/pwn/flag').rstrip()) + /* openat(fd='AT_FDCWD', file='/home/pwn/flag', oflag=0) */ + addi.d $t8, $r0, 7 + lu52i.d $t8, $t8, 1904 + lu52i.d $t8, $t8, 758 + lu52i.d $t8, $t8, 1389 + lu52i.d $t8, $t8, 1782 + lu52i.d $t8, $t8, -2001 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + addi.d $t8, $r0, 1654 + lu52i.d $t8, $t8, 364 + lu52i.d $t8, $t8, 1634 + lu52i.d $t8, $t8, -146 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + addi.d $a1, $sp, 0 + addi.d $a0, $r0, 15 + lu52i.d $a0, $a0, -1 + lu52i.d $a0, $a0, -1 + lu52i.d $a0, $a0, -1 + lu52i.d $a0, $a0, -1 + lu52i.d $a0, $a0, -100 + addi.d $a2, $r0, 0 + addi.d $a7, $r0, 56 + syscall 0 + +<% + registers = abi.register_arguments + arguments = [syscall, arg0, arg1, arg2, arg3, arg4, arg5] + regctx = dict(zip(registers, arguments)) +%>\ +%if any(a is not None for a in arguments): +${loongarch64.setregs(regctx)} +%endif + syscall 0 diff --git a/pwnlib/shellcraft/templates/loongarch64/linux/syscalls b/pwnlib/shellcraft/templates/loongarch64/linux/syscalls new file mode 120000 index 0000000000..82bc97edbf --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/linux/syscalls @@ -0,0 +1 @@ +../../common/linux/syscalls \ No newline at end of file diff --git a/pwnlib/shellcraft/templates/loongarch64/mov.asm b/pwnlib/shellcraft/templates/loongarch64/mov.asm new file mode 100644 index 0000000000..756a346c40 --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/mov.asm @@ -0,0 +1,90 @@ +<% + from pwnlib.util import lists, packing, fiddling, misc + from pwnlib.constants import eval, Constant + from pwnlib.context import context as ctx # Ugly hack, mako will not let it be called context + from pwnlib.log import getLogger + from pwnlib.shellcraft import loongarch64, registers, pretty, okay + import six + log = getLogger('pwnlib.shellcraft.loongarch64.mov') +%> +<%page args="dst, src"/> +<%docstring> +Move src into dst. + +If src is a string that is not a register, then it will locally set +`context.arch` to `'loongarch64'` and use :func:`pwnlib.constants.eval` to evaluate the +string. Note that this means that this shellcode can change behavior depending +on the value of `context.os`. + +There is no effort done to avoid newlines and null bytes in the generated code. + +Args: + + dst (str): The destination register. + src (str): Either the input register, or an immediate value. + +Example: + + >>> print(shellcraft.loongarch64.mov('t0', 0).rstrip()) + addi.d $t0, $r0, 0 + >>> print(shellcraft.loongarch64.mov('t0', 0x2000).rstrip()) + addi.d $t0, $r0, 2 + lu52i.d $t0, $t0, 0 + >>> print(shellcraft.loongarch64.mov('t0', 0xcafebabe).rstrip()) + addi.d $t0, $r0, 202 + lu52i.d $t0, $t0, -21 + lu52i.d $t0, $t0, -1346 + >>> print(shellcraft.loongarch64.mov('t1', 'sp').rstrip()) + addi.d $t1, $sp, 0 + + +<% +if not isinstance(dst, str) or dst not in registers.loongarch64: + log.error("Unknown register %r", dst) + return + +if isinstance(src, str) and src not in registers.loongarch64: + src = eval(src) + +if isinstance(src, str) and src not in registers.loongarch64: + log.error("Unknown register %r", src) + return + +src_reg = registers.loongarch64.get(src, None) +dst_reg = registers.loongarch64[dst] + +# If source register is zero, treat it as immediate 0 +if src_reg == 0: + src = 0 + src_reg = None +%> + +% if dst_reg == 0 or dst_reg == src_reg: + /* ld ${dst}, ${src} is a noop */ +% elif src_reg is not None: + addi.d $${dst}, $${src}, 0 +% else: +## Source is an immediate, normalize to [0, 2**64) + +<% src = packing.unpack(packing.pack(src, word_size=64), word_size=64, sign=False) %> +## Immediates are always sign-extended to 64-bit + +% if src == 0: + addi.d $${dst}, $r0, 0 +% else: +<% +parts = [] +fullsrc = src +while src != 0: + parts.append(packing.unpack(packing.pack((src & 0xfff), word_size=12, sign=False), word_size=12, sign=True)) + src = src >> 12 +%> +% for idx, part in enumerate(reversed(parts)): + % if idx == 0: + addi.d $${dst}, $r0, ${part} + % else: + lu52i.d $${dst}, $${dst}, ${part} + % endif +% endfor +% endif +% endif diff --git a/pwnlib/shellcraft/templates/loongarch64/nop.asm b/pwnlib/shellcraft/templates/loongarch64/nop.asm new file mode 100644 index 0000000000..ebd713f2ae --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/nop.asm @@ -0,0 +1,2 @@ +<%docstring>LoongArch64 nop instruction. + addi.d $r0, $r0, 0 diff --git a/pwnlib/shellcraft/templates/loongarch64/push.asm b/pwnlib/shellcraft/templates/loongarch64/push.asm new file mode 100644 index 0000000000..6e0d71bba5 --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/push.asm @@ -0,0 +1,27 @@ +<% + from pwnlib.shellcraft import loongarch64 + from pwnlib import constants + from pwnlib.shellcraft import registers + from six import text_type, binary_type +%> +<%page args="value"/> +<%docstring> +Pushes a value onto the stack. + +Register t8 is not guaranteed to be preserved. + +<% +is_reg = value in registers.loongarch64 + +if not is_reg and isinstance(value, (binary_type, text_type)): + try: + value = constants.eval(value) + except (ValueError, AttributeError): + pass +%> +% if not is_reg: + ${loongarch64.mov('t8', value)} + <% value = 't8' %>\ +%endif + addi.d $sp, $sp, -8 + st.d $${value}, $sp, 0 diff --git a/pwnlib/shellcraft/templates/loongarch64/pushstr.asm b/pwnlib/shellcraft/templates/loongarch64/pushstr.asm new file mode 100644 index 0000000000..0dc7abb56c --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/pushstr.asm @@ -0,0 +1,81 @@ +<% + from pwnlib.util import lists, packing, fiddling + from pwnlib.shellcraft import loongarch64, pretty + import six +%>\ +<%page args="string, append_null = True"/> +<%docstring> +Pushes a string onto the stack. + +There is no effort done to avoid newlines and null bytes in the generated code. + +Register t8 is not guaranteed to be preserved. + +Example: + + >>> print(shellcraft.loongarch64.pushstr('').rstrip()) + st.d $r0, -8(sp) + >>> print(shellcraft.loongarch64.pushstr('a').rstrip()) + addi.d $t8, $r0, 97 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + >>> print(shellcraft.loongarch64.pushstr('aa').rstrip()) + addi.d $t8, $r0, 6 + lu52i.d $t8, $t8, 353 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + >>> print(shellcraft.loongarch64.pushstr('aaaa').rstrip()) + addi.d $t8, $r0, 97 + lu52i.d $t8, $t8, 1558 + lu52i.d $t8, $t8, 353 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + >>> print(shellcraft.loongarch64.pushstr('aaaaa').rstrip()) + addi.d $t8, $r0, 6 + lu52i.d $t8, $t8, 353 + lu52i.d $t8, $t8, 1558 + lu52i.d $t8, $t8, 353 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + >>> print(shellcraft.loongarch64.pushstr('aaaa', append_null = False).rstrip()) + addi.d $t8, $r0, 97 + lu52i.d $t8, $t8, 1558 + lu52i.d $t8, $t8, 353 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + >>> print(shellcraft.loongarch64.pushstr(b'\xc3').rstrip()) + addi.d $t8, $r0, 195 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + >>> print(shellcraft.loongarch64.pushstr(b'\xc3', append_null = False).rstrip()) + addi.d $t8, $r0, 195 + addi.d $sp, $sp, -8 + st.d $t8, $sp, 0 + +Args: + string (str): The string to push. + append_null (bool): Whether to append a single NULL-byte before pushing. + +<% + if isinstance(string, six.text_type): + string = string.encode('utf-8') + if append_null: + string += b'\x00' + if not string: + return + + split_string = lists.group(8, string, 'fill', b'\x00') + stack_offset = len(split_string) * -8 +%>\ +% for index, word in enumerate(split_string): +% if word == b'\x00\x00\x00\x00\x00\x00\x00\x00': + st.d $r0, ${stack_offset+(8 * index)}(sp) +<% + continue +%>\ +% endif +<% + word = packing.u64(word, sign=True) +%>\ + ${loongarch64.push(word)} +% endfor diff --git a/pwnlib/shellcraft/templates/loongarch64/pushstr_array.asm b/pwnlib/shellcraft/templates/loongarch64/pushstr_array.asm new file mode 100644 index 0000000000..fe6cf97081 --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/pushstr_array.asm @@ -0,0 +1,37 @@ +<% from pwnlib.shellcraft import loongarch64, pretty %> +<%docstring> +Pushes an array/envp-style array of pointers onto the stack. + +Arguments: + reg(str): + Destination register to hold the pointer. + array(str,list): + Single argument or list of arguments to push. + NULL termination is normalized so that each argument + ends with exactly one NULL byte. + +<%page args="reg, array"/> +<% +if isinstance(array, (str)): + array = [array] + +array_str = '' + +# Normalize all of the arguments' endings +array = [arg.rstrip('\x00') + '\x00' for arg in array] +array_str = ''.join(array) + +word_size = 8 +offset = len(array_str) + word_size + +%>\ + ${loongarch64.pushstr(array_str)} + ${loongarch64.mov(reg, 0)} + ${loongarch64.push(reg)} +% for i,arg in enumerate(reversed(array)): + ${loongarch64.mov(reg, offset + word_size*i - len(arg))} + addi.d $${reg}, $sp, $${reg} + ${loongarch64.push(reg)} + <% offset -= len(arg) %>\ +% endfor + ${loongarch64.mov(reg,'sp')} diff --git a/pwnlib/shellcraft/templates/loongarch64/setregs.asm b/pwnlib/shellcraft/templates/loongarch64/setregs.asm new file mode 100644 index 0000000000..66eedda6e2 --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/setregs.asm @@ -0,0 +1,41 @@ +<% + from pwnlib.regsort import regsort + from pwnlib.constants import Constant, eval + from pwnlib.shellcraft import registers + from pwnlib.shellcraft import loongarch64 +%> +<%page args="reg_context, stack_allowed = True"/> +<%docstring> +Sets multiple registers, taking any register dependencies into account +(i.e., given eax=1,ebx=eax, set ebx first). + +Args: + reg_context (dict): Desired register context + stack_allowed (bool): Can the stack be used? + +Example: + + >>> print(shellcraft.setregs({'t0':1, 'a3':'0'}).rstrip()) + addi.d $a3, $r0, 0 + addi.d $t0, $r0, 1 + >>> print(shellcraft.setregs({'a0':'a1', 'a1':'a0', 'a2':'a1'}).rstrip()) + addi.d $a2, $a1, 0 + xor $a1, $a1, $a0 /* xchg a1, a0 */ + xor $a0, $a0, $a1 + xor $a1, $a1, $a0 + +<% +reg_context = {k:v for k,v in reg_context.items() if v is not None} +sorted_regs = regsort(reg_context, registers.loongarch64) +%> +% if sorted_regs: +% for how, src, dst in regsort(reg_context, registers.loongarch64): +% if how == 'xchg': + ${loongarch64.xor(dst, dst, src)} /* xchg ${dst}, ${src} */ + ${loongarch64.xor(src, src, dst)} + ${loongarch64.xor(dst, dst, src)} +% else: + ${loongarch64.mov(src, dst)} +% endif +% endfor +% endif diff --git a/pwnlib/shellcraft/templates/loongarch64/trap.asm b/pwnlib/shellcraft/templates/loongarch64/trap.asm new file mode 100644 index 0000000000..e75c7c34f1 --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/trap.asm @@ -0,0 +1,2 @@ +<%docstring>A trap instruction. + break 0 diff --git a/pwnlib/shellcraft/templates/loongarch64/xor.asm b/pwnlib/shellcraft/templates/loongarch64/xor.asm new file mode 100644 index 0000000000..24b979b29b --- /dev/null +++ b/pwnlib/shellcraft/templates/loongarch64/xor.asm @@ -0,0 +1,23 @@ +<% + from pwnlib.shellcraft import loongarch64 + from pwnlib.shellcraft import registers +%> +<%page args="dst,rs1,rs2"/> +<%docstring> +XOR two registers rs1 and rs2, store result in register dst. + +Register t4 is not guaranteed to be preserved. + +<% +if not isinstance(dst, str) or dst not in registers.loongarch64: + log.error("Unknown register %r", dst) + return +if not isinstance(rs1, str) or rs1 not in registers.loongarch64: + log.error("Unknown register %r", rs1) + return +if not isinstance(rs2, str) or rs2 not in registers.loongarch64: + log.error("Unknown register %r", rs2) + return + +%> + xor $${dst}, $${rs1}, $${rs2} diff --git a/travis/docker/Dockerfile b/travis/docker/Dockerfile index d04663cea0..4e06902bc7 100644 --- a/travis/docker/Dockerfile +++ b/travis/docker/Dockerfile @@ -103,7 +103,8 @@ RUN mkdir /etc/qemu-binfmt && \ ln -sf /usr/lib/powerpc-linux-gnu /etc/qemu-binfmt/powerpc && \ ln -sf /usr/lib/powerpc-linux-gnu64 /etc/qemu-binfmt/powerpc64 && \ ln -sf /usr/lib/sparc64-linux-gnu /etc/qemu-binfmt/sparc64 && \ - ln -sf /usr/lib/riscv64-linux-gnu /etc/qemu-binfmt/riscv64 + ln -sf /usr/lib/riscv64-linux-gnu /etc/qemu-binfmt/riscv64 && \ + ln -sf /usr/lib/loongarch64-linux-gnu /etc/qemu-binfmt/loongarch64 # Create the Travis user USER root diff --git a/travis/docker/Dockerfile.travis b/travis/docker/Dockerfile.travis index 4346d87990..9934fedbae 100644 --- a/travis/docker/Dockerfile.travis +++ b/travis/docker/Dockerfile.travis @@ -17,7 +17,8 @@ RUN mkdir /etc/qemu-binfmt && \ ln -sf /usr/lib/powerpc-linux-gnu /etc/qemu-binfmt/powerpc && \ ln -sf /usr/lib/powerpc-linux-gnu64 /etc/qemu-binfmt/powerpc64 && \ ln -sf /usr/lib/sparc64-linux-gnu /etc/qemu-binfmt/sparc64 && \ - ln -sf /usr/lib/riscv64-linux-gnu /etc/qemu-binfmt/riscv64 + ln -sf /usr/lib/riscv64-linux-gnu /etc/qemu-binfmt/riscv64 && \ + ln -sf /usr/lib/loongarch64-linux-gnu /etc/qemu-binfmt/loongarch64 # Create the Travis user USER root