| 36 | } |
| 37 | |
| 38 | bool WriteFile(const std::string& filename, const std::vector<uint8_t>& bin) |
| 39 | { |
| 40 | std::ofstream outfile(filename, std::ios::out | std::ios::binary); |
| 41 | if (!outfile) |
| 42 | { |
| 43 | std::cerr << "Error: Could not open file for writing: " + filename << std::endl; |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | outfile.write(reinterpret_cast<const char*>(bin.data()), bin.size()); |
| 48 | outfile.close(); |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | bool ReadFile(const std::string& filename, std::vector<uint8_t>& bin) |
| 53 | { |