Linux syscall x86


int 0x80

Syscall 参数 1参数 2参数 3参数 4参数 5参数 6
eax
调用号
返回值
ebxecxedxesiediebp

在64位程序中应使用syscall,虽然我不认为会有像我一样的zz把这两个混用(逃 ε=ε=ε=(~ ̄▽ ̄)~

因为int 0x80只适用于32位程序。int 0x80 的参数只会32位寄存器中传递,当你在64位程序中使用它时,64位寄存器的高32位将被忽略。

而且system的执行比int 0x80要快至于原因参Intel x86 vs x64 system call

library call

函数参数保存在函数返回地址上方

x86下的syscall

eaxNameebxecxedxesiedi
0x00sys_restart_syscall-----
0x01sys_exitint error_code----
0x02sys_forkstruct pt_regs *----
0x03sys_readunsigned int fdchar __user *bufsize_t count--
0x04sys_writeunsigned int fdconst char __user *bufsize_t count--
0x05sys_openconst char __user *filenameint flagsint mode--
0x06sys_closeunsigned int fd----
0x07sys_waitpidpid_t pidint __user *stat_addrint options--
0x08sys_creatconst char __user *pathnameint mode---
0x09sys_linkconst char __user *oldnameconst char __user *newname---
0x0asys_unlinkconst char __user *pathname----
0x0bsys_execvechar __user *char __user  __userchar __user  __userstruct pt_regs *-
0x0csys_chdirconst char __user *filename----
0x0dsys_timetime_t __user *tloc----
0x0esys_mknodconst char __user *filenameint modeunsigned dev--
0x0fsys_chmodconst char __user *filenamemode_t mode---
0x10sys_lchown16const char __user *filenameold_uid_t userold_gid_t group--
0x11not implemented-----
0x12sys_statchar __user *filenamestruct __old_kernel_stat __user *statbuf---
0x13sys_lseekunsigned int fdoff_t offsetunsigned int origin--
0x14sys_getpid-----
0x15sys_mountchar __user *dev_namechar __user *dir_namechar __user *typeunsigned long flagsvoid __user *data
0x16sys_oldumountchar __user *name----
0x17sys_setuid16old_uid_t uid----
0x18sys_getuid16-----
0x19sys_stimetime_t __user *tptr----
0x1asys_ptracelong requestlong pidlong addrlong data-
0x1bsys_alarmunsigned int seconds----
0x1csys_fstatunsigned int fdstruct __old_kernel_stat __user *statbuf---
0x1dsys_pause-----
0x1esys_utimechar __user *filenamestruct utimbuf __user *times---
0x1fnot implemented-----
0x20not implemented-----
0x21sys_accessconst char __user *filenameint mode---
0x22sys_niceint increment----
0x23not implemented-----
0x24sys_sync-----
0x25sys_killint pidint sig---
0x26sys_renameconst char __user *oldnameconst char __user *newname---
0x27sys_mkdirconst char __user *pathnameint mode---
0x28sys_rmdirconst char __user *pathname----
0x29sys_dupunsigned int fildes----
0x2asys_pipeint __user *fildes----
0x2bsys_timesstruct tms __user *tbuf----
0x2cnot implemented-----
0x2dsys_brkunsigned long brk----
0x2esys_setgid16old_gid_t gid----
0x2fsys_getgid16-----
0x30sys_signalint sig__sighandler_t handler---
0x31sys_geteuid16-----
0x32sys_getegid16-----
0x33sys_acctconst char __user *name----
0x34sys_umountchar __user *nameint flags---
0x35not implemented-----
0x36sys_ioctlunsigned int fdunsigned int cmdunsigned long arg--
0x37sys_fcntlunsigned int fdunsigned int cmdunsigned long arg--
0x38not implemented-----
0x39sys_setpgidpid_t pidpid_t pgid---
0x3anot implemented-----
0x3bsys_oldunamestruct oldold_utsname __user *----
0x3csys_umaskint mask----
0x3dsys_chrootconst char __user *filename----
0x3esys_ustatunsigned devstruct ustat __user *ubuf---
0x3fsys_dup2unsigned int oldfdunsigned int newfd---
0x40sys_getppid-----
0x41sys_getpgrp-----
0x42sys_setsid-----
0x43sys_sigactionint sigconst struct old_sigaction __user *actstruct old_sigaction __user *oact--
0x44sys_sgetmask-----
0x45sys_ssetmaskint newmask----
0x46sys_setreuid16old_uid_t ruidold_uid_t euid---
0x47sys_setregid16old_gid_t rgidold_gid_t egid---
0x48sys_sigsuspendint history0int history1old_sigset_t mask--
0x49sys_sigpendingold_sigset_t __user *set----
0x4asys_sethostnamechar __user *nameint len---
0x4bsys_setrlimitunsigned int resourcestruct rlimit __user *rlim---
0x4csys_old_getrlimitunsigned int resourcestruct rlimit __user *rlim---
0x4dsys_getrusageint whostruct rusage __user *ru---
0x4esys_gettimeofdaystruct timeval __user *tvstruct timezone __user *tz---
0x4fsys_settimeofdaystruct timeval __user *tvstruct timezone __user *tz---
0x50sys_getgroups16int gidsetsizeold_gid_t __user *grouplist---
0x51sys_setgroups16int gidsetsizeold_gid_t __user *grouplist---
0x52sys_old_selectstruct sel_arg_struct __user *arg----
0x53sys_symlinkconst char __user *oldconst char __user *new---
0x54sys_lstatchar __user *filenamestruct __old_kernel_stat __user *statbuf---
0x55sys_readlinkconst char __user *pathchar __user *bufint bufsiz--
0x56sys_uselibconst char __user *library----
0x57sys_swaponconst char __user *specialfileint swap_flags---
0x58sys_rebootint magic1int magic2unsigned int cmdvoid __user *arg-
0x59sys_old_readdirunsigned intstruct old_linux_dirent __user *unsigned int--
0x5asys_old_mmapstruct mmap_arg_struct __user *arg----
0x5bsys_munmapunsigned long addrsize_t len---
0x5csys_truncateconst char __user *pathlong length---
0x5dsys_ftruncateunsigned int fdunsigned long length---
0x5esys_fchmodunsigned int fdmode_t mode---
0x5fsys_fchown16unsigned int fdold_uid_t userold_gid_t group--
0x60sys_getpriorityint whichint who---
0x61sys_setpriorityint whichint whoint niceval--
0x62not implemented-----
0x63sys_statfsconst char __user * pathstruct statfs __user *buf---
0x64sys_fstatfsunsigned int fdstruct statfs __user *buf---
0x65sys_iopermunsigned longunsigned longint--
0x66sys_socketcallint callunsigned long __user *args---
0x67sys_syslogint typechar __user *bufint len--
0x68sys_setitimerint whichstruct itimerval __user *valuestruct itimerval __user *ovalue--
0x69sys_getitimerint whichstruct itimerval __user *value---
0x6asys_newstatchar __user *filenamestruct stat __user *statbuf---
0x6bsys_newlstatchar __user *filenamestruct stat __user *statbuf---
0x6csys_newfstatunsigned int fdstruct stat __user *statbuf---
0x6dsys_unamestruct old_utsname __user *----
0x6esys_ioplunsigned intstruct pt_regs *---
0x6fsys_vhangup-----
0x70not implemented-----
0x71sys_vm86oldstruct vm86_struct __user *struct pt_regs *---
0x72sys_wait4pid_t pidint __user *stat_addrint optionsstruct rusage __user *ru-
0x73sys_swapoffconst char __user *specialfile----
0x74sys_sysinfostruct sysinfo __user *info----
0x75sys_ipc-----
0x76sys_fsyncunsigned int fd----
0x77sys_sigreturnstruct pt_regs *regs----
0x78sys_cloneunsigned longunsigned longunsigned longunsigned longstruct pt_regs *
0x79sys_setdomainnamechar __user *nameint len---
0x7asys_newunamestruct new_utsname __user *name----
0x7bsys_modify_ldtintvoid __user *unsigned long--
0x7csys_adjtimexstruct timex __user *txc_p----
0x7dsys_mprotectunsigned long startsize_t lenunsigned long prot--
0x7esys_sigprocmaskint howold_sigset_t __user *setold_sigset_t __user *oset--
0x7fnot implemented-----
0x80sys_init_modulevoid __user *umodunsigned long lenconst char __user *uargs--
0x81sys_delete_moduleconst char __user *name_userunsigned int flags---
0x82not implemented-----
0x83sys_quotactlunsigned int cmdconst char __user *specialqid_t idvoid __user *addr-
0x84sys_getpgidpid_t pid----
0x85sys_fchdirunsigned int fd----
0x86sys_bdflushint funclong data---
0x87sys_sysfsint optionunsigned long arg1unsigned long arg2--
0x88sys_personalityunsigned int personality----
0x89not implemented-----
0x8asys_setfsuid16old_uid_t uid----
0x8bsys_setfsgid16old_gid_t gid----
0x8csys_llseekunsigned int fdunsigned long offset_highunsigned long offset_lowloff_t __user *resultunsigned int origin
0x8dsys_getdentsunsigned int fdstruct linux_dirent __user *direntunsigned int count--
0x8esys_selectint nfd_set __user *inpfd_set __user *outpfd_set __user *expstruct timeval __user *tvp
0x8fsys_flockunsigned int fdunsigned int cmd---
0x90sys_msyncunsigned long startsize_t lenint flags--
0x91sys_readvunsigned long fdconst struct iovec __user *vecunsigned long vlen--
0x92sys_writevunsigned long fdconst struct iovec __user *vecunsigned long vlen--
0x93sys_getsidpid_t pid----
0x94sys_fdatasyncunsigned int fd----
0x95sys_sysctlstruct __sysctl_args __user *args----
0x96sys_mlockunsigned long startsize_t len---
0x97sys_munlockunsigned long startsize_t len---
0x98sys_mlockallint flags----
0x99sys_munlockall-----
0x9asys_sched_setparampid_t pidstruct sched_param __user *param---
0x9bsys_sched_getparampid_t pidstruct sched_param __user *param---
0x9csys_sched_setschedulerpid_t pidint policystruct sched_param __user *param--
0x9dsys_sched_getschedulerpid_t pid----
0x9esys_sched_yield-----
0x9fsys_sched_get_priority_maxint policy----
0xa0sys_sched_get_priority_minint policy----
0xa1sys_sched_rr_get_intervalpid_t pidstruct timespec __user *interval---
0xa2sys_nanosleepstruct timespec __user *rqtpstruct timespec __user *rmtp---
0xa3sys_mremapunsigned long addrunsigned long old_lenunsigned long new_lenunsigned long flagsunsigned long new_addr
0xa4sys_setresuid16old_uid_t ruidold_uid_t euidold_uid_t suid--
0xa5sys_getresuid16old_uid_t __user *ruidold_uid_t __user *euidold_uid_t __user *suid--
0xa6sys_vm86unsigned longunsigned longstruct pt_regs *--
0xa7not implemented-----
0xa8sys_pollstruct pollfd __user *ufdsunsigned int nfdslong timeout--
0xa9sys_nfsservctlint cmdstruct nfsctl_arg __user *argvoid __user *res--
0xaasys_setresgid16old_gid_t rgidold_gid_t egidold_gid_t sgid--
0xabsys_getresgid16old_gid_t __user *rgidold_gid_t __user *egidold_gid_t __user *sgid--
0xacsys_prctlint optionunsigned long arg2unsigned long arg3unsigned long arg4unsigned long arg5
0xadsys_rt_sigreturnstruct pt_regs *----
0xaesys_rt_sigactionint sigconst struct sigaction __user *actstruct sigaction __user *oactsize_t sigsetsize-
0xafsys_rt_sigprocmaskint howsigset_t __user *setsigset_t __user *osetsize_t sigsetsize-
0xb0sys_rt_sigpendingsigset_t __user *setsize_t sigsetsize---
0xb1sys_rt_sigtimedwaitconst sigset_t __user *uthesesiginfo_t __user *uinfoconst struct timespec __user *utssize_t sigsetsize-
0xb2sys_rt_sigqueueinfoint pidint sigsiginfo_t __user *uinfo--
0xb3sys_rt_sigsuspendsigset_t __user *unewsetsize_t sigsetsize---
0xb4sys_pread64unsigned int fdchar __user *bufsize_t countloff_t pos-
0xb5sys_pwrite64unsigned int fdconst char __user *bufsize_t countloff_t pos-
0xb6sys_chown16const char __user *filenameold_uid_t userold_gid_t group--
0xb7sys_getcwdchar __user *bufunsigned long size---
0xb8sys_capgetcap_user_header_t headercap_user_data_t dataptr---
0xb9sys_capsetcap_user_header_t headerconst cap_user_data_t data---
0xbasys_sigaltstackconst stack_t __user *stack_t __user *struct pt_regs *--
0xbbsys_sendfileint out_fdint in_fdoff_t __user *offsetsize_t count-
0xbcnot implemented-----
0xbdnot implemented-----
0xbesys_vforkstruct pt_regs *----
0xbfsys_getrlimitunsigned int resourcestruct rlimit __user *rlim---
0xc0sys_mmap_pgoff-----
0xc1sys_truncate64const char __user *pathloff_t length---
0xc2sys_ftruncate64unsigned int fdloff_t length---
0xc3sys_stat64char __user *filenamestruct stat64 __user *statbuf---
0xc4sys_lstat64char __user *filenamestruct stat64 __user *statbuf---
0xc5sys_fstat64unsigned long fdstruct stat64 __user *statbuf---
0xc6sys_lchownconst char __user *filenameuid_t usergid_t group--
0xc7sys_getuid-----
0xc8sys_getgid-----
0xc9sys_geteuid-----
0xcasys_getegid-----
0xcbsys_setreuiduid_t ruiduid_t euid---
0xccsys_setregidgid_t rgidgid_t egid---
0xcdsys_getgroupsint gidsetsizegid_t __user *grouplist---
0xcesys_setgroupsint gidsetsizegid_t __user *grouplist---
0xcfsys_fchownunsigned int fduid_t usergid_t group--
0xd0sys_setresuiduid_t ruiduid_t euiduid_t suid--
0xd1sys_getresuiduid_t __user *ruiduid_t __user *euiduid_t __user *suid--
0xd2sys_setresgidgid_t rgidgid_t egidgid_t sgid--
0xd3sys_getresgidgid_t __user *rgidgid_t __user *egidgid_t __user *sgid--
0xd4sys_chownconst char __user *filenameuid_t usergid_t group--
0xd5sys_setuiduid_t uid----
0xd6sys_setgidgid_t gid----
0xd7sys_setfsuiduid_t uid----
0xd8sys_setfsgidgid_t gid----
0xd9sys_pivot_rootconst char __user *new_rootconst char __user *put_old---
0xdasys_mincoreunsigned long startsize_t lenunsigned char __user * vec--
0xdbsys_madviseunsigned long startsize_t lenint behavior--
0xdcsys_getdents64unsigned int fdstruct linux_dirent64 __user *direntunsigned int count--
0xddsys_fcntl64unsigned int fdunsigned int cmdunsigned long arg--
0xdenot implemented-----
0xdfnot implemented-----
0xe0sys_gettid-----
0xe1sys_readaheadint fdloff_t offsetsize_t count--
0xe2sys_setxattrconst char __user *pathconst char __user *nameconst void __user *valuesize_t sizeint flags
0xe3sys_lsetxattrconst char __user *pathconst char __user *nameconst void __user *valuesize_t sizeint flags
0xe4sys_fsetxattrint fdconst char __user *nameconst void __user *valuesize_t sizeint flags
0xe5sys_getxattrconst char __user *pathconst char __user *namevoid __user *valuesize_t size-
0xe6sys_lgetxattrconst char __user *pathconst char __user *namevoid __user *valuesize_t size-
0xe7sys_fgetxattrint fdconst char __user *namevoid __user *valuesize_t size-
0xe8sys_listxattrconst char __user *pathchar __user *listsize_t size--
0xe9sys_llistxattrconst char __user *pathchar __user *listsize_t size--
0xeasys_flistxattrint fdchar __user *listsize_t size--
0xebsys_removexattrconst char __user *pathconst char __user *name---
0xecsys_lremovexattrconst char __user *pathconst char __user *name---
0xedsys_fremovexattrint fdconst char __user *name---
0xeesys_tkillint pidint sig---
0xefsys_sendfile64int out_fdint in_fdloff_t __user *offsetsize_t count-
0xf0sys_futex-----
0xf1sys_sched_setaffinitypid_t pidunsigned int lenunsigned long __user *user_mask_ptr--
0xf2sys_sched_getaffinitypid_t pidunsigned int lenunsigned long __user *user_mask_ptr--
0xf3sys_set_thread_areastruct user_desc __user *----
0xf4sys_get_thread_areastruct user_desc __user *----
0xf5sys_io_setupunsigned nr_reqsaio_context_t __user *ctx---
0xf6sys_io_destroyaio_context_t ctx----
0xf7sys_io_geteventsaio_context_t ctx_idlong min_nrlong nrstruct io_event __user *eventsstruct timespec __user *timeout
0xf8sys_io_submitaio_context_tlongstruct iocb  user * \ user *--
0xf9sys_io_cancelaio_context_t ctx_idstruct iocb __user *iocbstruct io_event __user *result--
0xfasys_fadvise64int fdloff_t offsetsize_t lenint advice-
0xfbnot implemented-----
0xfcsys_exit_groupint error_code----
0xfdsys_lookup_dcookieu64 cookie64char __user *bufsize_t len--
0xfesys_epoll_createint size----
0xffsys_epoll_ctlint epfdint opint fdstruct epoll_event __user *event-
0x100sys_epoll_waitint epfdstruct epoll_event __user *eventsint maxeventsint timeout-
0x101sys_remap_file_pagesunsigned long startunsigned long sizeunsigned long protunsigned long pgoffunsigned long flags
0x102sys_set_tid_addressint __user *tidptr----
0x103sys_timer_createclockid_t which_clockstruct sigevent __user *timer_event_spectimer_t __user * created_timer_id--
0x104sys_timer_settimetimer_t timer_idint flagsconst struct itimerspec __user *new_settingstruct itimerspec __user *old_setting-
0x105sys_timer_gettimetimer_t timer_idstruct itimerspec __user *setting---
0x106sys_timer_getoverruntimer_t timer_id----
0x107sys_timer_deletetimer_t timer_id----
0x108sys_clock_settimeclockid_t which_clockconst struct timespec __user *tp---
0x109sys_clock_gettimeclockid_t which_clockstruct timespec __user *tp---
0x10asys_clock_getresclockid_t which_clockstruct timespec __user *tp---
0x10bsys_clock_nanosleepclockid_t which_clockint flagsconst struct timespec __user *rqtpstruct timespec __user *rmtp-
0x10csys_statfs64const char __user *pathsize_t szstruct statfs64 __user *buf--
0x10dsys_fstatfs64unsigned int fdsize_t szstruct statfs64 __user *buf--
0x10esys_tgkillint tgidint pidint sig--
0x10fsys_utimeschar __user *filenamestruct timeval __user *utimes---
0x110sys_fadvise64_64int fdloff_t offsetloff_t lenint advice-
0x111not implemented-----
0x112sys_mbind-----
0x113sys_get_mempolicyint __user *policyunsigned long __user *nmaskunsigned long maxnodeunsigned long addrunsigned long flags
0x114sys_set_mempolicyint modeunsigned long __user *nmaskunsigned long maxnode--
0x115sys_mq_openconst char __user *nameint oflagmode_t modestruct mq_attr __user *attr-
0x116sys_mq_unlinkconst char __user *name----
0x117sys_mq_timedsendmqd_t mqdesconst char __user *msg_ptrsize_t msg_lenunsigned int msg_prioconst struct timespec __user *abs_timeout
0x118sys_mq_timedreceivemqd_t mqdeschar __user *msg_ptrsize_t msg_lenunsigned int __user *msg_prioconst struct timespec __user *abs_timeout
0x119sys_mq_notifymqd_t mqdesconst struct sigevent __user *notification---
0x11asys_mq_getsetattrmqd_t mqdesconst struct mq_attr __user *mqstatstruct mq_attr __user *omqstat--
0x11bsys_kexec_loadunsigned long entryunsigned long nr_segmentsstruct kexec_segment __user *segmentsunsigned long flags-
0x11csys_waitidint whichpid_t pidstruct siginfo __user *infopint optionsstruct rusage __user *ru
0x11dnot implemented-----
0x11esys_add_keyconst char __user *_typeconst char __user *_descriptionconst void __user *_payloadsize_t plenkey_serial_t destringid
0x11fsys_request_keyconst char __user *_typeconst char __user *_descriptionconst char __user *_callout_infokey_serial_t destringid-
0x120sys_keyctlint cmdunsigned long arg2unsigned long arg3unsigned long arg4unsigned long arg5
0x121sys_ioprio_setint whichint whoint ioprio--
0x122sys_ioprio_getint whichint who---
0x123sys_inotify_init-----
0x124sys_inotify_add_watchint fdconst char __user *pathu32 mask--
0x125sys_inotify_rm_watchint fd__s32 wd---
0x126sys_migrate_pagespid_t pidunsigned long maxnodeconst unsigned long __user *fromconst unsigned long __user *to-
0x127sys_openatint dfdconst char __user *filenameint flagsint mode-
0x128sys_mkdiratint dfdconst char __user * pathnameint mode--
0x129sys_mknodatint dfdconst char __user * filenameint modeunsigned dev-
0x12asys_fchownatint dfdconst char __user *filenameuid_t usergid_t groupint flag
0x12bsys_futimesatint dfdchar __user *filenamestruct timeval __user *utimes--
0x12csys_fstatat64int dfdchar __user *filenamestruct stat64 __user *statbufint flag-
0x12dsys_unlinkatint dfdconst char __user * pathnameint flag--
0x12esys_renameatint olddfdconst char __user * oldnameint newdfdconst char __user * newname-
0x12fsys_linkatint olddfdconst char __user *oldnameint newdfdconst char __user *newnameint flags
0x130sys_symlinkatconst char __user * oldnameint newdfdconst char __user * newname--
0x131sys_readlinkatint dfdconst char __user *pathchar __user *bufint bufsiz-
0x132sys_fchmodatint dfdconst char __user * filenamemode_t mode--
0x133sys_faccessatint dfdconst char __user *filenameint mode--
0x134sys_pselect6-----
0x135sys_ppollstruct pollfd __user *ufdsunsigned int nfdsstruct timespec __user *tspconst sigset_t __user *sigmasksize_t sigsetsize
0x136sys_unshareunsigned long unshare_flags----
0x137sys_set_robust_liststruct robust_list_head __user *headsize_t len---
0x138sys_get_robust_listint pidstruct robust_list_head  user * \ user *head_ptrsize_t __user *len_ptr--
0x139sys_splice-----
0x13asys_sync_file_rangeint fdloff_t offsetloff_t nbytesunsigned int flags-
0x13bsys_teeint fdinint fdoutsize_t lenunsigned int flags-
0x13csys_vmspliceint fdconst struct iovec __user *iovunsigned long nr_segsunsigned int flags-
0x13dsys_move_pages-----
0x13esys_getcpuunsigned __user *cpuunsigned __user *nodestruct getcpu_cache __user *cache--
0x13fsys_epoll_pwait-----
0x140sys_utimensatint dfdchar __user *filenamestruct timespec __user *utimesint flags-
0x141sys_signalfdint ufdsigset_t __user *user_masksize_t sizemask--
0x142sys_timerfd_createint clockidint flags---
0x143sys_eventfdunsigned int count----
0x144sys_fallocateint fdint modeloff_t offsetloff_t len-
0x145sys_timerfd_settimeint ufdint flagsconst struct itimerspec __user *utmrstruct itimerspec __user *otmr-
0x146sys_timerfd_gettimeint ufdstruct itimerspec __user *otmr---
0x147sys_signalfd4int ufdsigset_t __user *user_masksize_t sizemaskint flags-
0x148sys_eventfd2unsigned int countint flags---
0x149sys_epoll_create1int flags----
0x14asys_dup3unsigned int oldfdunsigned int newfdint flags--
0x14bsys_pipe2int __user *fildesint flags---
0x14csys_inotify_init1int flags----
0x14dsys_preadvunsigned long fdconst struct iovec __user *vecunsigned long vlenunsigned long pos_lunsigned long pos_h
0x14esys_pwritevunsigned long fdconst struct iovec __user *vecunsigned long vlenunsigned long pos_lunsigned long pos_h
0x14fsys_rt_tgsigqueueinfopid_t tgidpid_t pidint sigsiginfo_t __user *uinfo-
0x150sys_perf_event_openstruct perf_event_attr __user *attr_uptrpid_t pidint cpuint group_fdunsigned long flags
0x151sys_recvmmsgint fdstruct mmsghdr __user *msgunsigned int vlenunsigned flagsstruct timespec __user *timeout

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注