This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.intel_syntax noprefix | |
.globl main | |
main: | |
push r12 | |
push r13 | |
push rbx | |
mov r13, 0x123456789abcdef0 | |
mov r12, 26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, struct | |
from ctypes import * | |
libc = cdll.LoadLibrary("libc.so.6") | |
free = libc.free | |
printf = libc.printf | |
putchar = libc.putchar | |
getchar = libc.getchar | |
mmap = libc.mmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main () { return 42; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BITS 64 | |
EXTERN _exit | |
GLOBAL _start | |
SECTION .text | |
_start: | |
mov edi, 42 | |
call _exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BITS 64 | |
GLOBAL _start | |
SECTION .text | |
_start: | |
mov eax, 60 | |
mov edi, 42 | |
syscall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BITS 64 | |
org 0x08048000 | |
ehdr: ; ELF64_Ehdr(ELF header) | |
db 0x7f, "ELF", 2, 1, 1 ; e_ident | |
times 9 db 0 ; e_ident | |
dw 2 ; u16 e_type | |
dw 0x3e ; u16 e_machine /usr/include/linux/elf-em.h | |
; 62 = x86-64 | |
dd 0x01 ; u32 e_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BITS 64 | |
org 0x08048000 | |
ehdr: ; ELF64_Ehdr(ELF header) | |
db 0x7f, "ELF", 2, 1, 1 ; e_ident | |
times 9 db 0 ; e_ident | |
dw 2 ; u16 e_type | |
dw 0x3e ; u16 e_machine /usr/include/linux/elf-em.h | |
; 62 = x86-64 | |
dd 0x01 ; u32 e_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.intel_syntax noprefix | |
.comm mem, 30000 | |
.globl main | |
main: | |
lea rbx, mem | |
mov byte ptr [rbx], 0x41 | |
mov rax, 1 # specify write system call | |
mov edx, 0x1 # 3nd argument (count) | |
mov rsi, rbx # 2nd argument (string pointer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.intel_syntax noprefix | |
.comm mem, 30000 | |
.globl main | |
main: | |
lea rbx, mem | |
# read systemcall | |
mov rax, 0 # specify read system call | |
mov edx, 0x1 # 3nd argument (count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BITS 64 | |
org 0x08048000 | |
ehdr: ; ELF64_Ehdr(ELF header) | |
db 0x7f, "ELF", 2, 1, 1 ; e_ident | |
times 9 db 0 ; e_ident | |
dw 2 ; u16 e_type | |
dw 0x3e ; u16 e_machine /usr/include/linux/elf-em.h | |
; 62 = x86-64 | |
dd 0x01 ; u32 e_version |
OlderNewer