Changeset 4839
- Timestamp:
- Aug 23, 2012, 4:10:27 PM (7 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/configure.ac
r4836 r4839 74 74 AC_CHECK_FUNCS(__fgets_chk __fgets_unlocked_chk __fread_chk __fread_unlocked_chk __read_chk __recv_chk __recvfrom_chk) 75 75 AC_CHECK_FUNCS(CreateFileA CreateFileW ReOpenFile ReadFile CloseHandle) 76 AC_CHECK_FUNCS(AllocConsole AttachConsole SetConsoleMode WriteConsoleOutputA WriteConsoleOutputW) 76 77 77 78 AC_CHECK_TYPES(sighandler_t, [], [], -
zzuf/trunk/msvc/config.h
r4837 r4839 23 23 /* #undef HAVE_AIO_H */ 24 24 /* #undef HAVE_AIO_READ */ 25 #define HAVE_ALLOCCONSOLE 1 25 26 /* #undef HAVE_ARPA_INET_H */ 27 #define HAVE_ATTACHCONSOLE 1 26 28 #define HAVE_BIND 1 27 29 #define HAVE_CLOSEHANDLE 1 … … 89 91 #define HAVE_REGWEXEC 1 90 92 #define HAVE_REOPENFILE 1 93 #define HAVE_SETCONSOLEMODE 1 91 94 /* #undef HAVE_SETENV */ 92 95 /* #undef HAVE_SETRLIMIT */ … … 115 118 #define HAVE_WINDOWS_H 1 116 119 #define HAVE_WINSOCK2_H 1 120 #define HAVE_WRITECONSOLEOUTPUTA 1 121 #define HAVE_WRITECONSOLEOUTPUTW 1 117 122 /* #undef HAVE__IO_GETC */ 118 123 #define HAVE__PIPE 1 -
zzuf/trunk/src/libzzuf/lib-win32.c
r4837 r4839 1 1 /* 2 2 * zzuf - general purpose fuzzer 3 * Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net> 3 * Copyright (c) 2006-2012 Sam Hocevar <sam@hocevar.net> 4 * 2012 Kévin Szkudłapski <kszkudlapski@quarkslab.com> 4 5 * All Rights Reserved 5 6 * … … 85 86 static BOOL (__stdcall *ORIG(CloseHandle))(HANDLE); 86 87 #endif 88 #if defined HAVE_ALLOCCONSOLE 89 static BOOL (__stdcall *ORIG(AllocConsole))(); 90 #endif 91 #if defined HAVE_ATTACHCONSOLE 92 static BOOL (__stdcall *ORIG(AttachConsole))(DWORD dwProcessId); 93 #endif 94 #if defined HAVE_SETCONSOLEMODE 95 static BOOL (__stdcall *ORIG(SetConsoleMode))(HANDLE hConsoleHandle, 96 DWORD dwMode); 97 #endif 98 #if defined HAVE_WRITECONSOLEOUTPUTA 99 static BOOL (__stdcall *ORIG(WriteConsoleOutputA))(HANDLE hConsoleOutput, 100 CONST CHAR_INFO *lpBuffer, COORD dwBufferSize, 101 COORD dwBufferCoord, PSMALL_RECT lpWriteRegion); 102 #endif 103 #if defined HAVE_WRITECONSOLEOUTPUTW 104 static BOOL (__stdcall *ORIG(WriteConsoleOutputW))(HANDLE hConsoleOutput, 105 CONST CHAR_INFO *lpBuffer, COORD dwBufferSize, 106 COORD dwBufferCoord, PSMALL_RECT lpWriteRegion); 107 #endif 87 108 88 109 /* … … 213 234 HANDLE __stdcall NEW(CreateIoCompletionPort)(HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads) 214 235 { 215 HANDLE ret; 216 217 ret = ORIG(CreateIoCompletionPort)(FileHandle, ExistingCompletionPort, CompletionKey, NumberOfConcurrentThreads); 218 219 debug("GetQueuedCompletionStatus(0x%08x, 0x%08x, 0x%08x, %d) = 0x%08x", 220 FileHandle, ExistingCompletionPort, CompletionKey, NumberOfConcurrentThreads, ret); 236 HANDLE ret; 237 238 ret = ORIG(CreateIoCompletionPort)(FileHandle, ExistingCompletionPort, 239 CompletionKey, NumberOfConcurrentThreads); 240 241 debug("GetQueuedCompletionStatus(0x%08x, 0x%08x, 0x%08x, %d) = 0x%08x", 242 FileHandle, ExistingCompletionPort, CompletionKey, 243 NumberOfConcurrentThreads, ret); 221 244 222 245 if (!_zz_ready || !_zz_iswatched(FileHandle) /*|| !_zz_hostwatched(hFile)*/ || _zz_islocked(FileHandle) || !_zz_isactive(FileHandle)) … … 229 252 } 230 253 231 254 return ret; 232 255 } 233 256 #endif … … 240 263 ret = ORIG(GetQueuedCompletionStatus)(CompletionPort, lpNumberOfBytes, lpCompletion, lpOverlapped, dwMilliseconds); 241 264 242 265 debug("GetQueuedCompletionStatus(0x%08x, { %d }, %p, %p, %d) = %s", 243 266 CompletionPort, *lpNumberOfBytes, lpCompletion, lpOverlapped, dwMilliseconds, (ret ? "TRUE" : "FALSE")); 244 267 … … 345 368 _zz_unregister(hObject); 346 369 return ret; 370 } 371 #endif 372 373 #if defined HAVE_ALLOCCONSOLE 374 BOOL __stdcall NEW(AllocConsole)() 375 { 376 debug("AllocConsole()"); 377 return ORIG(AllocConsole)(); 378 } 379 #endif 380 381 #if defined HAVE_ATTACHCONSOLE 382 BOOL __stdcall NEW(AttachConsole)(DWORD dwProcessId) 383 { 384 debug("AttachConsole(%#08x)"); 385 return ORIG(AttachConsole)(dwProcessId); 386 } 387 #endif 388 389 #if defined HAVE_SETCONSOLEMODE 390 BOOL __stdcall NEW(SetConsoleMode)(HANDLE hConsoleHandle, DWORD dwMode) 391 { 392 debug("SetConsoleMode(%#08x, %#08x)", (int)hConsoleHandle, dwMode); 393 return ORIG(SetConsoleMode)(hConsoleHandle, dwMode); 394 } 395 #endif 396 397 #if defined HAVE_WRITECONSOLEOUTPUTA 398 BOOL __stdcall NEW(WriteConsoleOutputA)(HANDLE hConsoleOutput, 399 CONST CHAR_INFO *lpBuffer, COORD dwBufferSize, 400 COORD dwBufferCoord, PSMALL_RECT lpWriteRegion) 401 { 402 debug("WriteConsoleOutputA(%#08x, %p, ...)", (int)hConsoleOutput, lpBuffer); 403 return ORIG(WriteConsoleOutputA)(hConsoleOutput, lpBuffer, dwBufferSize, 404 dwBufferCoord, lpWriteRegion); 405 } 406 #endif 407 408 #if defined HAVE_WRITECONSOLEOUTPUTW 409 BOOL __stdcall NEW(WriteConsoleOutputW)(HANDLE hConsoleOutput, 410 CONST CHAR_INFO *lpBuffer, COORD dwBufferSize, 411 COORD dwBufferCoord, PSMALL_RECT lpWriteRegion) 412 { 413 debug("WriteConsoleOutputW(%#08x, %p, ...)", (int)hConsoleOutput, lpBuffer); 414 return ORIG(WriteConsoleOutputW)(hConsoleOutput, lpBuffer, dwBufferSize, 415 dwBufferCoord, lpWriteRegion); 347 416 } 348 417 #endif … … 361 430 DIVERT(ReadFile), 362 431 DIVERT(ReadFileEx), 363 432 DIVERT(CreateIoCompletionPort), 364 433 DIVERT(GetQueuedCompletionStatus), 365 434 DIVERT(GetOverlappedResult), … … 367 436 DIVERT(CreateFileMappingW), 368 437 DIVERT(MapViewOfFile), 438 439 #if defined HAVE_ALLOCCONSOLE 440 DIVERT(AllocConsole), 441 #endif 442 #if defined HAVE_ATTACHCONSOLE 443 DIVERT(AttachConsole), 444 #endif 445 #if defined HAVE_SETCONSOLEMODE 446 DIVERT(SetConsoleMode), 447 #endif 448 #if defined HAVE_WRITECONSOLEOUTPUTA 449 DIVERT(WriteConsoleOutputA), 450 #endif 451 #if defined HAVE_WRITECONSOLEOUTPUTW 452 DIVERT(WriteConsoleOutputW), 453 #endif 454 369 455 DIVERT_END 370 456 }; -
zzuf/trunk/src/libzzuf/sys.c
r4838 r4839 1 1 /* 2 2 * zzuf - general purpose fuzzer 3 * Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net> 3 * Copyright (c) 2006-2012 Sam Hocevar <sam@hocevar.net> 4 * 2012 Kévin Szkudłapski <kszkudlapski@quarkslab.com> 4 5 * All Rights Reserved 5 6 * … … 264 265 static int relocate_hook(uint8_t **code) 265 266 { 266 267 uint8_t *cur_code = *code; 267 268 268 269 #ifdef _M_AMD64 269 270 // we ignore the REX prefix 270 271 if ((*cur_code & 0xf8) == 0x48) 271 272 ++cur_code; 272 273 #endif 273 274
Note: See TracChangeset
for help on using the changeset viewer.