MCPcopy Create free account
hub / github.com/Inori/GPCS4 / WriteCodeAtOffset

Method WriteCodeAtOffset

3rdParty/tinydbr/tinydbr.cpp:274–287  ·  view source on GitHub ↗

Checks if there is sufficient space and writes code at the chosen offset

Source from the content-addressed store, hash-verified

272
273// Checks if there is sufficient space and writes code at the chosen offset
274void TinyDBR::WriteCodeAtOffset(ModuleInfo* module, size_t offset, void* data, size_t size)
275{
276 if (offset + size > module->instrumented_code_size)
277 {
278 FATAL("Insufficient memory allocated for instrumented code");
279 }
280
281 memcpy(module->instrumented_code_local + offset, data, size);
282
283 if (offset + size > module->instrumented_code_allocated)
284 {
285 module->instrumented_code_allocated = offset + size;
286 }
287}
288
289// writes a pointer to the instrumented code
290void TinyDBR::WritePointer(ModuleInfo* module, size_t value)

Callers 2

HandleBasicBlockEndMethod · 0.80
WriteFunctionInfoMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected