| 182 | } |
| 183 | |
| 184 | void BinaryPatch::apply(patch_byte *ptr, size_t len, bool newv) |
| 185 | { |
| 186 | for (size_t i = 0; i < entries.size(); i++) |
| 187 | { |
| 188 | Byte &bv = entries[i]; |
| 189 | assert (bv.offset < len); |
| 190 | |
| 191 | ptr[bv.offset] = (newv ? bv.new_val : bv.old_val); |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | bool load_file(std::vector<patch_byte> *pvec, std::string fname) |
| 196 | { |