Exemple #1
0
// patches file's PE header to make it compatible with WinXP
void patchHeader(LPCSTR filename)
{
	PeLib::PeFile* pef = PeLib::openPeFile(filename);
	pef->readMzHeader();
	pef->readPeHeader();

	PatchPeHeaderVisitor vis;
	pef->visit(vis);

	delete pef;
}
Exemple #2
0
void pack_pe(char * name)
{
    std::string filename = name;
    PeLib::PeFile* pef = PeLib::openPeFile(filename);
	
	if (!pef)
	{
		std::cout << "Invalid PE File" << std::endl;
		return ;
	}

	pef->readMzHeader();
	pef->readPeHeader();


	dump(centerOutput("----------------------------------------------"));
	dump(centerOutput("PE Loaded"));
	dump(centerOutput("----------------------------------------------"));
	
	PeRebuilderVisitor  v2;
	pef->visit(v2);
	
	delete pef;     
}