winafl icon indicating copy to clipboard operation
winafl copied to clipboard

CreateProcess failed GLE =2 and drrun.exe with -debug reports nothing

Open EricGrange opened this issue 5 years ago • 1 comments

I am trying run winafl on a Delphi 32bit executable, but afl-fuzz fails with a GLE=2 and no further details

S:\winafl\bin32>afl-fuzz -i input -o output -t 1000 -D s:\DynamicRIO\bin32\ -- -coverage-module dwsFuzz.exe -target_module dwsFuzz.exe -target_method FuzzTest -nargs 1 -- s:\winafl\bin32\dwsFuzz.exe "@@"
WinAFL 1.16b by <[email protected]>
Based on AFL 2.43b by <[email protected]>
[+] You have 8 CPU cores and 0 runnable tasks (utilization: 0%).
[+] Try parallel jobs - see docs\parallel_fuzzing.txt.
[*] Checking CPU core loadout...
[+] Found a free CPU core, binding to #0.
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning 'input'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Attempting dry run with 'id_000000'...

[-] PROGRAM ABORT : CreateProcess failed, GLE=2.

         Location : create_target_process(), c:\work\winafl\source\afl-fuzz.c:2330

(I tried the @@ with and without simple and double quotes)

when attempting a debug run with drrun.exe, no log file is created and no error is reported, the command

S:\winafl\bin32>\DynamoRIO\bin32\drrun.exe -c winafl.dll -debug -target_module dwsFuzz.exe -fuzz_iterations 10 -target_offset 0x002EFBE4 -nargs 1 -- s:\winafl\bin32\dwsFuzz.exe s:\winafl\bin32\input\test.pas

Just returns with an empty line.

I also tried -target_method with the method name (I checked it is properly exported with Nirsoft DLL export viewer), but no difference.

Any hints as to what is missing ?

EricGrange avatar Nov 05 '20 08:11 EricGrange

GLE means "GetLastError", so GLE=2 indicates ERROR_FILE_NOT_FOUND so, please be sure that s:\winafl\bin32\dwsFuzz.exe and DynamoRIO files exist.

xxldao avatar Jan 01 '22 08:01 xxldao