Changeset 4829
- Timestamp:
- 07/11/12 19:39:13 (11 months ago)
- Location:
- zzuf/trunk/src
- Files:
-
- 2 edited
-
libzzuf/lib-win32.c (modified) (5 diffs)
-
zzuf.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/libzzuf/lib-win32.c
r4827 r4829 77 77 lpSecurityAttributes, dwCreationDisposition, 78 78 dwFlagsAndAttributes, hTemplateFile); 79 debug("CreateFileA(\"%s\", 0x%x, 0x%x, {...}, 0x%x, 0x%x, {...}) = % i",79 debug("CreateFileA(\"%s\", 0x%x, 0x%x, {...}, 0x%x, 0x%x, {...}) = %#08x", 80 80 lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, 81 81 dwFlagsAndAttributes, (int)ret); 82 83 if(!_zz_ready || _zz_islocked(-1)) return ret; 84 if (ret != INVALID_HANDLE_VALUE && dwCreationDisposition == OPEN_EXISTING && _zz_mustwatch(lpFileName)) 85 { 86 _zz_register(ret); 87 } 88 82 89 return ret; 83 90 } … … 94 101 lpSecurityAttributes, dwCreationDisposition, 95 102 dwFlagsAndAttributes, hTemplateFile); 96 debug("CreateFileW(\"%S\", 0x%x, 0x%x, {...}, 0x%x, 0x%x, {...}) = % i",103 debug("CreateFileW(\"%S\", 0x%x, 0x%x, {...}, 0x%x, 0x%x, {...}) = %#08x", 97 104 lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, 98 105 dwFlagsAndAttributes, (int)ret); 106 107 if(!_zz_ready || _zz_islocked(-1)) return ret; 108 if (ret != INVALID_HANDLE_VALUE && dwCreationDisposition == OPEN_EXISTING && _zz_mustwatch(lpFileName)) 109 { 110 debug("handle %#08x is registered", ret); 111 _zz_register(ret); 112 } 113 114 99 115 return ret; 100 116 } … … 108 124 ret = ORIG(ReOpenFile)(hOriginalFile, dwDesiredAccess, 109 125 dwShareMode, dwFlags); 110 debug("ReOpenFile(% i, 0x%x, 0x%x, 0x%x) = %i", (int)hOriginalFile,126 debug("ReOpenFile(%#08x, 0x%x, 0x%x, 0x%x) = %#08x", (int)hOriginalFile, 111 127 dwDesiredAccess, dwShareMode, dwFlags, (int)ret); 112 128 return ret; … … 128 144 debug("ReadFile(%#08x, %#08x, %#08x, %#08x, %#08x) = %s", 129 145 hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped, (ret ? "TRUE" : "FALSE")); 146 147 if (!_zz_ready || !_zz_iswatched(hFile) /*|| !_zz_hostwatched(hFile)*/ || _zz_islocked(hFile) || !_zz_isactive(hFile)) 148 return ret; 149 150 if (ret) 151 { 152 DWORD bytes_read = lpNumberOfBytesRead ? *lpNumberOfBytesRead : nNumberOfBytesToRead; 153 debug("fuzzing file %#08x\n", hFile); 154 _zz_fuzz(hFile, lpBuffer, bytes_read); 155 _zz_addpos(hFile, bytes_read); 156 } 130 157 return ret; 131 158 } … … 140 167 { 141 168 BOOL ret; 169 170 /* TODO: Check if fuzzed application tries to close our debug channel */ 171 142 172 ret = ORIG(CloseHandle)(hObject); 143 debug("CloseHandle(%i) = %s", (int)hObject, (ret ? "TRUE" : "FALSE")); 173 debug("CloseHandle(%#08x) = %s", (int)hObject, (ret ? "TRUE" : "FALSE")); 174 if (!_zz_ready || !_zz_iswatched(hObject) || _zz_islocked(hObject)) 175 return ret; 176 _zz_unregister(hObject); 144 177 return ret; 145 178 } -
zzuf/trunk/src/zzuf.c
r4828 r4829 907 907 switch (exit_code) 908 908 { 909 case EXCEPTION_ACCESS_VIOLATION: fprintf(stderr, "child(%d) unhandled exception: Access Violation ", opts->child[i].pid); break;910 default: break;909 case EXCEPTION_ACCESS_VIOLATION: fprintf(stderr, "child(%d) unhandled exception: Access Violation\n", opts->child[i].pid); break; 910 default: fprintf(stderr, "child(%d) exited with code %#08x\n", opts->child[i].pid, exit_code); break; 911 911 } 912 912 }
Note: See TracChangeset
for help on using the changeset viewer.
