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

Function attachNative

Il2cppHook/_Ufunc.js:8412–8436  ·  view source on GitHub ↗
(mPtr, mOnEnter, mOnLeave, needRecord = true)

Source from the content-addressed store, hash-verified

8410})(passValueKey || (passValueKey = {}));
8411let map_attach_listener = (0, globle_1.GET_MAP)(enum_1.MapKAY.map_attach_listener);
8412const attachNative = (mPtr, mOnEnter, mOnLeave, needRecord = true) => {
8413 if (typeof mPtr == "number")
8414 mPtr = ptr(mPtr);
8415 if (mPtr instanceof NativePointer && mPtr.isNull())
8416 return;
8417 var passValue = new Map();
8418 passValue.set(passValueKey.org, mPtr);
8419 passValue.set(passValueKey.src, mPtr);
8420 passValue.set(passValueKey.enter, mOnEnter);
8421 passValue.set(passValueKey.leave, mOnLeave);
8422 passValue.set(passValueKey.time, new Date());
8423 mPtr = checkPointer(mPtr);
8424 let Listener = Interceptor.attach(mPtr, {
8425 onEnter: function (args) {
8426 if (mOnEnter != undefined)
8427 mOnEnter(args, this.context, passValue);
8428 },
8429 onLeave: function (retval) {
8430 if (mOnLeave != undefined)
8431 mOnLeave(retval, this.context, passValue);
8432 }
8433 });
8434 if (needRecord)
8435 map_attach_listener.set(String(mPtr), Listener);
8436};
8437exports.attachNative = attachNative;
8438let arr_nop_addr = new Array();
8439var nopFunction = (mPtr) => {

Callers

nothing calls this directly

Calls 4

isNullMethod · 0.80
checkPointerFunction · 0.70
setMethod · 0.45
attachMethod · 0.45

Tested by

no test coverage detected