44 lines
607 B
ArmAsm
44 lines
607 B
ArmAsm
.code64
|
|
|
|
.section .rodata
|
|
money_str: .string "woohoo!! free money\n"
|
|
|
|
.section .text
|
|
.globl _start
|
|
.extern printf
|
|
.extern gets
|
|
|
|
_get_input:
|
|
push %rbp
|
|
mov %rsp, %rbp
|
|
sub $0x10, %rsp
|
|
lea -0x8(%rbp),%rax
|
|
mov %rax, %rdi
|
|
call gets@plt
|
|
nop ; aaaaaaaa\x0\x0\x0\x0\x0\x0\x0\x0\x47\x10\x40
|
|
leave
|
|
ret
|
|
|
|
_get_rich_fast:
|
|
push %rbp
|
|
mov %rsp, %rbp
|
|
lea money_str, %rdi
|
|
mov %rdi, %rax
|
|
call printf@plt
|
|
pop %rbp
|
|
nop
|
|
ret
|
|
|
|
_start:
|
|
push %rbp
|
|
call _get_input
|
|
pop %rbp ; TODO: segfault
|
|
mov $0, %rax
|
|
mov $60, %rdi
|
|
syscall
|
|
ret
|
|
|
|
|
|
; .section bss
|
|
; .lcomm buf, 8
|