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

Method idOffset

Il2cppHook/_Ufunc.js:12311–12321  ·  view source on GitHub ↗

@internal

()

Source from the content-addressed store, hash-verified

12309class Il2CppThread extends native_struct_1.NativeStruct {
12310 /** @internal */
12311 static get idOffset() {
12312 const handle = ptr(Il2Cpp.currentThread.internal.field("thread_id").value.toString());
12313 const currentThreadId = Process.getCurrentThreadId();
12314 for (let i = 0; i < 1024; i++) {
12315 const candidate = handle.add(i).readS32();
12316 if (candidate == currentThreadId) {
12317 return i;
12318 }
12319 }
12320 (0, console_1.raise)(`couldn't determine the offset for a native thread id value`);
12321 }
12322 /** Gets the native id of the current thread. */
12323 get id() {
12324 return ptr(this.internal.field("thread_id").value.toString()).add(Il2Cpp.Thread.idOffset).readS32();

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.65
fieldMethod · 0.45

Tested by

no test coverage detected