-
Notifications
You must be signed in to change notification settings - Fork 0
Base Method
AFP edited this page Apr 1, 2023
·
2 revisions
There is some base method to working with PE files:
there is some method you can use to load a PE file. first of all using file path, second method is using a vector of byte.
#include <iostream>
#include <POEX.h> // include POEX header
int main()
{
// loading as file path
auto pe1 = POEX::PE(L"1.exe");
// loading as vector of byte
std::vector<byte> data {}; // you need to fill it by data in any method you can.
auto pe2 = POEX::PE(data);
// Other stuff here
return 0;
}#include <iostream>
#include <POEX.h> // include POEX header
int main()
{
auto pe = POEX::PE(L"1.exe");
// Checking file Type
auto is64Bit = pe.Is64Bit();
// other stuff in here
return 0;
}#include <iostream>
#include <POEX.h> // include POEX header
int main()
{
auto pe = POEX::PE(L"1.exe");
// Checking file Type
auto is32Bit = pe.Is32Bit();
// other stuff in here
return 0;
}#include <iostream>
#include <POEX.h> // include POEX header
int main()
{
auto pe = POEX::PE(L"1.exe");
// Checking file Type
auto isDll = pe.IsDll();
// other stuff in here
return 0;
}#include <iostream>
#include <POEX.h> // include POEX header
int main()
{
auto pe = POEX::PE(L"1.exe");
// Checking file Type
auto isExe= pe.Exe();
// other stuff in here
return 0;
}using SaveFile() method, save changing on current base file.
#include <iostream>
#include <POEX.h> // include POEX header
int main()
{
auto pe = POEX::PE(L"1.exe");
// other stuff in here
// Saving to existing file
pe.SaveFile();
// other stuff in here
return 0;
}using SaveFile(filepath) method, save changing on new file.
#include <iostream>
#include <POEX.h> // include POEX header
int main()
{
auto pe = POEX::PE(L"1.exe");
// other stuff in here
// Saving to another file
pe.SaveFile(L"2.exe");
// other stuff in here
return 0;
}