| 8 | #include "recomp.h" |
| 9 | |
| 10 | static std::vector<uint8_t> read_file(const std::filesystem::path& path, bool& found) { |
| 11 | std::vector<uint8_t> ret; |
| 12 | found = false; |
| 13 | |
| 14 | std::ifstream file{ path, std::ios::binary}; |
| 15 | |
| 16 | if (file.good()) { |
| 17 | file.seekg(0, std::ios::end); |
| 18 | ret.resize(file.tellg()); |
| 19 | file.seekg(0, std::ios::beg); |
| 20 | |
| 21 | file.read(reinterpret_cast<char*>(ret.data()), ret.size()); |
| 22 | found = true; |
| 23 | } |
| 24 | |
| 25 | return ret; |
| 26 | } |
| 27 | |
| 28 | |
| 29 | uint32_t read_u32_swap(const std::vector<uint8_t>& vec, size_t offset) { |