Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinAfl instrument.exe ERRORS #193

Open
Daniel0xcc opened this issue Jul 5, 2019 · 10 comments
Open

WinAfl instrument.exe ERRORS #193

Daniel0xcc opened this issue Jul 5, 2019 · 10 comments

Comments

@Daniel0xcc
Copy link

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.

@ifratric
Copy link
Collaborator

ifratric commented Jul 8, 2019

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)

@ditah22
Copy link

ditah22 commented May 2, 2021

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

@nevilad
Copy link

nevilad commented May 5, 2021

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

@ditah22
Copy link

ditah22 commented May 5, 2021

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.

@nevilad
Copy link

nevilad commented May 5, 2021

Did regsvr32 /s msdia140.dll ran successfully?

@ditah22
Copy link

ditah22 commented May 5, 2021

Didn't print any error...

image

@nevilad
Copy link

nevilad commented May 5, 2021

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.

@ditah22
Copy link

ditah22 commented May 9, 2021

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

@nevilad
Copy link

nevilad commented May 9, 2021

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

@kilimnik
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants