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
Analysis
At line 26, the getopt() function is declared.
At lines 28 through 31, local variables are declared that are used for parsing the
command-line option and option specifier string.
At lines 38 through 70, the command-line arguments are parsed based upon
the option specifier string, with the option specified being returned from the
function, and optionally the value for the option being assigned to the optarg
global variable.
Example 6.30 shows code for the getopt test program.
Example 6.30 getopt Test Program (main.c)
1 /*
2 * main.c
3 *
4 * Win32 getopt example
5 */
6
7
#include <stdio.h>
8 #include "getopt.h"
9
10
int
11 main(int argc, char *argv[])
12
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