├── Readme.md ├── basic ├── chapter1 │ ├── hello │ └── hello.S ├── chapter2 │ ├── io │ └── io.S ├── chapter3 │ ├── conjump │ └── conjump.S ├── chapter4 │ ├── array │ └── array.S ├── chapter5 │ └── loop.S └── readme.md ├── case-study ├── print-your-name-dinamic │ ├── answer │ ├── answer.S │ └── question.txt ├── print-your-name-static │ ├── answer │ ├── answer.S │ └── question.txt └── readme.md ├── easy └── readme.md ├── expert └── readme.md ├── hard └── readme.md ├── medium └── readme.md ├── modul-learning-ASM-fundamental ├── application-binary-interface │ ├── PDF │ │ └── x86-64-psABI-1.0.pdf │ └── readme.md ├── learn-path.md ├── readme.md └── syscall │ ├── readme.md │ ├── syscall32_Arch.txt │ └── syscall64_Arch.txt ├── modul-learning-CTF-hacking └── readme.md ├── notes └── Basic syscall ├── simple-shellcode ├── hello-shellcode │ └── hello_shellcode.c └── readme.md └── testing ├── readme.md ├── sandbox_test ├── learn └── learn_sample.S └── simple_shellcode ├── hello └── hello.S /Readme.md: -------------------------------------------------------------------------------- 1 | ![Image by Educba](https://cdn.educba.com/academy/wp-content/uploads/2019/10/Assembly-Language-vs-Machine-Language-1.png.webp "Image by Educba") 2 | 3 | # About 4 | 5 | This is my journey for learn asm, asm is hard. You must strong in logic, debug skill, arch and basic code like C,PHP, PYTHON, C++ and anything you can learn on this repo 6 | 7 | ## How to compile 8 | 9 | > gcc -static -nostartfiles fileasm -o resultnamecompile 10 | > 11 | > Ex: 12 | > 13 | > gcc -static -nostartfiles conjump.S -o conjump 14 | 15 | ## Tools or tips for debug 16 | 17 | - Gdb 18 | - Ghidra 19 | - Gef 20 | - Linux user manual 21 | - Objdump 22 | - https://godbolt.org/ 23 | 24 | ## Contribute 25 | 26 | You can join and contribute, you can add paths or folders to your categories. For example Basic, Intermediate, Difficult, Very difficult, CTF, Shellcode or in the form of a learning book (Guide learn for asm) 27 | 28 | > Example 29 | > 30 | > There folder name easy. You can make new folder with title, for example easy folder->if else in asm (name folder). In this folder there are file asm, result compile 31 | > 32 | > You can add on folder category, please describe name file and in note or comment in your code 33 | > 34 | 35 | Thank you :D 36 | 37 | ## Thanks to 38 | 39 | - [Ammar Faizi](https://github.com/ammarfaizi2) 40 | -------------------------------------------------------------------------------- /basic/chapter1/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/basic/chapter1/hello -------------------------------------------------------------------------------- /basic/chapter1/hello.S: -------------------------------------------------------------------------------- 1 | // Static variabel rw- 2 | .section .data 3 | my_str: 4 | .asciz "Hello World!\n" 5 | 6 | // The default permission of .text section is r-x. 7 | .section .text 8 | 9 | .global _start 10 | 11 | _start: 12 | // NOTE 13 | 14 | /* 15 | movb : byte = 8bit 16 | movw : word = 16bit 17 | movl : long or dword = 32bit 18 | movq : qword = 64bit 19 | 20 | movl, subq, any are instructions and have example operands. Register, Immediate, Memory 21 | $1 is Immediate 22 | %eax Register 23 | label(%rip) Memory 24 | */ 25 | 26 | movl $1, %eax 27 | movl $1, %edi 28 | leaq my_str(%rip), %rsi 29 | movl $13, %edx 30 | syscall 31 | 32 | movl $60, %eax 33 | xorl %edi, %edi 34 | syscall 35 | -------------------------------------------------------------------------------- /basic/chapter2/io: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/basic/chapter2/io -------------------------------------------------------------------------------- /basic/chapter2/io.S: -------------------------------------------------------------------------------- 1 | .section .data 2 | 3 | my_str: 4 | .asciz "Input text : " 5 | 6 | .section .text 7 | 8 | .global _start 9 | 10 | _start: 11 | 12 | /* 13 | Note 14 | 15 | subq = subtract 16 | 17 | subb = byte = 8bit 18 | subw = word = 16bit 19 | subl = long or dword = 32bit 20 | subq = qword = 64bit 21 | 22 | */ 23 | 24 | movl $1, %eax 25 | movl $1, %edi 26 | leaq my_str(%rip), %rsi 27 | movl $13, %edx 28 | syscall 29 | 30 | subq $10000, %rsp // $10000 (Immediate) length for buffer 31 | movl $0, %eax 32 | movl $0, %edi 33 | leaq (%rsp), %rsi 34 | movl $10000, %edx 35 | syscall 36 | 37 | movl %eax, %edx 38 | movl $1, %eax 39 | leaq (%rsp), %rsi 40 | movl $1, %edi 41 | syscall 42 | 43 | movl $60, %eax 44 | movl $0, %edi 45 | syscall 46 | -------------------------------------------------------------------------------- /basic/chapter3/conjump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/basic/chapter3/conjump -------------------------------------------------------------------------------- /basic/chapter3/conjump.S: -------------------------------------------------------------------------------- 1 | .section .data 2 | my_str: 3 | .asciz "Input number : " 4 | str_satu: 5 | .ascii "Number one\n" 6 | str_dua: 7 | .ascii "Number two\n" 8 | str_tiga: 9 | .ascii "Number there\n" 10 | str_empat: 11 | .ascii "Number four\n" 12 | str_end: 13 | str_else: 14 | .ascii "Not found\n" 15 | 16 | .section .text 17 | 18 | .global _start 19 | 20 | _start: 21 | 22 | movl $1, %eax 23 | movl $1, %edi 24 | leaq my_str(%rip), %rsi 25 | movl $15, %edx 26 | syscall 27 | 28 | subq $100, %rsp 29 | movl $0, %eax 30 | movl $0, %edi 31 | leaq (%rsp), %rsi 32 | movl $100, %edx 33 | syscall 34 | 35 | cmpb $'1', (%rsp) 36 | je satu 37 | 38 | cmpb $'2', (%rsp) 39 | je dua 40 | 41 | cmpb $'3', (%rsp) 42 | je tiga 43 | 44 | cmpb $'4', (%rsp) 45 | je empat 46 | 47 | leaq str_else(%rip), %rsi 48 | movl $10, %edx 49 | jmp do_write 50 | 51 | 52 | satu: 53 | leaq str_satu(%rip), %rsi 54 | movl $(str_dua - str_satu), %edx 55 | jmp do_write 56 | 57 | dua: 58 | leaq str_dua(%rip), %rsi 59 | movl $(str_tiga - str_dua), %edx 60 | jmp do_write 61 | 62 | tiga: 63 | leaq str_tiga(%rip), %rsi 64 | movl $(str_empat - str_tiga), %edx 65 | jmp do_write 66 | 67 | empat: 68 | leaq str_empat(%rip), %rsi 69 | movl $(str_end - str_empat), %edx 70 | 71 | do_write: 72 | movl $1, %eax 73 | movl $1, %edi 74 | syscall 75 | 76 | jmp _start 77 | -------------------------------------------------------------------------------- /basic/chapter4/array: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/basic/chapter4/array -------------------------------------------------------------------------------- /basic/chapter4/array.S: -------------------------------------------------------------------------------- 1 | .section .data 2 | 3 | .var1: .asciz "AAAA" 4 | .var2: .asciz "BBBB" 5 | .var3: .asciz "CCCC" 6 | 7 | my_array: .quad .var1, .var2, .var3 8 | 9 | .section .text 10 | 11 | .global _start 12 | 13 | _start: 14 | xorl %ebp, %ebp 15 | leaq my_array(%rip), %r9 16 | subq $1, %rsp 17 | movl $10, (%rsp) 18 | .Loop: 19 | movq (%r9, %rbp, 8), %rsi 20 | movl $4, %edx 21 | movl $1, %eax 22 | movl $1, %edi 23 | syscall 24 | 25 | movq %rsp, %rsi 26 | movl $1, %edx 27 | movl $1, %eax 28 | movl $1, %edi 29 | syscall 30 | 31 | addl $1, %ebp 32 | cmpl $3, %ebp 33 | jl .Loop 34 | 35 | movl $60, %eax 36 | movl $0, %edi 37 | syscall 38 | -------------------------------------------------------------------------------- /basic/chapter5/loop.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/basic/chapter5/loop.S -------------------------------------------------------------------------------- /basic/readme.md: -------------------------------------------------------------------------------- 1 | ## Basic learn ASM 2 | 3 | > This is first basic asm programming language. You can learn or contribute on this path! 4 | > 5 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 6 | 7 | ## How to compile 8 | 9 | > gcc -static -nostartfiles fileasm -o resultnamecompile 10 | > 11 | > Ex: 12 | > 13 | > gcc -static -nostartfiles conjump.S -o conjump 14 | -------------------------------------------------------------------------------- /case-study/print-your-name-dinamic/answer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/case-study/print-your-name-dinamic/answer -------------------------------------------------------------------------------- /case-study/print-your-name-dinamic/answer.S: -------------------------------------------------------------------------------- 1 | .section .data 2 | my_input: 3 | .asciz "Input name : " 4 | 5 | .section .text 6 | 7 | .global _start 8 | 9 | _start: 10 | 11 | movl $1, %eax 12 | movl $1, %edi 13 | leaq my_input(%rip), %rsi 14 | movl $13, %edx 15 | syscall 16 | 17 | subq $10000, %rsp 18 | movl $0, %eax 19 | movl $0, %edi 20 | leaq (%rsp), %rsi 21 | movl $10000, %edx 22 | syscall 23 | 24 | movl %eax, %edx 25 | movl $1, %eax 26 | leaq (%rsp), %rsi 27 | movl $1, %edi 28 | syscall 29 | 30 | movl $60, %eax 31 | movl $0, %edi 32 | syscall 33 | -------------------------------------------------------------------------------- /case-study/print-your-name-dinamic/question.txt: -------------------------------------------------------------------------------- 1 | 1. Print your name using assembly dinamic or input output! 2 | -------------------------------------------------------------------------------- /case-study/print-your-name-static/answer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/case-study/print-your-name-static/answer -------------------------------------------------------------------------------- /case-study/print-your-name-static/answer.S: -------------------------------------------------------------------------------- 1 | .section .data 2 | my_name: 3 | .asciz "Suyab89\n" 4 | 5 | .section .text 6 | 7 | .global _start 8 | 9 | _start: 10 | 11 | movl $1, %eax 12 | movl $1, %edi 13 | leaq my_name(%rip), %rsi 14 | movl $8, %edx 15 | syscall 16 | 17 | movl $60, %eax 18 | xorl %edi, %edi 19 | syscall 20 | -------------------------------------------------------------------------------- /case-study/print-your-name-static/question.txt: -------------------------------------------------------------------------------- 1 | 1. Print your name using assembly static or on variabel! 2 | -------------------------------------------------------------------------------- /case-study/readme.md: -------------------------------------------------------------------------------- 1 | ## Case study learn ASM 2 | 3 | > This is first case study asm programming language. You can learn or contribute on this path! 4 | > 5 | > There are some question and answer on this path 6 | > 7 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 8 | 9 | ## How to compile 10 | 11 | > gcc -static -nostartfiles fileasm -o resultnamecompile 12 | > 13 | > Ex: 14 | > 15 | > gcc -static -nostartfiles conjump.S -o conjump 16 | -------------------------------------------------------------------------------- /easy/readme.md: -------------------------------------------------------------------------------- 1 | ## Basic easy learn ASM 2 | 3 | > This is first easy asm programming language. You can learn or contribute on this path! 4 | > 5 | > Soon i add new 6 | > 7 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 8 | 9 | ## How to compile 10 | 11 | > gcc -static -nostartfiles fileasm -o resultnamecompile 12 | > 13 | > Ex: 14 | > 15 | > gcc -static -nostartfiles conjump.S -o conjump 16 | -------------------------------------------------------------------------------- /expert/readme.md: -------------------------------------------------------------------------------- 1 | ## Expert learn ASM 2 | 3 | > This is first expert asm programming language. You can learn or contribute on this path! 4 | > 5 | > Soon i add new 6 | > 7 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 8 | 9 | ## How to compile 10 | 11 | > gcc -static -nostartfiles fileasm -o resultnamecompile 12 | > 13 | > Ex: 14 | > 15 | > gcc -static -nostartfiles conjump.S -o conjump 16 | -------------------------------------------------------------------------------- /hard/readme.md: -------------------------------------------------------------------------------- 1 | ## Hard learn ASM 2 | 3 | > This is first hard asm programming language. You can learn or contribute on this path! 4 | > 5 | > Soon i add new 6 | > 7 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 8 | 9 | ## How to compile 10 | 11 | > gcc -static -nostartfiles fileasm -o resultnamecompile 12 | > 13 | > Ex: 14 | > 15 | > gcc -static -nostartfiles conjump.S -o conjump 16 | -------------------------------------------------------------------------------- /medium/readme.md: -------------------------------------------------------------------------------- 1 | ## Medium learn ASM 2 | 3 | > This is first medium asm programming language. You can learn or contribute on this path! 4 | > 5 | > Soon i add new 6 | > 7 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 8 | 9 | ## How to compile 10 | 11 | > gcc -static -nostartfiles fileasm -o resultnamecompile 12 | > 13 | > Ex: 14 | > 15 | > gcc -static -nostartfiles conjump.S -o conjump 16 | -------------------------------------------------------------------------------- /modul-learning-ASM-fundamental/application-binary-interface/PDF/x86-64-psABI-1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/modul-learning-ASM-fundamental/application-binary-interface/PDF/x86-64-psABI-1.0.pdf -------------------------------------------------------------------------------- /modul-learning-ASM-fundamental/application-binary-interface/readme.md: -------------------------------------------------------------------------------- 1 | ## psabi (application binary interface) 2 | 3 | > ABI defines how data structures or computational routines are accessed in machine code, which is a low-level, hardware-dependent format. 4 | > 5 | > Learn more at 6 | > 7 | > https://en.wikipedia.org/wiki/Application_binary_interface 8 | > 9 | > https://refspecs.linuxfoundation.org/elf/IA64-SysV-psABI.pdf 10 | > 11 | > https://gitlab.com/x86-psABIs/x86-64-ABI 12 | > 13 | > https://courses.cs.washington.edu/courses/cse481a/20sp/notes/psabi.pdf 14 | 15 | 16 | ## Note 17 | 18 | > I will add some new soon, ASAP.... 19 | -------------------------------------------------------------------------------- /modul-learning-ASM-fundamental/learn-path.md: -------------------------------------------------------------------------------- 1 | # Path for learn 2 | 3 | ## Intel software ISA documentation 4 | 5 | - https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html 6 | 7 | ## ASM guides or tutorials 8 | 9 | - https://www.tutorialspoint.com/assembly_programming/index.htm 10 | 11 | ## ASM syntax rule 12 | 13 | - https://staffwww.fullcoll.edu/aclifton/courses/cs241/syntax.html 14 | 15 | ## Syscall 16 | 17 | - https://github.com/torvalds/linux/blob/master/arch/x86/entry/syscalls/syscall_64.tbl 18 | - https://github.com/torvalds/linux/tree/master/arch/x86/entry/syscalls 19 | 20 | ## Handbook 21 | 22 | - https://gitlab.com/x86-psABIs/i386-ABI 23 | 24 | ## x86 and amd64 instruction reference 25 | 26 | - https://www.felixcloutier.com/x86/ 27 | 28 | ## CPU register x86-64 29 | 30 | - https://wiki.osdev.org/CPU_Registers_x86-64 31 | 32 | ## X86-64 Architecture Guide 33 | 34 | - http://6.s081.scripts.mit.edu/sp18/x86-64-architecture-guide.html 35 | - http://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf 36 | 37 | ## Computer architecture 38 | 39 | - https://online.sunderland.ac.uk/what-is-computer-architecture/ 40 | 41 | ## Memory Hierarchy 42 | 43 | - https://www.geeksforgeeks.org/memory-hierarchy-design-and-its-characteristics/ 44 | - https://www.tutorialspoint.com/what-is-memory-hierarchy 45 | - https://en.wikipedia.org/wiki/Memory_hierarchy 46 | 47 | > Note: `If you have some modul, article or anyhting you can add this' 48 | -------------------------------------------------------------------------------- /modul-learning-ASM-fundamental/readme.md: -------------------------------------------------------------------------------- 1 | ## Modul learn ASM 2 | 3 | > This is first modul or e learn for asm programming language. You can learn or contribute on this path! 4 | > 5 | > Soon i add new 6 | > 7 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 8 | 9 | ## How to compile 10 | 11 | > gcc -static -nostartfiles fileasm -o resultnamecompile 12 | > 13 | > Ex: 14 | > 15 | > gcc -static -nostartfiles conjump.S -o conjump 16 | -------------------------------------------------------------------------------- /modul-learning-ASM-fundamental/syscall/readme.md: -------------------------------------------------------------------------------- 1 | ## syscall 2 | 3 | > A system call (commonly abbreviated to syscall) is the programmatic way in which a computer program requests a service from the kernel of the operating system on which it is executed 4 | > 5 | > Learn more at 6 | > 7 | > https://en.wikipedia.org/wiki/System_call 8 | > 9 | > https://www.geeksforgeeks.org/introduction-of-system-call/ 10 | > 11 | > https://w3.cs.jmu.edu/kirkpams/OpenCSF/Books/csf/html/Syscall.html 12 | > 13 | > https://man7.org/linux/man-pages/ 14 | 15 | ## Note 16 | 17 | > Only Linux syscall, not for Windows and Mac OS 18 | > 19 | > I will add some new soon, ASAP.... 20 | -------------------------------------------------------------------------------- /modul-learning-ASM-fundamental/syscall/syscall32_Arch.txt: -------------------------------------------------------------------------------- 1 | # --- START --- 2 | # This file i copied from https://github.com/torvalds/linux/blob/master/arch/x86/entry/syscalls/syscall_32.tbl 3 | # I make for my shortcut 4 | # --- END --- 5 | # 32-bit system call numbers and entry vectors 6 | # 7 | # The format is: 8 | # 9 | # 10 | # The __ia32_sys and __ia32_compat_sys stubs are created on-the-fly for 11 | # sys_*() system calls and compat_sys_*() compat system calls if 12 | # IA32_EMULATION is defined, and expect struct pt_regs *regs as their only 13 | # parameter. 14 | # 15 | # The abi is always "i386" for this file. 16 | # 17 | 0 i386 restart_syscall sys_restart_syscall 18 | 1 i386 exit sys_exit 19 | 2 i386 fork sys_fork 20 | 3 i386 read sys_read 21 | 4 i386 write sys_write 22 | 5 i386 open sys_open compat_sys_open 23 | 6 i386 close sys_close 24 | 7 i386 waitpid sys_waitpid 25 | 8 i386 creat sys_creat 26 | 9 i386 link sys_link 27 | 10 i386 unlink sys_unlink 28 | 11 i386 execve sys_execve compat_sys_execve 29 | 12 i386 chdir sys_chdir 30 | 13 i386 time sys_time32 31 | 14 i386 mknod sys_mknod 32 | 15 i386 chmod sys_chmod 33 | 16 i386 lchown sys_lchown16 34 | 17 i386 break 35 | 18 i386 oldstat sys_stat 36 | 19 i386 lseek sys_lseek compat_sys_lseek 37 | 20 i386 getpid sys_getpid 38 | 21 i386 mount sys_mount 39 | 22 i386 umount sys_oldumount 40 | 23 i386 setuid sys_setuid16 41 | 24 i386 getuid sys_getuid16 42 | 25 i386 stime sys_stime32 43 | 26 i386 ptrace sys_ptrace compat_sys_ptrace 44 | 27 i386 alarm sys_alarm 45 | 28 i386 oldfstat sys_fstat 46 | 29 i386 pause sys_pause 47 | 30 i386 utime sys_utime32 48 | 31 i386 stty 49 | 32 i386 gtty 50 | 33 i386 access sys_access 51 | 34 i386 nice sys_nice 52 | 35 i386 ftime 53 | 36 i386 sync sys_sync 54 | 37 i386 kill sys_kill 55 | 38 i386 rename sys_rename 56 | 39 i386 mkdir sys_mkdir 57 | 40 i386 rmdir sys_rmdir 58 | 41 i386 dup sys_dup 59 | 42 i386 pipe sys_pipe 60 | 43 i386 times sys_times compat_sys_times 61 | 44 i386 prof 62 | 45 i386 brk sys_brk 63 | 46 i386 setgid sys_setgid16 64 | 47 i386 getgid sys_getgid16 65 | 48 i386 signal sys_signal 66 | 49 i386 geteuid sys_geteuid16 67 | 50 i386 getegid sys_getegid16 68 | 51 i386 acct sys_acct 69 | 52 i386 umount2 sys_umount 70 | 53 i386 lock 71 | 54 i386 ioctl sys_ioctl compat_sys_ioctl 72 | 55 i386 fcntl sys_fcntl compat_sys_fcntl64 73 | 56 i386 mpx 74 | 57 i386 setpgid sys_setpgid 75 | 58 i386 ulimit 76 | 59 i386 oldolduname sys_olduname 77 | 60 i386 umask sys_umask 78 | 61 i386 chroot sys_chroot 79 | 62 i386 ustat sys_ustat compat_sys_ustat 80 | 63 i386 dup2 sys_dup2 81 | 64 i386 getppid sys_getppid 82 | 65 i386 getpgrp sys_getpgrp 83 | 66 i386 setsid sys_setsid 84 | 67 i386 sigaction sys_sigaction compat_sys_sigaction 85 | 68 i386 sgetmask sys_sgetmask 86 | 69 i386 ssetmask sys_ssetmask 87 | 70 i386 setreuid sys_setreuid16 88 | 71 i386 setregid sys_setregid16 89 | 72 i386 sigsuspend sys_sigsuspend 90 | 73 i386 sigpending sys_sigpending compat_sys_sigpending 91 | 74 i386 sethostname sys_sethostname 92 | 75 i386 setrlimit sys_setrlimit compat_sys_setrlimit 93 | 76 i386 getrlimit sys_old_getrlimit compat_sys_old_getrlimit 94 | 77 i386 getrusage sys_getrusage compat_sys_getrusage 95 | 78 i386 gettimeofday sys_gettimeofday compat_sys_gettimeofday 96 | 79 i386 settimeofday sys_settimeofday compat_sys_settimeofday 97 | 80 i386 getgroups sys_getgroups16 98 | 81 i386 setgroups sys_setgroups16 99 | 82 i386 select sys_old_select compat_sys_old_select 100 | 83 i386 symlink sys_symlink 101 | 84 i386 oldlstat sys_lstat 102 | 85 i386 readlink sys_readlink 103 | 86 i386 uselib sys_uselib 104 | 87 i386 swapon sys_swapon 105 | 88 i386 reboot sys_reboot 106 | 89 i386 readdir sys_old_readdir compat_sys_old_readdir 107 | 90 i386 mmap sys_old_mmap compat_sys_ia32_mmap 108 | 91 i386 munmap sys_munmap 109 | 92 i386 truncate sys_truncate compat_sys_truncate 110 | 93 i386 ftruncate sys_ftruncate compat_sys_ftruncate 111 | 94 i386 fchmod sys_fchmod 112 | 95 i386 fchown sys_fchown16 113 | 96 i386 getpriority sys_getpriority 114 | 97 i386 setpriority sys_setpriority 115 | 98 i386 profil 116 | 99 i386 statfs sys_statfs compat_sys_statfs 117 | 100 i386 fstatfs sys_fstatfs compat_sys_fstatfs 118 | 101 i386 ioperm sys_ioperm 119 | 102 i386 socketcall sys_socketcall compat_sys_socketcall 120 | 103 i386 syslog sys_syslog 121 | 104 i386 setitimer sys_setitimer compat_sys_setitimer 122 | 105 i386 getitimer sys_getitimer compat_sys_getitimer 123 | 106 i386 stat sys_newstat compat_sys_newstat 124 | 107 i386 lstat sys_newlstat compat_sys_newlstat 125 | 108 i386 fstat sys_newfstat compat_sys_newfstat 126 | 109 i386 olduname sys_uname 127 | 110 i386 iopl sys_iopl 128 | 111 i386 vhangup sys_vhangup 129 | 112 i386 idle 130 | 113 i386 vm86old sys_vm86old sys_ni_syscall 131 | 114 i386 wait4 sys_wait4 compat_sys_wait4 132 | 115 i386 swapoff sys_swapoff 133 | 116 i386 sysinfo sys_sysinfo compat_sys_sysinfo 134 | 117 i386 ipc sys_ipc compat_sys_ipc 135 | 118 i386 fsync sys_fsync 136 | 119 i386 sigreturn sys_sigreturn compat_sys_sigreturn 137 | 120 i386 clone sys_clone compat_sys_ia32_clone 138 | 121 i386 setdomainname sys_setdomainname 139 | 122 i386 uname sys_newuname 140 | 123 i386 modify_ldt sys_modify_ldt 141 | 124 i386 adjtimex sys_adjtimex_time32 142 | 125 i386 mprotect sys_mprotect 143 | 126 i386 sigprocmask sys_sigprocmask compat_sys_sigprocmask 144 | 127 i386 create_module 145 | 128 i386 init_module sys_init_module 146 | 129 i386 delete_module sys_delete_module 147 | 130 i386 get_kernel_syms 148 | 131 i386 quotactl sys_quotactl 149 | 132 i386 getpgid sys_getpgid 150 | 133 i386 fchdir sys_fchdir 151 | 134 i386 bdflush sys_ni_syscall 152 | 135 i386 sysfs sys_sysfs 153 | 136 i386 personality sys_personality 154 | 137 i386 afs_syscall 155 | 138 i386 setfsuid sys_setfsuid16 156 | 139 i386 setfsgid sys_setfsgid16 157 | 140 i386 _llseek sys_llseek 158 | 141 i386 getdents sys_getdents compat_sys_getdents 159 | 142 i386 _newselect sys_select compat_sys_select 160 | 143 i386 flock sys_flock 161 | 144 i386 msync sys_msync 162 | 145 i386 readv sys_readv 163 | 146 i386 writev sys_writev 164 | 147 i386 getsid sys_getsid 165 | 148 i386 fdatasync sys_fdatasync 166 | 149 i386 _sysctl sys_ni_syscall 167 | 150 i386 mlock sys_mlock 168 | 151 i386 munlock sys_munlock 169 | 152 i386 mlockall sys_mlockall 170 | 153 i386 munlockall sys_munlockall 171 | 154 i386 sched_setparam sys_sched_setparam 172 | 155 i386 sched_getparam sys_sched_getparam 173 | 156 i386 sched_setscheduler sys_sched_setscheduler 174 | 157 i386 sched_getscheduler sys_sched_getscheduler 175 | 158 i386 sched_yield sys_sched_yield 176 | 159 i386 sched_get_priority_max sys_sched_get_priority_max 177 | 160 i386 sched_get_priority_min sys_sched_get_priority_min 178 | 161 i386 sched_rr_get_interval sys_sched_rr_get_interval_time32 179 | 162 i386 nanosleep sys_nanosleep_time32 180 | 163 i386 mremap sys_mremap 181 | 164 i386 setresuid sys_setresuid16 182 | 165 i386 getresuid sys_getresuid16 183 | 166 i386 vm86 sys_vm86 sys_ni_syscall 184 | 167 i386 query_module 185 | 168 i386 poll sys_poll 186 | 169 i386 nfsservctl 187 | 170 i386 setresgid sys_setresgid16 188 | 171 i386 getresgid sys_getresgid16 189 | 172 i386 prctl sys_prctl 190 | 173 i386 rt_sigreturn sys_rt_sigreturn compat_sys_rt_sigreturn 191 | 174 i386 rt_sigaction sys_rt_sigaction compat_sys_rt_sigaction 192 | 175 i386 rt_sigprocmask sys_rt_sigprocmask compat_sys_rt_sigprocmask 193 | 176 i386 rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending 194 | 177 i386 rt_sigtimedwait sys_rt_sigtimedwait_time32 compat_sys_rt_sigtimedwait_time32 195 | 178 i386 rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo 196 | 179 i386 rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend 197 | 180 i386 pread64 sys_ia32_pread64 198 | 181 i386 pwrite64 sys_ia32_pwrite64 199 | 182 i386 chown sys_chown16 200 | 183 i386 getcwd sys_getcwd 201 | 184 i386 capget sys_capget 202 | 185 i386 capset sys_capset 203 | 186 i386 sigaltstack sys_sigaltstack compat_sys_sigaltstack 204 | 187 i386 sendfile sys_sendfile compat_sys_sendfile 205 | 188 i386 getpmsg 206 | 189 i386 putpmsg 207 | 190 i386 vfork sys_vfork 208 | 191 i386 ugetrlimit sys_getrlimit compat_sys_getrlimit 209 | 192 i386 mmap2 sys_mmap_pgoff 210 | 193 i386 truncate64 sys_ia32_truncate64 211 | 194 i386 ftruncate64 sys_ia32_ftruncate64 212 | 195 i386 stat64 sys_stat64 compat_sys_ia32_stat64 213 | 196 i386 lstat64 sys_lstat64 compat_sys_ia32_lstat64 214 | 197 i386 fstat64 sys_fstat64 compat_sys_ia32_fstat64 215 | 198 i386 lchown32 sys_lchown 216 | 199 i386 getuid32 sys_getuid 217 | 200 i386 getgid32 sys_getgid 218 | 201 i386 geteuid32 sys_geteuid 219 | 202 i386 getegid32 sys_getegid 220 | 203 i386 setreuid32 sys_setreuid 221 | 204 i386 setregid32 sys_setregid 222 | 205 i386 getgroups32 sys_getgroups 223 | 206 i386 setgroups32 sys_setgroups 224 | 207 i386 fchown32 sys_fchown 225 | 208 i386 setresuid32 sys_setresuid 226 | 209 i386 getresuid32 sys_getresuid 227 | 210 i386 setresgid32 sys_setresgid 228 | 211 i386 getresgid32 sys_getresgid 229 | 212 i386 chown32 sys_chown 230 | 213 i386 setuid32 sys_setuid 231 | 214 i386 setgid32 sys_setgid 232 | 215 i386 setfsuid32 sys_setfsuid 233 | 216 i386 setfsgid32 sys_setfsgid 234 | 217 i386 pivot_root sys_pivot_root 235 | 218 i386 mincore sys_mincore 236 | 219 i386 madvise sys_madvise 237 | 220 i386 getdents64 sys_getdents64 238 | 221 i386 fcntl64 sys_fcntl64 compat_sys_fcntl64 239 | # 222 is unused 240 | # 223 is unused 241 | 224 i386 gettid sys_gettid 242 | 225 i386 readahead sys_ia32_readahead 243 | 226 i386 setxattr sys_setxattr 244 | 227 i386 lsetxattr sys_lsetxattr 245 | 228 i386 fsetxattr sys_fsetxattr 246 | 229 i386 getxattr sys_getxattr 247 | 230 i386 lgetxattr sys_lgetxattr 248 | 231 i386 fgetxattr sys_fgetxattr 249 | 232 i386 listxattr sys_listxattr 250 | 233 i386 llistxattr sys_llistxattr 251 | 234 i386 flistxattr sys_flistxattr 252 | 235 i386 removexattr sys_removexattr 253 | 236 i386 lremovexattr sys_lremovexattr 254 | 237 i386 fremovexattr sys_fremovexattr 255 | 238 i386 tkill sys_tkill 256 | 239 i386 sendfile64 sys_sendfile64 257 | 240 i386 futex sys_futex_time32 258 | 241 i386 sched_setaffinity sys_sched_setaffinity compat_sys_sched_setaffinity 259 | 242 i386 sched_getaffinity sys_sched_getaffinity compat_sys_sched_getaffinity 260 | 243 i386 set_thread_area sys_set_thread_area 261 | 244 i386 get_thread_area sys_get_thread_area 262 | 245 i386 io_setup sys_io_setup compat_sys_io_setup 263 | 246 i386 io_destroy sys_io_destroy 264 | 247 i386 io_getevents sys_io_getevents_time32 265 | 248 i386 io_submit sys_io_submit compat_sys_io_submit 266 | 249 i386 io_cancel sys_io_cancel 267 | 250 i386 fadvise64 sys_ia32_fadvise64 268 | # 251 is available for reuse (was briefly sys_set_zone_reclaim) 269 | 252 i386 exit_group sys_exit_group 270 | 253 i386 lookup_dcookie sys_lookup_dcookie compat_sys_lookup_dcookie 271 | 254 i386 epoll_create sys_epoll_create 272 | 255 i386 epoll_ctl sys_epoll_ctl 273 | 256 i386 epoll_wait sys_epoll_wait 274 | 257 i386 remap_file_pages sys_remap_file_pages 275 | 258 i386 set_tid_address sys_set_tid_address 276 | 259 i386 timer_create sys_timer_create compat_sys_timer_create 277 | 260 i386 timer_settime sys_timer_settime32 278 | 261 i386 timer_gettime sys_timer_gettime32 279 | 262 i386 timer_getoverrun sys_timer_getoverrun 280 | 263 i386 timer_delete sys_timer_delete 281 | 264 i386 clock_settime sys_clock_settime32 282 | 265 i386 clock_gettime sys_clock_gettime32 283 | 266 i386 clock_getres sys_clock_getres_time32 284 | 267 i386 clock_nanosleep sys_clock_nanosleep_time32 285 | 268 i386 statfs64 sys_statfs64 compat_sys_statfs64 286 | 269 i386 fstatfs64 sys_fstatfs64 compat_sys_fstatfs64 287 | 270 i386 tgkill sys_tgkill 288 | 271 i386 utimes sys_utimes_time32 289 | 272 i386 fadvise64_64 sys_ia32_fadvise64_64 290 | 273 i386 vserver 291 | 274 i386 mbind sys_mbind 292 | 275 i386 get_mempolicy sys_get_mempolicy 293 | 276 i386 set_mempolicy sys_set_mempolicy 294 | 277 i386 mq_open sys_mq_open compat_sys_mq_open 295 | 278 i386 mq_unlink sys_mq_unlink 296 | 279 i386 mq_timedsend sys_mq_timedsend_time32 297 | 280 i386 mq_timedreceive sys_mq_timedreceive_time32 298 | 281 i386 mq_notify sys_mq_notify compat_sys_mq_notify 299 | 282 i386 mq_getsetattr sys_mq_getsetattr compat_sys_mq_getsetattr 300 | 283 i386 kexec_load sys_kexec_load compat_sys_kexec_load 301 | 284 i386 waitid sys_waitid compat_sys_waitid 302 | # 285 sys_setaltroot 303 | 286 i386 add_key sys_add_key 304 | 287 i386 request_key sys_request_key 305 | 288 i386 keyctl sys_keyctl compat_sys_keyctl 306 | 289 i386 ioprio_set sys_ioprio_set 307 | 290 i386 ioprio_get sys_ioprio_get 308 | 291 i386 inotify_init sys_inotify_init 309 | 292 i386 inotify_add_watch sys_inotify_add_watch 310 | 293 i386 inotify_rm_watch sys_inotify_rm_watch 311 | 294 i386 migrate_pages sys_migrate_pages 312 | 295 i386 openat sys_openat compat_sys_openat 313 | 296 i386 mkdirat sys_mkdirat 314 | 297 i386 mknodat sys_mknodat 315 | 298 i386 fchownat sys_fchownat 316 | 299 i386 futimesat sys_futimesat_time32 317 | 300 i386 fstatat64 sys_fstatat64 compat_sys_ia32_fstatat64 318 | 301 i386 unlinkat sys_unlinkat 319 | 302 i386 renameat sys_renameat 320 | 303 i386 linkat sys_linkat 321 | 304 i386 symlinkat sys_symlinkat 322 | 305 i386 readlinkat sys_readlinkat 323 | 306 i386 fchmodat sys_fchmodat 324 | 307 i386 faccessat sys_faccessat 325 | 308 i386 pselect6 sys_pselect6_time32 compat_sys_pselect6_time32 326 | 309 i386 ppoll sys_ppoll_time32 compat_sys_ppoll_time32 327 | 310 i386 unshare sys_unshare 328 | 311 i386 set_robust_list sys_set_robust_list compat_sys_set_robust_list 329 | 312 i386 get_robust_list sys_get_robust_list compat_sys_get_robust_list 330 | 313 i386 splice sys_splice 331 | 314 i386 sync_file_range sys_ia32_sync_file_range 332 | 315 i386 tee sys_tee 333 | 316 i386 vmsplice sys_vmsplice 334 | 317 i386 move_pages sys_move_pages 335 | 318 i386 getcpu sys_getcpu 336 | 319 i386 epoll_pwait sys_epoll_pwait 337 | 320 i386 utimensat sys_utimensat_time32 338 | 321 i386 signalfd sys_signalfd compat_sys_signalfd 339 | 322 i386 timerfd_create sys_timerfd_create 340 | 323 i386 eventfd sys_eventfd 341 | 324 i386 fallocate sys_ia32_fallocate 342 | 325 i386 timerfd_settime sys_timerfd_settime32 343 | 326 i386 timerfd_gettime sys_timerfd_gettime32 344 | 327 i386 signalfd4 sys_signalfd4 compat_sys_signalfd4 345 | 328 i386 eventfd2 sys_eventfd2 346 | 329 i386 epoll_create1 sys_epoll_create1 347 | 330 i386 dup3 sys_dup3 348 | 331 i386 pipe2 sys_pipe2 349 | 332 i386 inotify_init1 sys_inotify_init1 350 | 333 i386 preadv sys_preadv compat_sys_preadv 351 | 334 i386 pwritev sys_pwritev compat_sys_pwritev 352 | 335 i386 rt_tgsigqueueinfo sys_rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo 353 | 336 i386 perf_event_open sys_perf_event_open 354 | 337 i386 recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32 355 | 338 i386 fanotify_init sys_fanotify_init 356 | 339 i386 fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark 357 | 340 i386 prlimit64 sys_prlimit64 358 | 341 i386 name_to_handle_at sys_name_to_handle_at 359 | 342 i386 open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at 360 | 343 i386 clock_adjtime sys_clock_adjtime32 361 | 344 i386 syncfs sys_syncfs 362 | 345 i386 sendmmsg sys_sendmmsg compat_sys_sendmmsg 363 | 346 i386 setns sys_setns 364 | 347 i386 process_vm_readv sys_process_vm_readv 365 | 348 i386 process_vm_writev sys_process_vm_writev 366 | 349 i386 kcmp sys_kcmp 367 | 350 i386 finit_module sys_finit_module 368 | 351 i386 sched_setattr sys_sched_setattr 369 | 352 i386 sched_getattr sys_sched_getattr 370 | 353 i386 renameat2 sys_renameat2 371 | 354 i386 seccomp sys_seccomp 372 | 355 i386 getrandom sys_getrandom 373 | 356 i386 memfd_create sys_memfd_create 374 | 357 i386 bpf sys_bpf 375 | 358 i386 execveat sys_execveat compat_sys_execveat 376 | 359 i386 socket sys_socket 377 | 360 i386 socketpair sys_socketpair 378 | 361 i386 bind sys_bind 379 | 362 i386 connect sys_connect 380 | 363 i386 listen sys_listen 381 | 364 i386 accept4 sys_accept4 382 | 365 i386 getsockopt sys_getsockopt sys_getsockopt 383 | 366 i386 setsockopt sys_setsockopt sys_setsockopt 384 | 367 i386 getsockname sys_getsockname 385 | 368 i386 getpeername sys_getpeername 386 | 369 i386 sendto sys_sendto 387 | 370 i386 sendmsg sys_sendmsg compat_sys_sendmsg 388 | 371 i386 recvfrom sys_recvfrom compat_sys_recvfrom 389 | 372 i386 recvmsg sys_recvmsg compat_sys_recvmsg 390 | 373 i386 shutdown sys_shutdown 391 | 374 i386 userfaultfd sys_userfaultfd 392 | 375 i386 membarrier sys_membarrier 393 | 376 i386 mlock2 sys_mlock2 394 | 377 i386 copy_file_range sys_copy_file_range 395 | 378 i386 preadv2 sys_preadv2 compat_sys_preadv2 396 | 379 i386 pwritev2 sys_pwritev2 compat_sys_pwritev2 397 | 380 i386 pkey_mprotect sys_pkey_mprotect 398 | 381 i386 pkey_alloc sys_pkey_alloc 399 | 382 i386 pkey_free sys_pkey_free 400 | 383 i386 statx sys_statx 401 | 384 i386 arch_prctl sys_arch_prctl compat_sys_arch_prctl 402 | 385 i386 io_pgetevents sys_io_pgetevents_time32 compat_sys_io_pgetevents 403 | 386 i386 rseq sys_rseq 404 | 393 i386 semget sys_semget 405 | 394 i386 semctl sys_semctl compat_sys_semctl 406 | 395 i386 shmget sys_shmget 407 | 396 i386 shmctl sys_shmctl compat_sys_shmctl 408 | 397 i386 shmat sys_shmat compat_sys_shmat 409 | 398 i386 shmdt sys_shmdt 410 | 399 i386 msgget sys_msgget 411 | 400 i386 msgsnd sys_msgsnd compat_sys_msgsnd 412 | 401 i386 msgrcv sys_msgrcv compat_sys_msgrcv 413 | 402 i386 msgctl sys_msgctl compat_sys_msgctl 414 | 403 i386 clock_gettime64 sys_clock_gettime 415 | 404 i386 clock_settime64 sys_clock_settime 416 | 405 i386 clock_adjtime64 sys_clock_adjtime 417 | 406 i386 clock_getres_time64 sys_clock_getres 418 | 407 i386 clock_nanosleep_time64 sys_clock_nanosleep 419 | 408 i386 timer_gettime64 sys_timer_gettime 420 | 409 i386 timer_settime64 sys_timer_settime 421 | 410 i386 timerfd_gettime64 sys_timerfd_gettime 422 | 411 i386 timerfd_settime64 sys_timerfd_settime 423 | 412 i386 utimensat_time64 sys_utimensat 424 | 413 i386 pselect6_time64 sys_pselect6 compat_sys_pselect6_time64 425 | 414 i386 ppoll_time64 sys_ppoll compat_sys_ppoll_time64 426 | 416 i386 io_pgetevents_time64 sys_io_pgetevents 427 | 417 i386 recvmmsg_time64 sys_recvmmsg compat_sys_recvmmsg_time64 428 | 418 i386 mq_timedsend_time64 sys_mq_timedsend 429 | 419 i386 mq_timedreceive_time64 sys_mq_timedreceive 430 | 420 i386 semtimedop_time64 sys_semtimedop 431 | 421 i386 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 432 | 422 i386 futex_time64 sys_futex 433 | 423 i386 sched_rr_get_interval_time64 sys_sched_rr_get_interval 434 | 424 i386 pidfd_send_signal sys_pidfd_send_signal 435 | 425 i386 io_uring_setup sys_io_uring_setup 436 | 426 i386 io_uring_enter sys_io_uring_enter 437 | 427 i386 io_uring_register sys_io_uring_register 438 | 428 i386 open_tree sys_open_tree 439 | 429 i386 move_mount sys_move_mount 440 | 430 i386 fsopen sys_fsopen 441 | 431 i386 fsconfig sys_fsconfig 442 | 432 i386 fsmount sys_fsmount 443 | 433 i386 fspick sys_fspick 444 | 434 i386 pidfd_open sys_pidfd_open 445 | 435 i386 clone3 sys_clone3 446 | 436 i386 close_range sys_close_range 447 | 437 i386 openat2 sys_openat2 448 | 438 i386 pidfd_getfd sys_pidfd_getfd 449 | 439 i386 faccessat2 sys_faccessat2 450 | 440 i386 process_madvise sys_process_madvise 451 | 441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2 452 | 442 i386 mount_setattr sys_mount_setattr 453 | 443 i386 quotactl_fd sys_quotactl_fd 454 | 444 i386 landlock_create_ruleset sys_landlock_create_ruleset 455 | 445 i386 landlock_add_rule sys_landlock_add_rule 456 | 446 i386 landlock_restrict_self sys_landlock_restrict_self 457 | 447 i386 memfd_secret sys_memfd_secret 458 | 448 i386 process_mrelease sys_process_mrelease 459 | 449 i386 futex_waitv sys_futex_waitv 460 | 450 i386 set_mempolicy_home_node sys_set_mempolicy_home_node 461 | -------------------------------------------------------------------------------- /modul-learning-ASM-fundamental/syscall/syscall64_Arch.txt: -------------------------------------------------------------------------------- 1 | # ----- START ----- 2 | # This file i copied from https://github.com/torvalds/linux/blob/master/arch/x86/entry/syscalls/syscall_64.tbl 3 | # I make for my shortcut 4 | # ----- END ----- 5 | # 64-bit system call numbers and entry vectors 6 | # 7 | # The format is: 8 | # 9 | # 10 | # The __x64_sys_*() stubs are created on-the-fly for sys_*() system calls 11 | # 12 | # The abi is "common", "64" or "x32" for this file. 13 | # 14 | 0 common read sys_read 15 | 1 common write sys_write 16 | 2 common open sys_open 17 | 3 common close sys_close 18 | 4 common stat sys_newstat 19 | 5 common fstat sys_newfstat 20 | 6 common lstat sys_newlstat 21 | 7 common poll sys_poll 22 | 8 common lseek sys_lseek 23 | 9 common mmap sys_mmap 24 | 10 common mprotect sys_mprotect 25 | 11 common munmap sys_munmap 26 | 12 common brk sys_brk 27 | 13 64 rt_sigaction sys_rt_sigaction 28 | 14 common rt_sigprocmask sys_rt_sigprocmask 29 | 15 64 rt_sigreturn sys_rt_sigreturn 30 | 16 64 ioctl sys_ioctl 31 | 17 common pread64 sys_pread64 32 | 18 common pwrite64 sys_pwrite64 33 | 19 64 readv sys_readv 34 | 20 64 writev sys_writev 35 | 21 common access sys_access 36 | 22 common pipe sys_pipe 37 | 23 common select sys_select 38 | 24 common sched_yield sys_sched_yield 39 | 25 common mremap sys_mremap 40 | 26 common msync sys_msync 41 | 27 common mincore sys_mincore 42 | 28 common madvise sys_madvise 43 | 29 common shmget sys_shmget 44 | 30 common shmat sys_shmat 45 | 31 common shmctl sys_shmctl 46 | 32 common dup sys_dup 47 | 33 common dup2 sys_dup2 48 | 34 common pause sys_pause 49 | 35 common nanosleep sys_nanosleep 50 | 36 common getitimer sys_getitimer 51 | 37 common alarm sys_alarm 52 | 38 common setitimer sys_setitimer 53 | 39 common getpid sys_getpid 54 | 40 common sendfile sys_sendfile64 55 | 41 common socket sys_socket 56 | 42 common connect sys_connect 57 | 43 common accept sys_accept 58 | 44 common sendto sys_sendto 59 | 45 64 recvfrom sys_recvfrom 60 | 46 64 sendmsg sys_sendmsg 61 | 47 64 recvmsg sys_recvmsg 62 | 48 common shutdown sys_shutdown 63 | 49 common bind sys_bind 64 | 50 common listen sys_listen 65 | 51 common getsockname sys_getsockname 66 | 52 common getpeername sys_getpeername 67 | 53 common socketpair sys_socketpair 68 | 54 64 setsockopt sys_setsockopt 69 | 55 64 getsockopt sys_getsockopt 70 | 56 common clone sys_clone 71 | 57 common fork sys_fork 72 | 58 common vfork sys_vfork 73 | 59 64 execve sys_execve 74 | 60 common exit sys_exit 75 | 61 common wait4 sys_wait4 76 | 62 common kill sys_kill 77 | 63 common uname sys_newuname 78 | 64 common semget sys_semget 79 | 65 common semop sys_semop 80 | 66 common semctl sys_semctl 81 | 67 common shmdt sys_shmdt 82 | 68 common msgget sys_msgget 83 | 69 common msgsnd sys_msgsnd 84 | 70 common msgrcv sys_msgrcv 85 | 71 common msgctl sys_msgctl 86 | 72 common fcntl sys_fcntl 87 | 73 common flock sys_flock 88 | 74 common fsync sys_fsync 89 | 75 common fdatasync sys_fdatasync 90 | 76 common truncate sys_truncate 91 | 77 common ftruncate sys_ftruncate 92 | 78 common getdents sys_getdents 93 | 79 common getcwd sys_getcwd 94 | 80 common chdir sys_chdir 95 | 81 common fchdir sys_fchdir 96 | 82 common rename sys_rename 97 | 83 common mkdir sys_mkdir 98 | 84 common rmdir sys_rmdir 99 | 85 common creat sys_creat 100 | 86 common link sys_link 101 | 87 common unlink sys_unlink 102 | 88 common symlink sys_symlink 103 | 89 common readlink sys_readlink 104 | 90 common chmod sys_chmod 105 | 91 common fchmod sys_fchmod 106 | 92 common chown sys_chown 107 | 93 common fchown sys_fchown 108 | 94 common lchown sys_lchown 109 | 95 common umask sys_umask 110 | 96 common gettimeofday sys_gettimeofday 111 | 97 common getrlimit sys_getrlimit 112 | 98 common getrusage sys_getrusage 113 | 99 common sysinfo sys_sysinfo 114 | 100 common times sys_times 115 | 101 64 ptrace sys_ptrace 116 | 102 common getuid sys_getuid 117 | 103 common syslog sys_syslog 118 | 104 common getgid sys_getgid 119 | 105 common setuid sys_setuid 120 | 106 common setgid sys_setgid 121 | 107 common geteuid sys_geteuid 122 | 108 common getegid sys_getegid 123 | 109 common setpgid sys_setpgid 124 | 110 common getppid sys_getppid 125 | 111 common getpgrp sys_getpgrp 126 | 112 common setsid sys_setsid 127 | 113 common setreuid sys_setreuid 128 | 114 common setregid sys_setregid 129 | 115 common getgroups sys_getgroups 130 | 116 common setgroups sys_setgroups 131 | 117 common setresuid sys_setresuid 132 | 118 common getresuid sys_getresuid 133 | 119 common setresgid sys_setresgid 134 | 120 common getresgid sys_getresgid 135 | 121 common getpgid sys_getpgid 136 | 122 common setfsuid sys_setfsuid 137 | 123 common setfsgid sys_setfsgid 138 | 124 common getsid sys_getsid 139 | 125 common capget sys_capget 140 | 126 common capset sys_capset 141 | 127 64 rt_sigpending sys_rt_sigpending 142 | 128 64 rt_sigtimedwait sys_rt_sigtimedwait 143 | 129 64 rt_sigqueueinfo sys_rt_sigqueueinfo 144 | 130 common rt_sigsuspend sys_rt_sigsuspend 145 | 131 64 sigaltstack sys_sigaltstack 146 | 132 common utime sys_utime 147 | 133 common mknod sys_mknod 148 | 134 64 uselib 149 | 135 common personality sys_personality 150 | 136 common ustat sys_ustat 151 | 137 common statfs sys_statfs 152 | 138 common fstatfs sys_fstatfs 153 | 139 common sysfs sys_sysfs 154 | 140 common getpriority sys_getpriority 155 | 141 common setpriority sys_setpriority 156 | 142 common sched_setparam sys_sched_setparam 157 | 143 common sched_getparam sys_sched_getparam 158 | 144 common sched_setscheduler sys_sched_setscheduler 159 | 145 common sched_getscheduler sys_sched_getscheduler 160 | 146 common sched_get_priority_max sys_sched_get_priority_max 161 | 147 common sched_get_priority_min sys_sched_get_priority_min 162 | 148 common sched_rr_get_interval sys_sched_rr_get_interval 163 | 149 common mlock sys_mlock 164 | 150 common munlock sys_munlock 165 | 151 common mlockall sys_mlockall 166 | 152 common munlockall sys_munlockall 167 | 153 common vhangup sys_vhangup 168 | 154 common modify_ldt sys_modify_ldt 169 | 155 common pivot_root sys_pivot_root 170 | 156 64 _sysctl sys_ni_syscall 171 | 157 common prctl sys_prctl 172 | 158 common arch_prctl sys_arch_prctl 173 | 159 common adjtimex sys_adjtimex 174 | 160 common setrlimit sys_setrlimit 175 | 161 common chroot sys_chroot 176 | 162 common sync sys_sync 177 | 163 common acct sys_acct 178 | 164 common settimeofday sys_settimeofday 179 | 165 common mount sys_mount 180 | 166 common umount2 sys_umount 181 | 167 common swapon sys_swapon 182 | 168 common swapoff sys_swapoff 183 | 169 common reboot sys_reboot 184 | 170 common sethostname sys_sethostname 185 | 171 common setdomainname sys_setdomainname 186 | 172 common iopl sys_iopl 187 | 173 common ioperm sys_ioperm 188 | 174 64 create_module 189 | 175 common init_module sys_init_module 190 | 176 common delete_module sys_delete_module 191 | 177 64 get_kernel_syms 192 | 178 64 query_module 193 | 179 common quotactl sys_quotactl 194 | 180 64 nfsservctl 195 | 181 common getpmsg 196 | 182 common putpmsg 197 | 183 common afs_syscall 198 | 184 common tuxcall 199 | 185 common security 200 | 186 common gettid sys_gettid 201 | 187 common readahead sys_readahead 202 | 188 common setxattr sys_setxattr 203 | 189 common lsetxattr sys_lsetxattr 204 | 190 common fsetxattr sys_fsetxattr 205 | 191 common getxattr sys_getxattr 206 | 192 common lgetxattr sys_lgetxattr 207 | 193 common fgetxattr sys_fgetxattr 208 | 194 common listxattr sys_listxattr 209 | 195 common llistxattr sys_llistxattr 210 | 196 common flistxattr sys_flistxattr 211 | 197 common removexattr sys_removexattr 212 | 198 common lremovexattr sys_lremovexattr 213 | 199 common fremovexattr sys_fremovexattr 214 | 200 common tkill sys_tkill 215 | 201 common time sys_time 216 | 202 common futex sys_futex 217 | 203 common sched_setaffinity sys_sched_setaffinity 218 | 204 common sched_getaffinity sys_sched_getaffinity 219 | 205 64 set_thread_area 220 | 206 64 io_setup sys_io_setup 221 | 207 common io_destroy sys_io_destroy 222 | 208 common io_getevents sys_io_getevents 223 | 209 64 io_submit sys_io_submit 224 | 210 common io_cancel sys_io_cancel 225 | 211 64 get_thread_area 226 | 212 common lookup_dcookie sys_lookup_dcookie 227 | 213 common epoll_create sys_epoll_create 228 | 214 64 epoll_ctl_old 229 | 215 64 epoll_wait_old 230 | 216 common remap_file_pages sys_remap_file_pages 231 | 217 common getdents64 sys_getdents64 232 | 218 common set_tid_address sys_set_tid_address 233 | 219 common restart_syscall sys_restart_syscall 234 | 220 common semtimedop sys_semtimedop 235 | 221 common fadvise64 sys_fadvise64 236 | 222 64 timer_create sys_timer_create 237 | 223 common timer_settime sys_timer_settime 238 | 224 common timer_gettime sys_timer_gettime 239 | 225 common timer_getoverrun sys_timer_getoverrun 240 | 226 common timer_delete sys_timer_delete 241 | 227 common clock_settime sys_clock_settime 242 | 228 common clock_gettime sys_clock_gettime 243 | 229 common clock_getres sys_clock_getres 244 | 230 common clock_nanosleep sys_clock_nanosleep 245 | 231 common exit_group sys_exit_group 246 | 232 common epoll_wait sys_epoll_wait 247 | 233 common epoll_ctl sys_epoll_ctl 248 | 234 common tgkill sys_tgkill 249 | 235 common utimes sys_utimes 250 | 236 64 vserver 251 | 237 common mbind sys_mbind 252 | 238 common set_mempolicy sys_set_mempolicy 253 | 239 common get_mempolicy sys_get_mempolicy 254 | 240 common mq_open sys_mq_open 255 | 241 common mq_unlink sys_mq_unlink 256 | 242 common mq_timedsend sys_mq_timedsend 257 | 243 common mq_timedreceive sys_mq_timedreceive 258 | 244 64 mq_notify sys_mq_notify 259 | 245 common mq_getsetattr sys_mq_getsetattr 260 | 246 64 kexec_load sys_kexec_load 261 | 247 64 waitid sys_waitid 262 | 248 common add_key sys_add_key 263 | 249 common request_key sys_request_key 264 | 250 common keyctl sys_keyctl 265 | 251 common ioprio_set sys_ioprio_set 266 | 252 common ioprio_get sys_ioprio_get 267 | 253 common inotify_init sys_inotify_init 268 | 254 common inotify_add_watch sys_inotify_add_watch 269 | 255 common inotify_rm_watch sys_inotify_rm_watch 270 | 256 common migrate_pages sys_migrate_pages 271 | 257 common openat sys_openat 272 | 258 common mkdirat sys_mkdirat 273 | 259 common mknodat sys_mknodat 274 | 260 common fchownat sys_fchownat 275 | 261 common futimesat sys_futimesat 276 | 262 common newfstatat sys_newfstatat 277 | 263 common unlinkat sys_unlinkat 278 | 264 common renameat sys_renameat 279 | 265 common linkat sys_linkat 280 | 266 common symlinkat sys_symlinkat 281 | 267 common readlinkat sys_readlinkat 282 | 268 common fchmodat sys_fchmodat 283 | 269 common faccessat sys_faccessat 284 | 270 common pselect6 sys_pselect6 285 | 271 common ppoll sys_ppoll 286 | 272 common unshare sys_unshare 287 | 273 64 set_robust_list sys_set_robust_list 288 | 274 64 get_robust_list sys_get_robust_list 289 | 275 common splice sys_splice 290 | 276 common tee sys_tee 291 | 277 common sync_file_range sys_sync_file_range 292 | 278 64 vmsplice sys_vmsplice 293 | 279 64 move_pages sys_move_pages 294 | 280 common utimensat sys_utimensat 295 | 281 common epoll_pwait sys_epoll_pwait 296 | 282 common signalfd sys_signalfd 297 | 283 common timerfd_create sys_timerfd_create 298 | 284 common eventfd sys_eventfd 299 | 285 common fallocate sys_fallocate 300 | 286 common timerfd_settime sys_timerfd_settime 301 | 287 common timerfd_gettime sys_timerfd_gettime 302 | 288 common accept4 sys_accept4 303 | 289 common signalfd4 sys_signalfd4 304 | 290 common eventfd2 sys_eventfd2 305 | 291 common epoll_create1 sys_epoll_create1 306 | 292 common dup3 sys_dup3 307 | 293 common pipe2 sys_pipe2 308 | 294 common inotify_init1 sys_inotify_init1 309 | 295 64 preadv sys_preadv 310 | 296 64 pwritev sys_pwritev 311 | 297 64 rt_tgsigqueueinfo sys_rt_tgsigqueueinfo 312 | 298 common perf_event_open sys_perf_event_open 313 | 299 64 recvmmsg sys_recvmmsg 314 | 300 common fanotify_init sys_fanotify_init 315 | 301 common fanotify_mark sys_fanotify_mark 316 | 302 common prlimit64 sys_prlimit64 317 | 303 common name_to_handle_at sys_name_to_handle_at 318 | 304 common open_by_handle_at sys_open_by_handle_at 319 | 305 common clock_adjtime sys_clock_adjtime 320 | 306 common syncfs sys_syncfs 321 | 307 64 sendmmsg sys_sendmmsg 322 | 308 common setns sys_setns 323 | 309 common getcpu sys_getcpu 324 | 310 64 process_vm_readv sys_process_vm_readv 325 | 311 64 process_vm_writev sys_process_vm_writev 326 | 312 common kcmp sys_kcmp 327 | 313 common finit_module sys_finit_module 328 | 314 common sched_setattr sys_sched_setattr 329 | 315 common sched_getattr sys_sched_getattr 330 | 316 common renameat2 sys_renameat2 331 | 317 common seccomp sys_seccomp 332 | 318 common getrandom sys_getrandom 333 | 319 common memfd_create sys_memfd_create 334 | 320 common kexec_file_load sys_kexec_file_load 335 | 321 common bpf sys_bpf 336 | 322 64 execveat sys_execveat 337 | 323 common userfaultfd sys_userfaultfd 338 | 324 common membarrier sys_membarrier 339 | 325 common mlock2 sys_mlock2 340 | 326 common copy_file_range sys_copy_file_range 341 | 327 64 preadv2 sys_preadv2 342 | 328 64 pwritev2 sys_pwritev2 343 | 329 common pkey_mprotect sys_pkey_mprotect 344 | 330 common pkey_alloc sys_pkey_alloc 345 | 331 common pkey_free sys_pkey_free 346 | 332 common statx sys_statx 347 | 333 common io_pgetevents sys_io_pgetevents 348 | 334 common rseq sys_rseq 349 | # don't use numbers 387 through 423, add new calls after the last 350 | # 'common' entry 351 | 424 common pidfd_send_signal sys_pidfd_send_signal 352 | 425 common io_uring_setup sys_io_uring_setup 353 | 426 common io_uring_enter sys_io_uring_enter 354 | 427 common io_uring_register sys_io_uring_register 355 | 428 common open_tree sys_open_tree 356 | 429 common move_mount sys_move_mount 357 | 430 common fsopen sys_fsopen 358 | 431 common fsconfig sys_fsconfig 359 | 432 common fsmount sys_fsmount 360 | 433 common fspick sys_fspick 361 | 434 common pidfd_open sys_pidfd_open 362 | 435 common clone3 sys_clone3 363 | 436 common close_range sys_close_range 364 | 437 common openat2 sys_openat2 365 | 438 common pidfd_getfd sys_pidfd_getfd 366 | 439 common faccessat2 sys_faccessat2 367 | 440 common process_madvise sys_process_madvise 368 | 441 common epoll_pwait2 sys_epoll_pwait2 369 | 442 common mount_setattr sys_mount_setattr 370 | 443 common quotactl_fd sys_quotactl_fd 371 | 444 common landlock_create_ruleset sys_landlock_create_ruleset 372 | 445 common landlock_add_rule sys_landlock_add_rule 373 | 446 common landlock_restrict_self sys_landlock_restrict_self 374 | 447 common memfd_secret sys_memfd_secret 375 | 448 common process_mrelease sys_process_mrelease 376 | 449 common futex_waitv sys_futex_waitv 377 | 450 common set_mempolicy_home_node sys_set_mempolicy_home_node 378 | 379 | # 380 | # Due to a historical design error, certain syscalls are numbered differently 381 | # in x32 as compared to native x86_64. These syscalls have numbers 512-547. 382 | # Do not add new syscalls to this range. Numbers 548 and above are available 383 | # for non-x32 use. 384 | # 385 | 512 x32 rt_sigaction compat_sys_rt_sigaction 386 | 513 x32 rt_sigreturn compat_sys_x32_rt_sigreturn 387 | 514 x32 ioctl compat_sys_ioctl 388 | 515 x32 readv sys_readv 389 | 516 x32 writev sys_writev 390 | 517 x32 recvfrom compat_sys_recvfrom 391 | 518 x32 sendmsg compat_sys_sendmsg 392 | 519 x32 recvmsg compat_sys_recvmsg 393 | 520 x32 execve compat_sys_execve 394 | 521 x32 ptrace compat_sys_ptrace 395 | 522 x32 rt_sigpending compat_sys_rt_sigpending 396 | 523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait_time64 397 | 524 x32 rt_sigqueueinfo compat_sys_rt_sigqueueinfo 398 | 525 x32 sigaltstack compat_sys_sigaltstack 399 | 526 x32 timer_create compat_sys_timer_create 400 | 527 x32 mq_notify compat_sys_mq_notify 401 | 528 x32 kexec_load compat_sys_kexec_load 402 | 529 x32 waitid compat_sys_waitid 403 | 530 x32 set_robust_list compat_sys_set_robust_list 404 | 531 x32 get_robust_list compat_sys_get_robust_list 405 | 532 x32 vmsplice sys_vmsplice 406 | 533 x32 move_pages sys_move_pages 407 | 534 x32 preadv compat_sys_preadv64 408 | 535 x32 pwritev compat_sys_pwritev64 409 | 536 x32 rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo 410 | 537 x32 recvmmsg compat_sys_recvmmsg_time64 411 | 538 x32 sendmmsg compat_sys_sendmmsg 412 | 539 x32 process_vm_readv sys_process_vm_readv 413 | 540 x32 process_vm_writev sys_process_vm_writev 414 | 541 x32 setsockopt sys_setsockopt 415 | 542 x32 getsockopt sys_getsockopt 416 | 543 x32 io_setup compat_sys_io_setup 417 | 544 x32 io_submit compat_sys_io_submit 418 | 545 x32 execveat compat_sys_execveat 419 | 546 x32 preadv2 compat_sys_preadv64v2 420 | 547 x32 pwritev2 compat_sys_pwritev64v2 421 | # This is the end of the legacy x32 range. Numbers 548 and above are 422 | # not special and are not to be used for x32-specific syscalls. 423 | -------------------------------------------------------------------------------- /modul-learning-CTF-hacking/readme.md: -------------------------------------------------------------------------------- 1 | ## Modul learn ASM for CTF or Hacking 2 | 3 | > Learn path like e book, article and write up article or teks 4 | 5 | - 6 | - 7 | 8 | > Learn path like e book, article and write up Youtube or vidio 9 | 10 | - 11 | 12 | ## Playground 13 | 14 | > This is Playground you can try 15 | 16 | - [hackthebox](https://www.hackthebox.com/) 17 | - [Tryhackme](https://tryhackme.com/) 18 | - [picoctf](https://picoctf.org/) 19 | - [ctftime](https://ctftime.org/ctfs) 20 | - [Vulnhub](https://www.vulnhub.com/) 21 | -------------------------------------------------------------------------------- /notes/Basic syscall: -------------------------------------------------------------------------------- 1 | - [ENGLISH] 2 | 3 | Syscall number is in rax 4 | 5 | There are 6 arguments, but there are 3 write syscalls, including: 6 | 7 | First argument = rdi 8 | Second argument = rsi 9 | Third argument = rdx 10 | 11 | The write syscall has three arguments: 12 | 13 | first argument is file descriptor (stdin, stdout, stderr) 14 | the second argument is a pointer 15 | the third argument is the length of the data or the length to be written 16 | 17 | Instruction user 18 | 19 | mov : user to fill register and memory 20 | lea : fetch address from memory, then put in register 21 | xor : instruction to do exclusive or arithmetic example 22 | subq : subtraction 23 | 24 | The return value of the syscall is in the rax register 25 | 26 | - [INDOENESIAN] 27 | 28 | Syscall number ada di dalam rax 29 | 30 | Argumen ada 6, tetapi syscall write ada 3. Antara lain : 31 | 32 | Argumen pertama = rdi 33 | Argumen ke dua = rsi 34 | Argumen ke tiga = rdx 35 | 36 | Syscall write ada tiga argumen : 37 | 38 | argumen pertama adalah file deskriptor (stdin, stdout, stderr) 39 | argumen ke dua adalah pointer 40 | argumen ke tiga adalah panjang data atau length yang akan di write 41 | 42 | Pengguan instruksi 43 | 44 | mov : pengguan untuk mengisi register dan memori 45 | lea : mengambil addres dari sebuah memori, lalu dimasukan di dalam register 46 | xor : instruksi melakukan exclusive or cotoh aritmatika 47 | subq : pengurangan 48 | 49 | Return value syscall ada di register rax 50 | -------------------------------------------------------------------------------- /simple-shellcode/hello-shellcode/hello_shellcode.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // Add byte from chapter 1 or testing and compile it, then you can using gdb for get the byte 5 | static const unsigned char p[] = "\xb8\x01\x00\x00\x00\xbf\x01\x00\x00\x00\x48\x8d\x35\x10\x00\x00\x00\xba\x0d\x00\x00\x00\x0f\x05\xb8\x3c\x00\x00\x00\x31\xff\x0f\x05\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21\x0a\x00\x00"; 6 | 7 | int main(void) 8 | { 9 | void (*code)(void) = mmap(NULL, 1024, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); 10 | memcpy(code, p, sizeof(p)); 11 | code(); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /simple-shellcode/readme.md: -------------------------------------------------------------------------------- 1 | ## Shellcode learn ASM 2 | 3 | > This is first simple shellcode asm programming language. You can learn or contribute on this path! 4 | > 5 | > Soon i add new 6 | > 7 | > Note : *If you wanna contribute please adjust your category, for example this path is for basic 8 | 9 | ## How to compile 10 | 11 | > gcc -static -nostartfiles fileasm -o resultnamecompile 12 | > 13 | > Ex: 14 | > 15 | > gcc -static -nostartfiles conjump.S -o conjump 16 | -------------------------------------------------------------------------------- /testing/readme.md: -------------------------------------------------------------------------------- 1 | ## Only me 2 | 3 | > This is testing or sandbox. This only for me! 4 | 5 | ## How to compile 6 | 7 | > gcc -static -nostartfiles fileasm -o resultnamecompile 8 | > 9 | > Ex: 10 | > 11 | > gcc -static -nostartfiles conjump.S -o conjump 12 | -------------------------------------------------------------------------------- /testing/sandbox_test/learn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/testing/sandbox_test/learn -------------------------------------------------------------------------------- /testing/sandbox_test/learn_sample.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/testing/sandbox_test/learn_sample.S -------------------------------------------------------------------------------- /testing/simple_shellcode/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jieyab89/Learn-asm-programming/af009686bb26e56bab3285489870aa34000032fe/testing/simple_shellcode/hello -------------------------------------------------------------------------------- /testing/simple_shellcode/hello.S: -------------------------------------------------------------------------------- 1 | .section .data 2 | 3 | .var: .asciz "Hello\n" 4 | 5 | .section .text 6 | 7 | .global _start 8 | 9 | _start: 10 | 11 | // NOTE 12 | 13 | /* 14 | movb : byte = 8bit 15 | movw : word = 16bit 16 | movl : long or dword = 32bit 17 | movq : qword = 64bit 18 | */ 19 | 20 | movl $1, %eax 21 | movl $1, %edi 22 | leaq .var(%rip), %rsi 23 | movl $6, %edx 24 | syscall 25 | 26 | movl $60, %eax 27 | movl $0, %edi 28 | syscall 29 | --------------------------------------------------------------------------------