| 276 | } |
| 277 | |
| 278 | static std::vector<uint8_t> read_file(const std::filesystem::path& path) { |
| 279 | std::vector<uint8_t> ret; |
| 280 | |
| 281 | std::ifstream file{ path, std::ios::binary}; |
| 282 | |
| 283 | if (file.good()) { |
| 284 | file.seekg(0, std::ios::end); |
| 285 | ret.resize(file.tellg()); |
| 286 | file.seekg(0, std::ios::beg); |
| 287 | |
| 288 | file.read(reinterpret_cast<char*>(ret.data()), ret.size()); |
| 289 | } |
| 290 | |
| 291 | return ret; |
| 292 | } |
| 293 | |
| 294 | int main(int argc, char** argv) { |
| 295 | auto exit_failure = [] (const std::string& error_str) { |