Skip to content

Handling Wide strings  #47

@MFaisalZaki

Description

@MFaisalZaki

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions