Reads the binary file.
| 10 | |
| 11 | // Reads the binary file. |
| 12 | std::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 |
| 27 | std::vector<Signature> getSignatures() { |