| 26 | } |
| 27 | |
| 28 | void write_file(std::string file_path, const std::vector<uint8_t>& data) { |
| 29 | FILE* fin = fopen(file_path.c_str(), "wb"); |
| 30 | if (!fin) { |
| 31 | printf("failed to open %s.", file_path.c_str()); |
| 32 | }; |
| 33 | fwrite(data.data(), 1, data.size(), fin); |
| 34 | fclose(fin); |
| 35 | } |
| 36 | |
| 37 | typedef int (*CommandHandler)(int, char**); |
| 38 |
no test coverage detected