MCPcopy Create free account
hub / github.com/connorjaydunn/BinaryShield / main

Function main

src/main.cpp:7–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "pe.h"
6
7int main(int argc, char* argv[])
8{
9 if (argc != 4)
10 {
11 std::cerr << "usage: binaryshield.exe <target binary path> <start-rva> <end-rva>" << std::endl;
12 return 1;
13 }
14
15 std::cout << "starting..." << std::endl;
16
17 PE pe(argv[1]);
18
19 if (!pe.load())
20 return 1;
21
22 pe.addFunctionByRva(std::stoi(argv[2], nullptr, 16), std::stoi(argv[3], nullptr, 16));
23
24 std::cout << "virtualizing function(s)..." << std::endl;
25
26 if (!pe.virtualizeFunctions())
27 return 1;
28
29 std::cout << "success" << std::endl;
30
31 if (!pe.addVmSection())
32 return 1;
33
34 if (!pe.save("protected.exe"))
35 return 1;
36
37 std::cout << "exiting..." << std::endl;
38
39 return 0;
40}

Callers

nothing calls this directly

Calls 5

loadMethod · 0.80
addFunctionByRvaMethod · 0.80
virtualizeFunctionsMethod · 0.80
addVmSectionMethod · 0.80
saveMethod · 0.80

Tested by

no test coverage detected