From 9041300583637aaee2cb3617d56a5e14528dc098 Mon Sep 17 00:00:00 2001 From: vfsfitvnm Date: Thu, 25 May 2023 21:46:25 +0200 Subject: [PATCH] Use regex to match interceptor error message As the pointer value is formatted differently on Windows --- src/il2cpp/structs/method.ts | 2 +- src/il2cpp/tracer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/il2cpp/structs/method.ts b/src/il2cpp/structs/method.ts index 41d7556..ee62419 100644 --- a/src/il2cpp/structs/method.ts +++ b/src/il2cpp/structs/method.ts @@ -179,7 +179,7 @@ namespace Il2Cpp { switch (e.message) { case "access violation accessing 0x0": raise(`couldn't set implementation for method ${this.name} as it has a NULL virtual address`); - case `unable to intercept function at ${this.virtualAddress}; please file a bug`: + case /unable to intercept function at \w+; please file a bug/.exec(e.message)?.input: warn(`couldn't set implementation for method ${this.name} as it may be a thunk`); break; case "already replaced this function": diff --git a/src/il2cpp/tracer.ts b/src/il2cpp/tracer.ts index 4f35f51..8952e30 100644 --- a/src/il2cpp/tracer.ts +++ b/src/il2cpp/tracer.ts @@ -226,7 +226,7 @@ namespace Il2Cpp { this.#applier(target, this.#state, this.#threadId); } catch (e: any) { switch (e.message) { - case `unable to intercept function at ${target.virtualAddress}; please file a bug`: + case /unable to intercept function at \w+; please file a bug/.exec(e.message)?.input: case "already replaced this function": break; default: