Added 10 more gists.
This commit is contained in:
1
smash.s/README.md
Normal file
1
smash.s/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Smashing the stack for fun and no profit.
|
28
smash.s/smash.s
Normal file
28
smash.s/smash.s
Normal file
@@ -0,0 +1,28 @@
|
||||
.section .rodata
|
||||
str:
|
||||
.asciz "Smashed!"
|
||||
|
||||
.section .text
|
||||
.globl main
|
||||
main:
|
||||
pushq %rbp
|
||||
movq %rsp, %rbp
|
||||
call function
|
||||
xorl %eax, %eax
|
||||
leave
|
||||
ret
|
||||
|
||||
function:
|
||||
pushq %rbp
|
||||
movq %rsp, %rbp
|
||||
leaq smash(%rip), %r8
|
||||
movq %r8, 8(%rbp)
|
||||
leave
|
||||
ret
|
||||
|
||||
smash:
|
||||
leaq str(%rip), %rdi
|
||||
call puts@plt
|
||||
movq $60, %rax
|
||||
movq $89, %rdi
|
||||
syscall
|
Reference in New Issue
Block a user