googleprojectzero / googleprojectzero/Jackalope

Handling Wide strings

Open
#47 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.4k
Forks
157
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the wmain entry point and the shown wide-string serialize/deserialize harness, then inspect how Jackalope locates executable entry points on Windows. Reproduce the failure with the provided command-line input; done means Jackalope can discover and run this harness successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.