I attached with WinDBG to my harness process after it was spawned by drrun.exe and it was crashing when my harness called LoadLibraryW to load the target DLL. Here it's a piece of code from my harness:
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) {
printf("main started, waiting for debugger....\n");
Sleep(10000);
HMODULE hImporter = NULL;
hImporter = LoadLibraryW(L"target.dll");
This is the call stack in WinDBG (ImporterSDK is my harness):
If I continue the execution, it crashes (Access Violation) at the following instruction:
I don't know where this code is actually located, since the call stack is not giving any clues. I guess it has to be some winafl instrumentation code that hooked the call to LoadLibrary?
Usually, is not fs:[0C0h] used for 32bit binaries? I compiled everything as 64bit.
If I load another library, as for example KERNEL32, instead of the target library I want to fuzz, the LoadLibraryW call is executed correctly also with the winafl.dll instrumentation.
I'm trying to fuzz a target DLL for which I built an harness for (both 64bit).
if I run
drrun.exe
withoutwinafl.dll
instrumentation, it works:drrun.exe -c bbcount.dll -- target.exe
If I execute
drrun.exe
withwinafl.dll
instead:drrun.exe -c winafl.dll -debug -- target.exe
The target immediately crashes. logfile below:
I attached with WinDBG to my harness process after it was spawned by
drrun.exe
and it was crashing when my harness calledLoadLibraryW
to load the target DLL. Here it's a piece of code from my harness:This is the call stack in WinDBG (
ImporterSDK
is my harness):If I continue the execution, it crashes (Access Violation) at the following instruction:
I don't know where this code is actually located, since the call stack is not giving any clues. I guess it has to be some winafl instrumentation code that hooked the call to
LoadLibrary
?Usually, is not
fs:[0C0h]
used for 32bit binaries? I compiled everything as 64bit. If I load another library, as for exampleKERNEL32
, instead of the target library I want to fuzz, theLoadLibraryW
call is executed correctly also with thewinafl.dll
instrumentation.