Hello World

The first post that WordPress automatically creates when a new blog is created is titled ‘Hello World’. However its in English and not everyone understands it. So I have tried to paraphrase it in some other more human friendly languages.

echo “Hello World”

printf(“Hello world\n”);

cout<<“Hello World”);

<p>Hello World</p>

print “Hello World”

window.document.write(“Hello World”);

alert(“Hello World”);

System.out.println(“Hello World”);

writeln(“Hello World”);

write(1,”Hello World”,11);

Put_Line(“Hello World”);

.model tiny
.code
org 0x100h
hello_world proc
mov ah,09h
lea dx,dis
int 21h
hello_world  endp
dis db ‘Hello World$’
end

0000400 ed31 8949 5ed1 8948 48e2 e483 50f0 4954
0000410 c0c7 0500 0040 c748 10c1 4005 4800 c7c7
0000420 04e4 0040 c7e8 ffff f4ff 9090 8348 08ec
0000430 8b48 6105 2004 4800 c085 0274 d0ff 8348
0000440 08c4 90c3 9090 9090 9090 9090 9090 9090
0000450 4855 e589 4853 ec83 8008 783d 2004 0000
0000460 4b75 e8bb 6006 4800 058b 0472 0020 8148
0000470 e0eb 6006 4800 fbc1 4803 eb83 4801 d839
0000480 2473 0f66 441f 0000 8348 01c0 8948 4d05
0000490 2004 ff00 c514 06e0 0060 8b48 3f05 2004
00004a0 4800 d839 e272 05c6 042b 0020 4801 c483
00004b0 5b08 c35d 6666 2e66 1f0f 0084 0000 0000
00004c0 8348 283d 2002 0000 4855 e589 1274 00b8
00004d0 0000 4800 c085 0874 bf5d 06f0 0060 e0ff
00004e0 c35d 9090 4855 e589 ecbf 4005 e800 feee
00004f0 ffff c35d 9090 9090 9090 9090 9090 9090
0000500 c3f3 6666 6666 2e66 1f0f 0084 0000 0000
0000510 8948 246c 4cd8 6489 e024 8d48 ab2d 2001
0000520 4c00 258d 01a4 0020 894c 246c 4ce8 7489
0000530 f024 894c 247c 48f8 5c89 d024 8348 38ec
0000540 294c 41e5 fd89 8949 48f6 fdc1 4903 d789
0000550 63e8 fffe 48ff ed85 1c74 db31 1f0f 0040
0000560 894c 4cfa f689 8944 41ef 14ff 48dc c383
0000570 4801 eb39 ea72 8b48 245c 4808 6c8b 1024
0000580 8b4c 2464 4c18 6c8b 2024 8b4c 2474 4c28
0000590 7c8b 3024 8348 38c4 90c3 9090 9090 9090
00005a0 4855 e589 4853 ec83 4808 058b 0120 0020
00005b0 8348 fff8 1974 d0bb 6006 0f00 441f 0000
00005c0 8348 08eb d0ff 8b48 4803 f883 75ff 48f1
00005d0 c483 5b08 c35d 9090

Now if you are wondering what this is ^. Well that is what a hello world program in .c would look like in binary.

Many people asked me what I did to get this so here is a short description – compile a simple hello world C program. Do a hexdump on it and save its output. The open the elf a.out using readelf -a. Search for the .text section in the elf sections part, check its offset and tada you have the .text/code section with you.

Advertisements

3 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s