Hello world program in assembly language on a 64 bit x86 machine.
- Open a file named hello.asm
- Paste the following code
- SECTION .data
msg: db “Hi World”,10
len: equ $-msgSECTION .text
- nasm -f elf64 hello.asm
- gcc -o hello hello.o -nostartfiles -nostdlib -nodefaultlibs
Wish to inject something in this binary?
Lets keep it simple!
I am going to use ghex to read or write on this binary file. System: 64 bit x86 and OS: Ubuntu 14.04.
$sudo apt-get install ghex
Follow these steps:
1) ghex hello
2) Go to the place where you can find string “hello world”, replace it with “BUSTED”
3) You can add some signature to this file as well lets say string “ABCDEFGDIJK”. Place it in the file as well (may be three places away from “BUSTED”).
4) Remove everything following this signature string from the binary file.
6) “BUSTED” You should be able to see this as output