Harness with Example
Open the input file. This needs to happen within the target function so that you can read a new input file for each iteration as the input file is rewritten between target function runs.
Parse it (so that you can measure coverage of file parsing)
Close the input file. This is important because if the input file is not closed WinAFL won't be able to rewrite it.
Return normally (So that WinAFL can "catch" this return and redirect execution. "returning" via ExitProcess() and such won't work)extern "C" __declspec(dllexport) int main(int argc, char* argv[]);int main(int argc, char* argv[])
{
if (__argc > 2)
{
return 0;
}
process(charToWChar(argv[1]));
return 0;
}Last updated