MCPcopy Create free account
hub / github.com/axhlzy/Il2CppHookScripts / printCtx

Function printCtx

Il2cppHook/_Ufunc.js:8677–8711  ·  view source on GitHub ↗
(mPtr, range = 5, type = 0, redLine = enum_1.LogColor.WHITE, space = 0)

Source from the content-addressed store, hash-verified

8675exports.printCtx = void 0;
8676const enum_1 = require("../base/enum");
8677var printCtx = (mPtr, range = 5, type = 0, redLine = enum_1.LogColor.WHITE, space = 0) => {
8678 if (Process.arch != "arm")
8679 return;
8680 mPtr = checkPointer(mPtr);
8681 if (mPtr.isNull())
8682 return;
8683 if (type != 0) {
8684 for (let offset = 0; offset < range; offset++)
8685 printLOG(mPtr, offset);
8686 }
8687 else {
8688 let max = range == undefined ? 5 : (range % 2 == 1 ? (range + 1) : range) / 2;
8689 let min = range == undefined ? -4 : max - range;
8690 for (let offset = min; offset < max; offset++)
8691 printLOG(mPtr, offset);
8692 }
8693 function printLOG(pointer, offset) {
8694 let cur_p = pointer.add(p_size * offset);
8695 let cur_value = String(cur_p.readPointer());
8696 if (Process.arch == "arm" && cur_value.length != 10)
8697 cur_value = cur_value.replace("000", "0000");
8698 let cur_tmp = Array.from(cur_value.toUpperCase());
8699 let cur_str = (cur_tmp.length == 10) ? cur_value : "";
8700 if (type == 1) {
8701 cur_str = cur_tmp[2] + cur_tmp[3] + ' ' + cur_tmp[4] + cur_tmp[5] + ' ' + cur_tmp[6] + cur_tmp[7] + ' ' + cur_tmp[8] + cur_tmp[9];
8702 }
8703 else if (type == 2) {
8704 cur_str = cur_tmp[8] + cur_tmp[9] + ' ' + cur_tmp[6] + cur_tmp[7] + ' ' + cur_tmp[4] + cur_tmp[5] + ' ' + cur_tmp[2] + cur_tmp[3];
8705 }
8706 try {
8707 LOG(getLine(space, "\t") + cur_p + "\t" + cur_str + "\t" + Instruction.parse(cur_p), redLine);
8708 }
8709 catch (e) { }
8710 }
8711};
8712exports.printCtx = printCtx;
8713globalThis.printCtx = printCtx;
8714},{"../base/enum":6}],186:[function(require,module,exports){

Callers 1

catchErrorMethod · 0.70

Calls 3

isNullMethod · 0.80
checkPointerFunction · 0.70
printLOGFunction · 0.70

Tested by

no test coverage detected