Changeset 1403
- Timestamp:
- 10/06/07 21:14:17 (11 months ago)
- Files:
-
- libemu/trunk/testsuite/sctest.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libemu/trunk/testsuite/sctest.c
r1374 r1403 2064 2064 if ( (off = emu_shellcode_test(e, (uint8_t *)opts.scode, opts.size)) >= 0 ) 2065 2065 { 2066 printf(SUCCESS" \n");2066 printf(SUCCESS" (offset %i (0x%x))\n",off,(unsigned int)off); 2067 2067 opts.offset = off; 2068 2068 test(n); … … 2126 2126 {"l", "listtests" , NULL , "list all tests"}, 2127 2127 {"d", "dump" , "INTEGER" , "dump the shellcode (binary) to stdout"}, 2128 {"g", "getpc" , "INTEGER", "run getpc mode, try to detect a shellcode"},2128 {"g", "getpc" , NULL , "run getpc mode, try to detect a shellcode"}, 2129 2129 {"G", "graph" , "FILEPATH", "save a dot formatted callgraph in filepath"}, 2130 2130 {"h", "help" , NULL , "show this help"}, 2131 2131 {"S", "stdin" , NULL , "read shellcode/buffer from stdin, works with -g"}, 2132 {"o", "offset" , "[INT|HEX]", "manual offset for shellcode, accepts int and hexvalues"}, 2132 2133 }; 2133 2134 … … 2171 2172 {"help" , 0, 0, 'h'}, 2172 2173 {"stdin" , 0, 0, 'S'}, 2174 {"offset" , 1, 0, 'o'}, 2173 2175 {0, 0, 0, 0} 2174 2176 }; 2175 2177 2176 c = getopt_long (argc, argv, "vs:t:ld:gG:hS ", long_options, &option_index);2178 c = getopt_long (argc, argv, "vs:t:ld:gG:hSo:", long_options, &option_index); 2177 2179 if ( c == -1 ) 2178 2180 break; … … 2220 2222 break; 2221 2223 2224 case 'o': 2225 if (strncasecmp(optarg, "0x", 2) == 0) 2226 opts.offset = strtol(optarg+2, NULL, 16); // hex vvalue 2227 else 2228 opts.offset = strtol(optarg, NULL, 10); // decimal vvalue 2229 printf("offset %i (0x%x)\n", opts.offset, (unsigned int)opts.offset); 2230 break; 2231 2232 2222 2233 default: 2223 2234 printf ("?? getopt returned character code 0%o ??\n", c); 2224 2235 break; 2236 2225 2237 } 2226 2238 }
