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
312
313
/*
314 * parse()
315 *
316 *
317 */
318 int parse (char *sprt, unsigned short *lport, unsigned short
319 *hport)
320 {
321 char *tmp = NULL;
322
323
tmp = (char *) strchr(sprt, '-');
324 if(tmp == NULL)
325 {
326 *hport =
327 *lport = (unsigned short) atoi(sprt);
328 }
329 else
330 {
331 *tmp = '\0';
332 *lport = (unsigned short) atoi(sprt);
333 ++tmp;
334 *hport = (unsigned short) atoi(tmp );
335 }
336
337
if(*lport == 0 ||
338 *hport == 0 ||
339 (*lport > *hport))
340 {
341 return(-1);
342 }
343
344
return(0);
345 }
346
347
/*
348 * sighandler()
349 *
350 *
351 */
352 void sighandler (int sig)
353 {
354 }
355
356
/*
357 * usage()
358 *
359 *
360 */
361 void usage(char *prog)
362 {
363 printf("rpc1 00.00.01\n");
364 printf("usage : %s -t target_ip -p port_range\n", prog);
365 printf("example: ...
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