-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Description
I have those two functions that serialise and deserialise wide strings.
_declspec(dllexport) _declspec(noinline) vector<wchar_t> serialize(const wstring& file) {
vector<wchar_t> serialized_data;
serialized_data.resize(file.size() * sizeof(wchar_t));
file.copy((wchar_t*)&serialized_data, file.size());
return serialized_data;
};
_declspec(dllexport) _declspec(noinline) wstring file deserialize(const std::vector<wchar_t>& serialdata) {
return wstring((wchar_t*)&serialdata, (serialdata.size()) / sizeof(wchar_t));
};
So to test those APIs, I have created a wmain
function to allow receiving wide strings from CLI.
The problem is that Jackalope can't find the entry point for the program.
int wmain(int argc, wchar_t** argv) {
if (argc < 2) {
std::cout << "Usage fuzz-proxy: <WIDE-STRING> " << std::endl;
return -1;
}
wstring output_string;
output_string = deserialize(serialize(argv[1]));
auto check = (output_string != argv[1]);
if (!check) {
throw "Failed to serialize sequence.";
}
return 0;
}
Please guide me if I'm wrong with something.
Metadata
Metadata
Assignees
Labels
No labels