sslab-gatech / winnie

Winnie is an end-to-end system that makes fuzzing Windows applications easy
MIT License
534 stars 74 forks source link

How to debug winnie? #42

Closed dms1lva closed 2 years ago

dms1lva commented 2 years ago

I am trying to figure out why my target program crashes when running with winnie. I would like to debug winnie using visual studio but it fails to inject the forkserver dll when doing so. I set afl-fuzz as the startup project.

Not sure if related but FindModule in process.c does not seem to receive a valid process handle.

BOOL ok = GetProcessImageFileNameA(hProcess, processName, 256);
fprintf(stderr, "%s", processName);

I added this piece of code in FindModule and it works fine when running afl-fuzz, but not under a debugger.

Any advice on how to debug winnie? Or on how to debug a target process that crashes only under winnie?

stong commented 2 years ago

You should avoid using VS debugger. I recommend x64dbg.

GetProcessImageFileNameA

I'm not sure why this function would fail under debugger. I suspect it could be due to something done by Visual Studio debugger.

Or on how to debug a target process that crashes only under winnie?

The best advice I can give in general is to refer to these steps in the README. It's hard to say exactly what is wrong without more information on the specific target application.

stong commented 2 years ago

Closed due to inactivity.