Skip to Main Content
Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
book

Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals

by James C Foster
April 2005
Intermediate to advanced content levelIntermediate to advanced
700 pages
20h 39m
English
Syngress
Content preview from Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
the system call are ready.The number identifying the write system call is put into the AL
register in line 13.
In line 14, we call the kernel to have the system executed.
Now we need to do an exit(0), because otherwise the code will start an infinite
loop. Since exit(0) only requires one argument that has to be 0, we decrease the BL reg-
ister (line 12), which still contains 1 (it was put there in line 8) with one byte and put
the exit system call number in AL (line 14). Finally, exit is called and the program should
terminate after the string “Hello, world!” is written to stdout. Let’s compile and execute
this assembly code to see if it works:
1 [root@gabriel]# ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

32/64-Bit 80x86 Assembly Language Architecture

32/64-Bit 80x86 Assembly Language Architecture

James Leiterman

Publisher Resources

ISBN: 9781597490054