ELF Hello World Tutorial Executable hd Updated 2025-07-16
Running:gives:
hd hello_world.out00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
00000010 02 00 3e 00 01 00 00 00 b0 00 40 00 00 00 00 00 |..>.......@.....|
00000020 40 00 00 00 00 00 00 00 10 01 00 00 00 00 00 00 |@...............|
00000030 00 00 00 00 40 00 38 00 02 00 40 00 06 00 03 00 |....@.8...@.....|
00000040 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 |..@.......@.....|
00000060 d7 00 00 00 00 00 00 00 d7 00 00 00 00 00 00 00 |................|
00000070 00 00 20 00 00 00 00 00 01 00 00 00 06 00 00 00 |.. .............|
00000080 d8 00 00 00 00 00 00 00 d8 00 60 00 00 00 00 00 |..........`.....|
00000090 d8 00 60 00 00 00 00 00 0d 00 00 00 00 00 00 00 |..`.............|
000000a0 0d 00 00 00 00 00 00 00 00 00 20 00 00 00 00 00 |.......... .....|
000000b0 b8 01 00 00 00 bf 01 00 00 00 48 be d8 00 60 00 |..........H...`.|
000000c0 00 00 00 00 ba 0d 00 00 00 0f 05 b8 3c 00 00 00 |............<...|
000000d0 bf 00 00 00 00 0f 05 00 48 65 6c 6c 6f 20 77 6f |........Hello wo|
000000e0 72 6c 64 21 0a 00 2e 73 79 6d 74 61 62 00 2e 73 |rld!...symtab..s|
000000f0 74 72 74 61 62 00 2e 73 68 73 74 72 74 61 62 00 |trtab..shstrtab.|
00000100 2e 74 65 78 74 00 2e 64 61 74 61 00 00 00 00 00 |.text..data.....|
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000150 1b 00 00 00 01 00 00 00 06 00 00 00 00 00 00 00 |................|
00000160 b0 00 40 00 00 00 00 00 b0 00 00 00 00 00 00 00 |..@.............|
00000170 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |'...............|
00000180 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000190 21 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00 |!...............|
000001a0 d8 00 60 00 00 00 00 00 d8 00 00 00 00 00 00 00 |..`.............|
000001b0 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001c0 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001d0 11 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 |................|
000001e0 00 00 00 00 00 00 00 00 e5 00 00 00 00 00 00 00 |................|
000001f0 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |'...............|
00000200 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000210 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 90 02 00 00 00 00 00 00 |................|
00000230 08 01 00 00 00 00 00 00 05 00 00 00 07 00 00 00 |................|
00000240 08 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 |................|
00000250 09 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 00 00 00 00 00 00 00 00 98 03 00 00 00 00 00 00 |................|
00000270 4c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |L...............|
00000280 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 00 00 00 00 00 00 00 00 00 00 00 03 00 01 00 |................|
000002b0 b0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 |..@.............|
000002c0 00 00 00 00 03 00 02 00 d8 00 60 00 00 00 00 00 |..........`.....|
000002d0 00 00 00 00 00 00 00 00 01 00 00 00 04 00 f1 ff |................|
000002e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002f0 11 00 00 00 00 00 02 00 d8 00 60 00 00 00 00 00 |..........`.....|
00000300 00 00 00 00 00 00 00 00 1d 00 00 00 00 00 f1 ff |................|
00000310 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000320 00 00 00 00 04 00 f1 ff 00 00 00 00 00 00 00 00 |................|
00000330 00 00 00 00 00 00 00 00 2d 00 00 00 10 00 01 00 |........-.......|
00000340 b0 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 |..@.............|
00000350 34 00 00 00 10 00 02 00 e5 00 60 00 00 00 00 00 |4.........`.....|
00000360 00 00 00 00 00 00 00 00 40 00 00 00 10 00 02 00 |........@.......|
00000370 e5 00 60 00 00 00 00 00 00 00 00 00 00 00 00 00 |..`.............|
00000380 47 00 00 00 10 00 02 00 e8 00 60 00 00 00 00 00 |G.........`.....|
00000390 00 00 00 00 00 00 00 00 00 68 65 6c 6c 6f 5f 77 |.........hello_w|
000003a0 6f 72 6c 64 2e 61 73 6d 00 68 65 6c 6c 6f 5f 77 |orld.asm.hello_w|
000003b0 6f 72 6c 64 00 68 65 6c 6c 6f 5f 77 6f 72 6c 64 |orld.hello_world|
000003c0 5f 6c 65 6e 00 5f 73 74 61 72 74 00 5f 5f 62 73 |_len._start.__bs|
000003d0 73 5f 73 74 61 72 74 00 5f 65 64 61 74 61 00 5f |s_start._edata._|
000003e0 65 6e 64 00 |end.|
000003e4 Biology Updated 2025-07-16
City in the United Kingdom Updated 2025-07-16
Holonomic function Updated 2025-07-16
XY sex-determination system Updated 2025-07-16
Don't repeat yourself Updated 2025-07-16
Media rationale of Ciro Santilli's website Updated 2025-07-16
Meritocracy Updated 2025-07-16
Regular expression Updated 2025-07-16
Steve Jobs quote on saving lives with a faster boot Updated 2025-07-16
This idea also comes up in other sources of course.
The truth will set you free Updated 2025-07-16
Zermelo-Fraenkel set theory Updated 2025-10-14
One of the first formal proof systems. This is actually understandable!
This is Ciro Santilli-2020 definition of the foundation of mathematics (and the only one he had any patience to study at all).
TODO what are its limitations? Why were other systems created?
ELF Hello World Tutorial Generate the example Updated 2025-07-16
hello_world.asm
section .data
hello_world db "Hello world!", 10
hello_world_len equ $ - hello_world
section .text
global _start
_start:
mov rax, 1
mov rdi, 1
mov rsi, hello_world
mov rdx, hello_world_len
syscall
mov rax, 60
mov rdi, 0
syscallCompiled with:
nasm -w+all -f elf64 -o 'hello_world.o' 'hello_world.asm'
ld -o 'hello_world.out' 'hello_world.o' Yeast artificial chromosome Updated 2025-07-16
ELF Hello World Tutorial How to learn Updated 2025-07-16
Spin like mad between:
- standards
- high level generators. We use the assembler
asand linkerld. - hexdumps
- file decompilers. We use
readelf. It makes it faster to read the ELF file by turning it into human readable output. But you must have seen one byte-by-byte example first, and think howreadelfoutput maps to the standard. - low-level generators: stand-alone libraries that let you control every field of the ELF files you generated. github.com/BR903/ELFkickers, github.com/sqall01/ZwoELF and many more on GitHub.
- consumer: the
execsystem call of the Linux kernel can parse ELF files to starts processes: github.com/torvalds/linux/blob/v4.11/fs/binfmt_elf.c, stackoverflow.com/questions/8352535/how-does-kernel-get-an-executable-binary-file-running-under-linux/31394861#31394861
ELF Hello World Tutorial Index 0 section Updated 2025-07-16
Contained in bytes 0x40 to 0x7F.
The first section is always magic: www.sco.com/developers/gabi/2003-12-17/ch4.sheader.html says:
If the number of sections is greater than or equal to SHN_LORESERVE (0xff00), e_shnum has the value SHN_UNDEF (0) and the actual number of section header table entries is contained in the sh_size field of the section header at index 0 (otherwise, the sh_size member of the initial entry contains 0).
There are also other magic sections detailed in
Figure 4-7: Special Section Indexes. Skew-symmetric form Updated 2025-07-16
CAIDA/commoncrawl-host-ip-mapper Updated 2025-07-16
Human spinal cord Updated 2025-07-16
Particle in a box Updated 2025-07-16
There are unlisted articles, also show them or only show them.