winafl icon indicating copy to clipboard operation
winafl copied to clipboard

WinAfl instrument.exe ERRORS

Open Daniel0xcc opened this issue 5 years ago • 10 comments

Hello again haha :), I try to create an insturment file for my program to test the fuzzer,

My input command is instrument.exe --mode=afl --input-image=Program.exe --output-image=Program.instr.exe --force-decompose --multithread --cookie-check-hook

But when I try to run this command i get errors which look like this :

[0705/204753:ERROR:dia_util.cc(64)] Failed to create Dia object. [0705/204753:ERROR:dia_util.cc(65)] NoRegCoCreate failed with: [hr=0x800700c1, msg=%1 is not a valid Win32 application.] [0705/204753:ERROR:dia_util.cc(66)] CreateInstance failed with: [hr=0x80040154, msg=Class not registered] [0705/204753:ERROR:pe_relinker.cc(66)] Unable to decompose module: C:\Users\danie\Desktop\winafl\bin32\Program.exe [0705/204753:ERROR:instrumenter_with_relinker.cc(124)] Failed to initialize relinker.

Can someone help me please :) thanks, mrxsys.

Daniel0xcc avatar Jul 05 '19 17:07 Daniel0xcc

Did you build the binary you are trying to instrument with /PROFILE linker flag. Also note that static instrumentation works only on 32-bit binaries (see https://github.com/googleprojectzero/winafl/blob/master/readme_syzygy.md)

ifratric avatar Jul 08 '19 09:07 ifratric

Hi, I've got similar issue when running the example test_static.exe:

C:\Users\ditah\Desktop\winafl\bin32>instrument.exe --mode=afl --input-image=test_static.exe --output-image=test_static.instr.exe --force-decompose

[0502/153213:INFO:application_impl.h(46)] Syzygy Instrumenter Version 0.8.32.0 (190dbfe). [0502/153213:INFO:application_impl.h(48)] Copyright (c) Google Inc. All rights reserved. [0502/153213:INFO:pe_relinker_util.cc(336)] Input PDB not specified, searching for it. [0502/153213:INFO:pe_relinker_util.cc(362)] Using default output PDB path: C:\Users\ditah\Desktop\winafl\bin32\test_static.instr.exe.pdb [0502/153213:INFO:pe_relinker.cc(138)] Input module : C:\Users\ditah\Desktop\winafl\bin32\test_static.exe [0502/153213:INFO:pe_relinker.cc(139)] Input PDB : .\test_static.pdb [0502/153213:INFO:pe_relinker.cc(140)] Output module: C:\Users\ditah\Desktop\winafl\bin32\test_static.instr.exe [0502/153213:INFO:pe_relinker.cc(141)] Output PDB : C:\Users\ditah\Desktop\winafl\bin32\test_static.instr.exe.pdb [0502/153213:INFO:pe_relinker.cc(57)] Decomposing module: C:\Users\ditah\Desktop\winafl\bin32\test_static.exe [0502/153213:ERROR:dia_util.cc(64)] Failed to create Dia object. [0502/153213:ERROR:dia_util.cc(65)] NoRegCoCreate failed with: [hr=0x8007007e, msg=The specified module could not be found.] [0502/153213:ERROR:dia_util.cc(66)] CreateInstance failed with: [hr=0x80040154, msg=Class not registered] [0502/153213:ERROR:pe_relinker.cc(66)] Unable to decompose module: C:\Users\ditah\Desktop\winafl\bin32\test_static.exe [0502/153213:ERROR:instrumenter_with_relinker.cc(124)] Failed to initialize relinker.

Thanks, Dor

ditah22 avatar May 02 '21 12:05 ditah22

It can't open IDiaDataSource interface to get access to debugging symbols. Have you any msdiaXXX.dll registered?

nevilad avatar May 05 '21 11:05 nevilad

I tried to follow this readme_syzygy, I ran regsvr32 /s msdia140.dll in cmd before instrument.exe --mode=afl --input-image=test_static.exe --output-image=test_static.instr.exe --force-decompose if that's what you meant..

Do I need to run something else?

BTW, my Windows version is 1909 and I used the pre-compiled binaries that winafl provided.

ditah22 avatar May 05 '21 11:05 ditah22

Did regsvr32 /s msdia140.dll ran successfully?

nevilad avatar May 05 '21 12:05 nevilad

Didn't print any error...

image

ditah22 avatar May 05 '21 13:05 ditah22

Looks like successfull registered msdia, but still can't load it. Try to run instrument.exe with your command line in dependency viewer. This will log al the errors in dll loading.

nevilad avatar May 05 '21 17:05 nevilad

I'm not sure if that's what you meant: image And I'm not sure what to do with those missing dlls

ditah22 avatar May 09 '21 11:05 ditah22

No, that's static view. I meant a profiling run, Profile->Start profiling run... menu in the original dependency walker.

nevilad avatar May 09 '21 11:05 nevilad

I had the same Issue and found a fix for it. First of all I noticed when executing the regsvr32 /s msdia140.dll command, the /s is for silent. That's why it didn't error. To register it successfully I opened an elevated command prompt went to this C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin> path and executed regsvr32 msdia140.dll. This resulted in a Message Box with a success message.

After that the instrument command was successful too.

kilimnik avatar Jul 21 '21 17:07 kilimnik