MCPcopy Create free account
hub / github.com/Norbyte/ositools / EnableCustomStats

Method EnableCustomStats

OsiInterface/DataLibraries.cpp:366–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364 };
365
366 void LibraryManager::EnableCustomStats()
367 {
368 if (UICharacterSheetHook == nullptr
369 || ActivateClientSystemsHook == nullptr
370 || ActivateServerSystemsHook == nullptr
371 || CustomStatUIRollHook == nullptr) {
372 Debug("LibraryManager::EnableCustomStats(): Hooks not available");
373 return;
374 }
375
376 {
377 uint8_t const replacement[] = {
378#if defined(OSI_EOCAPP)
379 0xc6, 0x45, 0xf8, 0x01
380#else
381 0xB2, 0x01, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90
382#endif
383 };
384
385 WriteAnchor code(UICharacterSheetHook, sizeof(replacement));
386 memcpy(code.ptr(), replacement, sizeof(replacement));
387 }
388
389 {
390 uint8_t const replacement[] = { 0x90, 0x90 };
391 WriteAnchor code(ActivateClientSystemsHook, sizeof(replacement));
392 memcpy(code.ptr(), replacement, sizeof(replacement));
393 }
394
395 {
396 uint8_t const replacement[] = { 0x90, 0x90 };
397 WriteAnchor code(ActivateServerSystemsHook, sizeof(replacement));
398 memcpy(code.ptr(), replacement, sizeof(replacement));
399 }
400
401 {
402 uint8_t const replacement[] = { 0xC3 };
403 WriteAnchor code(CustomStatUIRollHook, sizeof(replacement));
404 memcpy(code.ptr(), replacement, sizeof(replacement));
405 }
406 }
407}

Callers

nothing calls this directly

Calls 2

DebugFunction · 0.85
ptrMethod · 0.80

Tested by

no test coverage detected