Skip to content

Commit

Permalink
Use regex to match interceptor error message
Browse files Browse the repository at this point in the history
As the pointer value is formatted differently on Windows
  • Loading branch information
vfsfitvnm committed May 25, 2023
1 parent 8eadc43 commit 9041300
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/il2cpp/structs/method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion src/il2cpp/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9041300

Please sign in to comment.