示例#1
0
	void Imports(const po::variables_map& variables, int& retcode)
	{
		retcode = 1;

		if (variables.count("input") != 1)
		{
			std::wcerr << L"Error parsing options: must have one input file." << std::endl;
			return;
		}

		auto out = OpenOutput<wchar_t>(variables);
		if (!out) 
			return;

		retcode = 0;

		auto inputs = variables["input"].as<std::vector<std::wstring>>();

		PEParser pe(inputs[0]);
		pe.Open();

		if (!pe.IsValidPE())
		{
			retcode = 1;
			return;
		}

		auto imports = pe.AllDllImports();

		for (auto& import : imports)
			*out << MultiByteToWideString(import) << L'\n';
	}
示例#2
0
String ColorProfile::GetTagText(icTagSignature tag)
{
	char text[MAX_PATH + 2];//cmsReadICCText(profile_, tag, &length);
	try
	{
		ASSERT(profile_ != 0);

		if (profile_ == 0)
			return String();

		//int length= 0;
		*text = 0;
		int length= cmsReadICCTextEx(profile_, tag, text, MAX_PATH);

		if (*text == 0 || length <= 0)
			return String();


		String tag_text;

		if (length > 0)
		{
#ifdef _UNICODE
			tag_text = MultiByteToWideString(text, length);
#else
			tag_text.assign(text, text + length);
#endif
		}
		else if (length < 0)
		{
#ifdef _UNICODE
			tag_text = reinterpret_cast<wchar_t*>(text);
#else
			tag_text = text;
#endif
		}
		return tag_text;
	}
	catch (ColorException&)
	{
		return String(_T("-"));
	}
}