MCPcopy Create free account
hub / github.com/Do0ks/GSpots / readBinaryFile

Function readBinaryFile

GOffsets/GOffsets.cpp:12–24  ·  view source on GitHub ↗

Reads the binary file.

Source from the content-addressed store, hash-verified

10
11// Reads the binary file.
12std::vector<Byte> readBinaryFile(const std::string& filename) {
13 std::ifstream file(filename, std::ios::binary);
14 if (!file) {
15 std::cerr << "Error: Could not open file " << filename << std::endl;
16 return {};
17 }
18 file.seekg(0, std::ios::end);
19 size_t fileSize = file.tellg();
20 std::vector<Byte> buffer(fileSize);
21 file.seekg(0, std::ios::beg);
22 file.read(reinterpret_cast<char*>(buffer.data()), fileSize);
23 return buffer;
24}
25
26// Signatures
27std::vector<Signature> getSignatures() {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected