You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running winafl commit 5b7d718 and using the -target_method command line argument, winafl erroneously searches for to_wrap instead of the specified method on the command line.
Here is my harness:
#define _CRT_SECURE_NO_WARNINGS // Just shut up compiler warnings
#include <stdio.h>
#include <windows.h>
#include <gdiplus.h>
using namespace Gdiplus;
wchar_t* charToWChar(const char* text)
{
size_t size = strlen(text) + 1;
wchar_t* wa = new wchar_t[size];
mbstowcs(wa, text, size);
return wa;
}
__declspec(noinline) void loop(wchar_t* filename) {
// Main persistent loop here
Image* image = NULL;
Image* thumbnail=NULL;
image = new Image(filename);
if (image && (Ok == image->GetLastStatus())) {
//printf("Image loaded\n");
thumbnail = image->GetThumbnailImage(100, 100, NULL, NULL);
/*
if(thumbnail && (Ok == thumbnail->GetLastStatus())) {
//printf("Thumbnail created\n");
}
*/
}
//printf("Done\n");
if (image) delete image;
if(thumbnail) delete thumbnail;
}
int main(int argc, char** argv)
{
/*
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartupOutput gdiplusStartupOutput;
ULONG_PTR gdiplusToken = 0;
*/
if (argc < 2) {
printf("Usage: %s <image file>\n", argv[0]);
return 0;
}
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
wchar_t* fname = charToWChar(argv[1]);
while (true) {
loop(fname); // Just call the target method in a loop. This is to use the persistent mode of winafl.
}
GdiplusShutdown(gdiplusToken);
return 0;
}
Hi!
When running winafl commit 5b7d718 and using the
-target_method
command line argument, winafl erroneously searches forto_wrap
instead of the specified method on the command line.Here is my harness:
and here is my command line for fuzzing:
here is the error box displayed by the program when I try to run it.
so the culprit seems to be in the way the program tries to find the symbol:
I have verified that the loop function actually exists in the resulting binary with ghidra.
The text was updated successfully, but these errors were encountered: