From 21d6697bf0aa3ab9f8f723c8d12a2089d8902744 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 7 Dec 2009 18:35:45 +0000 Subject: [PATCH] Give the fuzzed Win32 program a chance to display something even if the diverted function itself causes a crash. --- src/sys.c | 4 +++- test/zznop.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sys.c b/src/sys.c index 8601213..2d2d513 100644 --- a/src/sys.c +++ b/src/sys.c @@ -43,8 +43,10 @@ static void insert_func(void *, void *, void *); HINSTANCE (*LoadLibraryA_orig)(LPCSTR); HINSTANCE __stdcall LoadLibraryA_new(LPCSTR path) { - void *ret = LoadLibraryA_orig(path); + void *ret; fprintf(stderr, "If you see this message, DLL preloading worked\n"); + ret = LoadLibraryA_orig(path); + fprintf(stderr, "If you see this message, function diversion worked\n"); return ret; } #endif diff --git a/test/zznop.c b/test/zznop.c index 8745e0b..703d6b6 100644 --- a/test/zznop.c +++ b/test/zznop.c @@ -27,7 +27,7 @@ int main(void) AllocConsole(); fprintf(stderr, "About to call LoadLibraryA()\n"); - LoadLibraryA("whatever"); + //LoadLibraryA("whatever"); fprintf(stderr, "Finished calling LoadLibraryA()\n"); getchar();