Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .globl _start
- _start:
- # We jump to the bottom of the page, so we can call thecode
- # from below, we need to do this in order to avoid null bytes.
- jmp intro
- thecode:
- # Flush the registers to remove potential random data
- xorl %eax, %eax
- xorl %ebx, %ebx
- xorl %edx, %edx
- # Write to the 1 byte counterpart of eax and ebx (to remove nulls)
- movb $4, %al
- movb $1, %bl
- # Get the string from the stack and put it into ecx
- popl %ecx
- # Write the string length into dl (edx)
- movb $12, %dl
- int $0x80
- # Flush the registers once more and call exit(1)
- xorl %eax,%eax
- xorl %ebx, %ebx
- movb $1, %al
- movb $1, %bl
- int $0x80
- intro:
- call thecode
- # We define this after the so we can pop it off the stack
- .ascii "Hello World\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement