MCPcopy Create free account
hub / github.com/DFHack/dfhack / apply

Method apply

library/binpatch.cpp:184–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void 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
195bool load_file(std::vector<patch_byte> *pvec, std::string fname)
196{

Callers 1

mainFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected