Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
Support Steam Client Beta 1790904859
NotProtonNotc63a9f10c8a5
diff --git a/.github/workflows/app.yml b/.github/workflows/app.ymlindex 4b78d4d..709e6e6 100644--- a/.github/workflows/app.yml+++ b/.github/workflows/app.yml@@ -94,6 +94,7 @@ jobs:- name: Run the hermetic C suitesrun: |make -s sigcheck+ make -s callscheckmake -s webpatch-fixturesmake -s peicon-fixturesmake -s panel-behaviordiff --git a/Makefile b/Makefileindex 8b58f7f..3f5cbd7 100644--- a/Makefile+++ b/Makefile@@ -56,7 +56,7 @@ OBJS := $(patsubst %.c,$(OUT_DIR)/%.o,$(SRCS))DEPS := $(OBJS:.o=.d).PHONY: all clean rebuild dobby deploy dylib-install sigcheck app-payload app app-zip \- anchorcheck sigdb-fixtures webpatch-fixtures peicon-fixtures panel-behavior app-tests \+ anchorcheck callscheck sigdb-fixtures webpatch-fixtures peicon-fixtures panel-behavior app-tests \tests-list overlay-shim overlay-shim-install overlay-shim-tests \overlay-shim-bench iconmaker icon \appinfo helpers-install ntdll-resolve bridge runcheck compatcheck \@@ -140,6 +140,20 @@ anchorcheck:@if [ ! -f dylib/tests/anchorcheck.c ]; then $(call SKIP,anchorcheck,dylib/tests/anchorcheck.c); exit 0; fi; \$(MAKE) -s $(ANCHORCHECK) && $(ANCHORCHECK)+CALLSCHECK := $(OUT_DIR)/callscheck+CALLSCHECK_SRCS := dylib/tests/callscheck.c $(filter-out dylib/tests/anchorcheck.c,$(ANCHORCHECK_SRCS))++$(CALLSCHECK): $(CALLSCHECK_SRCS)+ @mkdir -p $(dir $@)+ $(CC) -arch $(ARCH) -mmacosx-version-min=$(MIN_VER) -std=c17 -g -O1 \+ -Wall -Wextra -Wno-unused-parameter -Idylib -Ivendor \+ -fsanitize=address,undefined -fno-sanitize-recover=all \+ -o $@ $(CALLSCHECK_SRCS)++callscheck:+ @if [ ! -f dylib/tests/callscheck.c ]; then $(call SKIP,callscheck,dylib/tests/callscheck.c); exit 0; fi; \+ $(MAKE) -s $(CALLSCHECK) && $(CALLSCHECK)+SIGDB_FIXTURES := dylib/tests/sigdb-fixturessigdb-fixtures:diff --git a/dylib/feats/webpatch.c b/dylib/feats/webpatch.cindex 51bf9be..a2d51db 100644--- a/dylib/feats/webpatch.c+++ b/dylib/feats/webpatch.c@@ -272,11 +272,27 @@ static int has_suffix(const char *s, const char *suf) {return ls >= lf && memcmp(s + ls - lf, suf, lf) == 0;}+static const char *inside_steamui(const char *path) {+ const char *at = strstr(path, "/steamui/");+ if (at)+ return at + sizeof("/steamui/") - 1;+ if (strncmp(path, "steamui/", sizeof("steamui/") - 1) == 0)+ return path + sizeof("steamui/") - 1;+ return NULL;+}++// The compatibility UI has shipped in both chunk~*.js and sp.js.+// np_webpatch_transform rejects scripts without matching anchors.int np_webpatch_should_patch(const char *path) {- return path- && strstr(path, "steamui") != NULL- && strstr(path, "/chunk~") != NULL- && has_suffix(path, ".js");+ if (!path || !has_suffix(path, ".js"))+ return 0;++ const char *rest = inside_steamui(path);+ if (!rest)+ return 0;++ return strncmp(rest, "localization/", sizeof("localization/") - 1) != 0+ && strncmp(rest, "libraries/", sizeof("libraries/") - 1) != 0;}char *np_webpatch_transform(const uint8_t *src, size_t src_len, size_t *out_len,diff --git a/dylib/hooks/hook_webpatch.c b/dylib/hooks/hook_webpatch.cindex 692a0a4..d80e5c8 100644--- a/dylib/hooks/hook_webpatch.c+++ b/dylib/hooks/hook_webpatch.c@@ -100,15 +100,24 @@ static int spill_to_temp(const char *bytes, size_t len) {// the patched bytes. -1 falls the caller through to the real file, which happens// when the read fails or the gates are absent/missing. Safety.static int open_patched(const char *path) {+ np_log_attach();+int in = sys_open(path, O_RDONLY, 0);if (in < 0)return -1;size_t raw_len = 0;char *raw = drain_fd(in, &raw_len);- close(in);- if (!raw)+ if (!raw) {+ struct stat st;+ if (fstat(in, &st) == 0 && st.st_size > WEBPATCH_MAX_CHUNK)+ NP_ERR("webpatch: %s holds %lld bytes, past the %d byte ceiling, so the "+ "compat UI stays unpatched", path, (long long)st.st_size,+ WEBPATCH_MAX_CHUNK);+ close(in);return -1;+ }+ close(in);size_t patched_len = 0;const char *shape = NULL;@@ -127,10 +136,14 @@ static int open_patched(const char *path) {int fd = spill_to_temp(patched, patched_len);free(patched);- if (fd < 0)+ if (fd < 0) {+ NP_ERR("webpatch: patched %s but staging the bytes failed, so the client reads "+ "the chunk Valve shipped", path);return -1;+ }- NP_LOG_FIRST("webpatch: served patched compat chunk (%s)", path);+ NP_LOG_FIRST("webpatch: served patched compat chunk (%s) to %s pid %d",+ path, getprogname(), getpid());return fd;}diff --git a/dylib/resolver/anchor.c b/dylib/resolver/anchor.cindex 1d6feb9..24f5cfd 100644--- a/dylib/resolver/anchor.c+++ b/dylib/resolver/anchor.c@@ -64,6 +64,11 @@ static uintptr_t b_target(uintptr_t pc, uint32_t w) {return branch26_target(pc, w, 0x14000000u);}+// BLR, BLRAA, BLRAB, BLRAAZ and BLRABZ+static int is_indirect_call(uint32_t w) {+ return (w & 0xFEFFF000u) == 0xD63F0000u;+}+// Instructions that can legitimately begin a functionstatic const struct { uint32_t mask, val; } entry_forms[] = {{ 0xFF0003FF, 0xD10003FF }, // SUB SP, SP, #imm@@ -316,6 +321,179 @@ static uintptr_t sole_insn_pair(const struct mach_header_64 *mh, intptr_t slide,return found;}+// The ObjC runtime may replace __objc_selrefs pointers with interned selectors.+static const char *objc_stub_selector(uintptr_t stub, uintptr_t selrefs,+ size_t selrefs_sz) {+ if (selrefs_sz < sizeof(uintptr_t)) return NULL;++ int reg = -1;+ uintptr_t page = adrp_target(stub, *(const uint32_t *)stub, ®);+ if (!page) return NULL;++ uintptr_t slot = ldr_slot_addr(*(const uint32_t *)(stub + 4), reg, page);+ if (!slot || slot < selrefs) return NULL;+ if (slot - selrefs > selrefs_sz - sizeof(uintptr_t)) return NULL;+ if ((slot - selrefs) % sizeof(uintptr_t)) return NULL;++ return *(const char *const *)slot;+}++static int find_selrefs(const struct mach_header_64 *mh, intptr_t slide,+ uintptr_t *out_base, size_t *out_size) {+ for (int s = 0; s < N_DATA_SEGS; s++) {+ if (np_find_section(mh, slide, data_segs[s], "__objc_selrefs",+ out_base, out_size) == 0)+ return 0;+ }+ return -1;+}++// __objc_stubs does not record entry stride.+static uintptr_t objc_stub_for_selector(const struct mach_header_64 *mh,+ intptr_t slide, const char *selector) {+ uintptr_t stubs, selrefs;+ size_t stubs_sz, selrefs_sz;++ if (np_find_section(mh, slide, "__TEXT", "__objc_stubs", &stubs, &stubs_sz) != 0)+ return 0;+ if (find_selrefs(mh, slide, &selrefs, &selrefs_sz) != 0) return 0;+ if (stubs_sz < 8) return 0;++ uintptr_t found = 0;+ for (uintptr_t pc = stubs; pc + 8 <= stubs + stubs_sz; pc += 4) {+ const char *sel = objc_stub_selector(pc, selrefs, selrefs_sz);+ if (!sel || strcmp(sel, selector) != 0) continue;+ if (found) return 0;+ found = pc;+ }+ return found;+}++static uintptr_t stub_for_name(const struct mach_header_64 *mh, intptr_t slide,+ const char *name) {+ if (name[0] == NP_SELECTOR_MARK)+ return objc_stub_for_selector(mh, slide, name + 1);+ return np_import_stub_for_symbol(mh, slide, name);+}++typedef struct {+ uintptr_t objc_base;+ size_t objc_size;+ uintptr_t selrefs;+ size_t selrefs_size;+ int have_objc;+} stub_tables_t;++static void load_stub_tables(const struct mach_header_64 *mh, intptr_t slide,+ stub_tables_t *out) {+ memset(out, 0, sizeof(*out));+ if (np_find_section(mh, slide, "__TEXT", "__objc_stubs",+ &out->objc_base, &out->objc_size) != 0)+ return;+ if (find_selrefs(mh, slide, &out->selrefs, &out->selrefs_size) != 0)+ return;+ out->have_objc = 1;+}++static int callee_is_named(const struct mach_header_64 *mh, intptr_t slide,+ const stub_tables_t *tables, uintptr_t callee,+ const char *name) {+ if (name[0] == NP_SELECTOR_MARK) {+ if (!tables->have_objc) return 0;+ if (callee < tables->objc_base) return 0;+ if (callee + 8 > tables->objc_base + tables->objc_size) return 0;++ const char *sel = objc_stub_selector(callee, tables->selrefs,+ tables->selrefs_size);+ return sel && strcmp(sel, name + 1) == 0;+ }++ const char *sym = np_import_stub_symbol(mh, slide, callee);+ return sym && strcmp(sym, name) == 0;+}++static int body_matches_calls(const struct mach_header_64 *mh, intptr_t slide,+ uintptr_t fn, uintptr_t end,+ uintptr_t text, size_t text_sz,+ const stub_tables_t *tables,+ const np_anchor_t *anchor) {+ int wanted = 0;++ for (uintptr_t pc = fn; pc + 4 <= end; pc += 4) {+ uint32_t w = *(const uint32_t *)pc;++ if (anchor->no_data_refs) {+ int reg = -1;+ if (adrp_target(pc, w, ®)) return 0;+ }+ if (anchor->calls_exact && is_indirect_call(w)) return 0;++ uintptr_t callee = bl_target(pc, w);+ if (!callee) continue;+ if (callee < text || callee > text + text_sz - sizeof(uint32_t)) return 0;++ if (wanted < anchor->call_count &&+ callee_is_named(mh, slide, tables, callee, anchor->calls[wanted])) {+ wanted++;+ continue;+ }+ if (anchor->calls_exact) return 0;+ }+ return wanted == anchor->call_count;+}++static uintptr_t sole_fn_by_calls(const struct mach_header_64 *mh, intptr_t slide,+ uintptr_t text, size_t text_sz,+ const np_anchor_t *anchor) {+ if (anchor->call_count < 1) return 0;++ uintptr_t seed = stub_for_name(mh, slide, anchor->calls[0]);+ if (!seed) {+ NP_WARN("anchor: no stub calls '%s'", anchor->calls[0]);+ return 0;+ }++ uintptr_t code;+ size_t code_sz;+ if (np_find_section(mh, slide, "__TEXT", "__text", &code, &code_sz) != 0 ||+ code < text || code - text > text_sz || code_sz > text_sz - (code - text)) {+ NP_WARN("anchor: no usable __text for '%s'", anchor->calls[0]);+ return 0;+ }++ stub_tables_t tables;+ load_stub_tables(mh, slide, &tables);++ uintptr_t code_end = code + (code_sz & ~(size_t)3);+ uintptr_t found = 0, prev_end = 0;++ for (uintptr_t pc = code; pc + 4 <= code_end; pc += 4) {+ if (pc < prev_end) continue;+ if (bl_target(pc, *(const uint32_t *)pc) != seed) continue;++ // A caller without bounds could hide a second match.+ uintptr_t fn, end;+ if (np_function_bounds(mh, slide, pc, &fn, &end) != 0 ||+ fn < code || end > code_end || ((fn | end) & 3)) {+ NP_WARN("anchor: '%s' caller at 0x%lx has no usable function bounds",+ anchor->calls[0], (unsigned long)(pc - (uintptr_t)slide));+ return 0;+ }+ prev_end = end;++ if (!body_matches_calls(mh, slide, fn, end, text, text_sz, &tables, anchor))+ continue;+ if (found) {+ NP_WARN("anchor: '%s' call shape matches 0x%lx and 0x%lx",+ anchor->calls[0], (unsigned long)(found - (uintptr_t)slide),+ (unsigned long)(fn - (uintptr_t)slide));+ return 0;+ }+ found = fn;+ }+ return found;+}+// Public entry pointuintptr_t np_locate_anchor(const struct mach_header_64 *mh, intptr_t slide,uintptr_t text_base, size_t text_size,@@ -338,6 +516,9 @@ uintptr_t np_locate_anchor(const struct mach_header_64 *mh, intptr_t slide,return np_looks_like_prologue(fn) ? fn : 0;}+ if (anchor->kind == NP_MATCH_CALLS)+ return sole_fn_by_calls(mh, slide, text_base, text_size, anchor);+// Both STRING and INSN_AFTER_STRING start with a string xref.uintptr_t str = cstring_va(mh, slide, anchor->str);if (!str) return 0;diff --git a/dylib/resolver/anchor.h b/dylib/resolver/anchor.hindex be2a286..917becc 100644--- a/dylib/resolver/anchor.h+++ b/dylib/resolver/anchor.h@@ -16,10 +16,16 @@ typedef enum {// a string reference identifiesNP_MATCH_AOB,NP_MATCH_CALL_TARGET,+ NP_MATCH_CALLS,} np_match_kind_t;#define NP_CALL_PATH_MAX 4+// Selectors use the NP_SELECTOR_MARK prefix.+#define NP_CALLS_MAX 8+#define NP_CALL_NAME_MAX 96+#define NP_SELECTOR_MARK '@'+typedef struct {uint32_t first, first_mask;uint32_t second, second_mask;@@ -49,6 +55,11 @@ typedef struct {int call_path[NP_CALL_PATH_MAX];int call_depth;++ char calls[NP_CALLS_MAX][NP_CALL_NAME_MAX];+ int call_count;+ int calls_exact; // the body makes these calls and no others+ int no_data_refs; // reject ADRP instructions} np_anchor_t;// Upper bound on a function body when scanning for a pair.diff --git a/dylib/resolver/resolver.c b/dylib/resolver/resolver.cindex 0962643..7a50a0a 100644--- a/dylib/resolver/resolver.c+++ b/dylib/resolver/resolver.c@@ -71,6 +71,7 @@ static int anchor_targets_function_entry(np_match_kind_t kind) {case NP_MATCH_STRING:case NP_MATCH_VTABLE_SLOT:case NP_MATCH_CALL_TARGET:+ case NP_MATCH_CALLS:return 1;case NP_MATCH_NONE:case NP_MATCH_INSN_AFTER_STRING:diff --git a/dylib/resolver/sigdb.c b/dylib/resolver/sigdb.cindex 78abf3a..9a9d7c5 100644--- a/dylib/resolver/sigdb.c+++ b/dylib/resolver/sigdb.c@@ -92,6 +92,33 @@ static int load_call_path(cJSON *obj, np_anchor_t *a) {return 0;}+static int load_calls(cJSON *obj, np_anchor_t *a) {+ cJSON *arr = cJSON_GetObjectItem(obj, "calls");+ if (!arr || !cJSON_IsArray(arr)) return -1;++ int n = cJSON_GetArraySize(arr);+ if (n < 1 || n > NP_CALLS_MAX) return -1;++ for (int i = 0; i < n; i++) {+ cJSON *e = cJSON_GetArrayItem(arr, i);+ if (!e || !cJSON_IsString(e) || !e->valuestring) return -1;++ size_t len = strlen(e->valuestring);+ if (len == 0 || len >= NP_CALL_NAME_MAX) return -1;+ if (len == 1 && e->valuestring[0] == NP_SELECTOR_MARK) return -1;++ snprintf(a->calls[i], NP_CALL_NAME_MAX, "%s", e->valuestring);+ }+ a->call_count = n;++ cJSON *exact = cJSON_GetObjectItem(obj, "exact");+ a->calls_exact = (exact && cJSON_IsTrue(exact)) ? 1 : 0;++ cJSON *bare = cJSON_GetObjectItem(obj, "no_data_refs");+ a->no_data_refs = (bare && cJSON_IsTrue(bare)) ? 1 : 0;+ return 0;+}+static void load_anchor(cJSON *sig_obj, np_anchor_t *a) {cJSON *obj = cJSON_GetObjectItem(sig_obj, "anchor");if (!obj || !cJSON_IsObject(obj)) return;@@ -133,6 +160,14 @@ static void load_anchor(cJSON *sig_obj, np_anchor_t *a) {}a->kind = NP_MATCH_VTABLE_SLOT;return; // refinements below are string-only+ } else if (strcmp(ks, "calls") == 0) {+ if (load_calls(obj, a) != 0) {+ NP_WARN("sigdb: a calls anchor has no usable call list; ignoring it");+ a->kind = NP_MATCH_NONE;+ return;+ }+ a->kind = NP_MATCH_CALLS;+ return;} else if (strcmp(ks, "aob") == 0) {a->kind = NP_MATCH_AOB;return;diff --git a/dylib/tests/anchorcheck.c b/dylib/tests/anchorcheck.cindex e7a44c7..ae73882 100644--- a/dylib/tests/anchorcheck.c+++ b/dylib/tests/anchorcheck.c@@ -108,6 +108,7 @@ static const char *kind_name(np_match_kind_t k) {case NP_MATCH_INSN_PAIR_IN_FN: return "insn_pair";case NP_MATCH_AOB: return "aob";case NP_MATCH_CALL_TARGET: return "call_target";+ case NP_MATCH_CALLS: return "calls";default: return "none";}}@@ -149,6 +150,15 @@ static const struct { uint64_t build; const char *type_name; uintptr_t vptr; } e{1789086785, "40CCompatManager_SpecifyCompatTool_Request", 0x16ad2c0},{1789086785, "41CCompatManager_SpecifyCompatTool_Response", 0x16ad370},{1789086785, "40CCompatManager_StateChanged_Notification", 0x16ad420},++ {1790904859, "14CCompatManager", 0x1743d20},+ {1790904859, "21CMsgCompatManagerTool", 0x16acff0},+ {1790904859, "22CMsgCompatManagerAlias", 0x16ad0a0},+ {1790904859, "37CCompatManager_GetCompatTools_Request", 0x16ad150},+ {1790904859, "38CCompatManager_GetCompatTools_Response", 0x16ad200},+ {1790904859, "40CCompatManager_SpecifyCompatTool_Request", 0x16ad2b0},+ {1790904859, "41CCompatManager_SpecifyCompatTool_Response", 0x16ad360},+ {1790904859, "40CCompatManager_StateChanged_Notification", 0x16ad410},};static int run_rtti(const struct mach_header_64 *mh, intptr_t slide,@@ -263,9 +273,10 @@ static int check_aob_fallback(const char *path) {return 1;}for (int i = 0; i < db.sig_count; i++) {- db.signatures[i].anchor.str[0] = '\001';- db.signatures[i].anchor.str[1] = '\0';- db.signatures[i].anchor.va = 0;+ db.signatures[i].anchor.str[0] = '\001';+ db.signatures[i].anchor.str[1] = '\0';+ db.signatures[i].anchor.va = 0;+ db.signatures[i].anchor.calls[0][0] = '\001';}int bad = 0, checked = 0;@@ -316,7 +327,7 @@ static int pick_live(const dbcheck_t *dbs, int n) {return best_hits ? best : -1;}-static int report_db(const dbcheck_t *db, int is_live) {+static int report_db(const dbcheck_t *db, int is_live, int misses_excused) {int bad = 0;printf("%s build %llu%s\n", db->path, (unsigned long long)db->build,@@ -330,7 +341,7 @@ static int report_db(const dbcheck_t *db, int is_live) {else if (!r->anchor) { verdict = (r->has_pattern && r->aob)? "ANCHOR FAILED (aob resolves)": "ANCHOR FAILED";- if (is_live) bad++; }+ if (!misses_excused) bad++; }else if (!is_live) { verdict = (r->has_pattern && r->aob && r->aob != r->anchor)? "stale pattern hit elsewhere": "resolved"; }@@ -423,7 +434,7 @@ int main(int argc, char **argv) {int live = pick_live(dbs, n);int bad = 0;- for (int i = 0; i < n; i++) bad += report_db(&dbs[i], i == live);+ for (int i = 0; i < n; i++) bad += report_db(&dbs[i], i == live, live >= 0 && i != live);bad += report_cross_db(dbs, n);if (live < 0) {diff --git a/dylib/tests/callscheck.c b/dylib/tests/callscheck.cnew file mode 100644index 0000000..7ece54d--- /dev/null+++ b/dylib/tests/callscheck.c@@ -0,0 +1,203 @@+#include "resolver/anchor.h"+#include <mach-o/loader.h>+#include <mach-o/nlist.h>+#include <stdio.h>+#include <string.h>++static _Alignas(4096) unsigned char image[0x4000];+static int failures, cases;++static void word(size_t off, uint32_t value) {+ memcpy(image + off, &value, sizeof(value));+}++static void call(size_t off, size_t target) {+ word(off, 0x94000000u | (uint32_t)(((target - off) / 4) & 0x03FFFFFFu));+}++static void starts(const char bytes[7]) {+ memcpy(image + 0x2200, bytes, 7);+}++static void reset(void) {+ memset(image, 0, sizeof(image));+ struct mach_header_64 *mh = (void *)image;+ mh->magic = MH_MAGIC_64;+ mh->ncmds = 5;+ struct segment_command_64 *text = (void *)(mh + 1);+ text->cmd = LC_SEGMENT_64;+ text->cmdsize = sizeof(*text) + 2 * sizeof(struct section_64);+ strcpy(text->segname, "__TEXT");+ text->vmsize = text->filesize = 0x2000;+ text->nsects = 2;+ struct section_64 *sections = (void *)(text + 1);+ strcpy(sections[0].segname, "__TEXT");+ strcpy(sections[0].sectname, "__text");+ sections[0].addr = 0x400;+ sections[0].size = 0x1400;+ strcpy(sections[1].segname, "__TEXT");+ strcpy(sections[1].sectname, "__stubs");+ sections[1].addr = 0x1800;+ sections[1].size = 24;+ sections[1].flags = S_SYMBOL_STUBS;+ sections[1].reserved2 = 12;+ struct segment_command_64 *le = (void *)((unsigned char *)text + text->cmdsize);+ le->cmd = LC_SEGMENT_64;+ le->cmdsize = sizeof(*le);+ strcpy(le->segname, "__LINKEDIT");+ le->vmaddr = le->fileoff = 0x2000;+ le->vmsize = le->filesize = 0x1000;+ struct symtab_command *sym = (void *)(le + 1);+ sym->cmd = LC_SYMTAB;+ sym->cmdsize = sizeof(*sym);+ sym->symoff = 0x2100;+ sym->nsyms = 2;+ sym->stroff = 0x2140;+ sym->strsize = 16;+ struct nlist_64 *symbols = (void *)(image + sym->symoff);+ symbols[0].n_un.n_strx = 1;+ symbols[1].n_un.n_strx = 8;+ memcpy(image + sym->stroff, "\0_first\0_second\0", 16);+ struct dysymtab_command *dys = (void *)(sym + 1);+ dys->cmd = LC_DYSYMTAB;+ dys->cmdsize = sizeof(*dys);+ dys->indirectsymoff = 0x2180;+ dys->nindirectsyms = 2;+ word(0x2180, 0);+ word(0x2184, 1);+ struct linkedit_data_command *fs = (void *)(dys + 1);+ fs->cmd = LC_FUNCTION_STARTS;+ fs->cmdsize = sizeof(*fs);+ fs->dataoff = 0x2200;+ fs->datasize = 7;+ starts("\x80\x08\x80\x09\x80\x07");+ mh->sizeofcmds = (uint32_t)((unsigned char *)(fs + 1) - (unsigned char *)(mh + 1));+ for (size_t off = 0x400; off < 0xc40; off += 4) word(off, 0xD503201F);+ word(0x400, 0xD10043FF);+ call(0x420, 0x1800);+ call(0x424, 0x180C);+ word(0x878, 0x910043FF);+ word(0x87C, 0xD65F03C0);+ word(0x880, 0xD10043FF);+ word(0xBF8, 0x910043FF);+ word(0xBFC, 0xD65F03C0);+}++static void second_match_at(size_t fn) {+ call(fn + 4, 0x1800);+ call(fn + 8, 0x180C);+}++static void split_prologue_at_400(void) {+ word(0x400, 0xA9BF7BFD);+ word(0x404, 0x910003FD);+ word(0x408, 0xD10083FF);+ word(0x874, 0x910083FF);+ word(0x878, 0xA8C17BFD);+}++static void check(const char *label, int exact, uintptr_t expected) {+ np_anchor_t anchor = {.kind = NP_MATCH_CALLS, .call_count = 2,+ .calls_exact = exact, .no_data_refs = 1};+ strcpy(anchor.calls[0], "_first");+ strcpy(anchor.calls[1], "_second");+ uintptr_t base = (uintptr_t)image;+ uintptr_t got = np_locate_anchor((void *)image, (intptr_t)base, base, 0x2000, &anchor);+ if (got) got -= base;+ cases++;+ if (got == expected) return;+ failures++;+ printf("FAIL %s: expected 0x%lx, got 0x%lx\n", label,+ (unsigned long)expected, (unsigned long)got);+}++int main(void) {+ reset();+ check("exact match spanning more than 0x400 bytes", 1, 0x400);++ reset();+ word(0x804, 0x90000003);+ check("ADRP past 0x400 bytes", 1, 0);++ reset();+ call(0x804, 0x1800);+ check("extra BL past 0x400 bytes", 1, 0);++ reset();+ word(0x420, 0xD503201F);+ word(0x424, 0xD503201F);+ call(0x820, 0x1800);+ call(0x824, 0x180C);+ check("required calls past 0x400 bytes", 1, 0x400);++ reset();+ word(0x830, 0xD65F03C0);+ word(0x834, 0x90000003);+ check("ADRP after RET inside the span", 1, 0);++ reset();+ word(0x884, 0x90000003);+ check("ADRP in the next function", 1, 0x400);++ static const uint32_t indirect[] = {+ 0xD63F0100, 0xD73F0909, 0xD73F0D09, 0xD63F091F, 0xD63F0D1F,+ };+ char label[64];+ for (size_t i = 0; i < sizeof(indirect) / sizeof(indirect[0]); i++) {+ reset();+ word(0x430, indirect[i]);+ snprintf(label, sizeof(label), "indirect call %08X in exact mode", indirect[i]);+ check(label, 1, 0);+ snprintf(label, sizeof(label), "indirect call %08X in subsequence mode", indirect[i]);+ check(label, 0, 0x400);+ }++ static const uint32_t not_calls[] = {+ 0xD61F0100, 0xD71F0909, 0xD71F0D09, 0xD61F091F, 0xD61F0D1F,+ 0xD65F0BFF, 0xD65F0FFF,+ };+ for (size_t i = 0; i < sizeof(not_calls) / sizeof(not_calls[0]); i++) {+ reset();+ word(0x430, not_calls[i]);+ snprintf(label, sizeof(label), "branch or return %08X in exact mode", not_calls[i]);+ check(label, 1, 0x400);+ }++ reset();+ call(0x430, 0x1800);+ check("repeated seed call in subsequence mode", 0, 0x400);++ reset();+ second_match_at(0x880);+ check("large match then small match", 1, 0);++ reset();+ starts("\x80\x08\x80\x01\x80\x0f");+ word(0x478, 0x910043FF);+ word(0x47C, 0xD65F03C0);+ check("small match alone", 1, 0x400);+ word(0x480, 0xD10043FF);+ second_match_at(0x480);+ check("small match then large match", 1, 0);++ reset();+ split_prologue_at_400();+ check("split prologue alone", 1, 0x400);+ second_match_at(0x880);+ check("split prologue then another match", 1, 0);++ reset();+ call(0xC10, 0x1800);+ check("caller in the unbounded last function", 1, 0);++ reset();+ starts("\x80\x08\x82\x09\x80\x07");+ check("misaligned function bounds", 1, 0);++ if (failures) {+ printf("%d of %d call-shape cases failed\n", failures, cases);+ return 1;+ }+ printf("==> %d call-shape cases resolve as expected\n", cases);+ return 0;+}diff --git a/dylib/tests/gatecheck.c b/dylib/tests/gatecheck.cindex 1a85e9b..ac31c9b 100644--- a/dylib/tests/gatecheck.c+++ b/dylib/tests/gatecheck.c@@ -49,6 +49,34 @@ static void check_gate(const char *nm, size_t i, const np_gate_t *a,}}+static void check_paths(void) {+ static const struct { const char *path; int want; } cases[] = {+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/sp.js", 1 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/chunk~2dcc5aaf7.js", 1 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/1129.js", 1 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/library.js", 1 },+ { "steamui/sp.js", 1 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/app/sp.js", 1 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/localization/en-json.js", 0 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/libraries/lib~00299.js", 0 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/sp.js.orig", 0 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui/css/library.css", 0 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/notsteamui/sp.js", 0 },+ { "/Steam.AppBundle/Steam/Contents/MacOS/steamui", 0 },+ { "sp.js", 0 },+ };+ size_t n = sizeof(cases) / sizeof(cases[0]);+ for (size_t i = 0; i < n; i++) {+ int got = np_webpatch_should_patch(cases[i].path);+ if (!got != !cases[i].want)+ wrong("should_patch(%s) answered %d, wanted %d",+ cases[i].path, got, cases[i].want);+ }+ if (np_webpatch_should_patch(NULL))+ wrong("should_patch(NULL) answered yes");+ printf("%zu chunk paths checked\n", n + 1);+}+static void selfcheck(void) {size_t total = 0;for (size_t sh = 0; sh < NP_SHAPE_COUNT; sh++) {@@ -77,6 +105,7 @@ static void selfcheck(void) {printf("%zu shapes, %zu gates, %zu fixes checked\n",NP_SHAPE_COUNT, total, NP_FIX_COUNT);+ check_paths();}static uint8_t *slurp(const char *path, size_t *len) {diff --git a/dylib/tests/sigdb-fixtures/EXPECTED b/dylib/tests/sigdb-fixtures/EXPECTEDindex dfecdf3..5ebc2ad 100644--- a/dylib/tests/sigdb-fixtures/EXPECTED+++ b/dylib/tests/sigdb-fixtures/EXPECTED@@ -9,6 +9,18 @@1 all_deprecated.json0 array_root.json+1 calls_bare_mark.json+1 calls_empty.json+1 calls_long_name.json+1 calls_missing.json+1 calls_no_such_import.json+1 calls_no_such_selector.json+1 calls_not_strings.json+0 calls_real_import.json+0 calls_real_selector.json+1 calls_scalar.json+1 calls_too_common.json+1 calls_too_many.json1 deep_nest.json2 empty_file.json0 empty_sigs.jsondiff --git a/dylib/tests/sigdb-fixtures/calls_bare_mark.json b/dylib/tests/sigdb-fixtures/calls_bare_mark.jsonnew file mode 100644index 0000000..7363695--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_bare_mark.json@@ -0,0 +1,21 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": [+ "@"+ ]+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_empty.json b/dylib/tests/sigdb-fixtures/calls_empty.jsonnew file mode 100644index 0000000..d502f18--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_empty.json@@ -0,0 +1,19 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": []+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_long_name.json b/dylib/tests/sigdb-fixtures/calls_long_name.jsonnew file mode 100644index 0000000..636c3c4--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_long_name.json@@ -0,0 +1,21 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": [+ "_nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"+ ]+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_missing.json b/dylib/tests/sigdb-fixtures/calls_missing.jsonnew file mode 100644index 0000000..878381a--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_missing.json@@ -0,0 +1,18 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls"+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_no_such_import.json b/dylib/tests/sigdb-fixtures/calls_no_such_import.jsonnew file mode 100644index 0000000..6353908--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_no_such_import.json@@ -0,0 +1,21 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": [+ "_NotProtonNoSuchImport"+ ]+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_no_such_selector.json b/dylib/tests/sigdb-fixtures/calls_no_such_selector.jsonnew file mode 100644index 0000000..8b6e9f6--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_no_such_selector.json@@ -0,0 +1,21 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": [+ "@notProtonNoSuchSelector:"+ ]+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_not_strings.json b/dylib/tests/sigdb-fixtures/calls_not_strings.jsonnew file mode 100644index 0000000..94c9692--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_not_strings.json@@ -0,0 +1,22 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": [+ 123,+ true+ ]+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_real_import.json b/dylib/tests/sigdb-fixtures/calls_real_import.jsonnew file mode 100644index 0000000..650653e--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_real_import.json@@ -0,0 +1,24 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "F4 4F BE A9 FD 7B 01 A9 FD 43 00 91 F3 03 01 AA 00 00 40 F9 ?? ?? ?? ?? C0 00 00 B4 61 02 40 F9 02 00 B0 12 ?? ?? ?? ?? 1F 00 00 71 E0 17 9F 1A FD 7B 41 A9 F4 4F C2 A8 C0 03 5F D6",+ "anchor": {+ "kind": "calls",+ "calls": [+ "_V_GetFileExtension",+ "_V_strnicmp"+ ],+ "exact": true,+ "no_data_refs": true+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_real_selector.json b/dylib/tests/sigdb-fixtures/calls_real_selector.jsonnew file mode 100644index 0000000..8e543e0--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_real_selector.json@@ -0,0 +1,22 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutIconRender",+ "module": "steamui.dylib",+ "aob_hex": "FF C3 01 D1 E9 23 02 6D F8 5F 03 A9 F6 57 04 A9 F4 4F 05 A9 FD 7B 06 A9 FD 83 01 91 F4 03 01 AA F5 03 00 AA ?? ?? ?? ??",+ "anchor": {+ "kind": "calls",+ "calls": [+ "@sharedWorkspace",+ "@iconForFile:"+ ]+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_scalar.json b/dylib/tests/sigdb-fixtures/calls_scalar.jsonnew file mode 100644index 0000000..d685766--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_scalar.json@@ -0,0 +1,19 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": "_V_strnicmp"+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_too_common.json b/dylib/tests/sigdb-fixtures/calls_too_common.jsonnew file mode 100644index 0000000..09e13b2--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_too_common.json@@ -0,0 +1,21 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": [+ "_objc_retain"+ ]+ }+ }+ ]+}diff --git a/dylib/tests/sigdb-fixtures/calls_too_many.json b/dylib/tests/sigdb-fixtures/calls_too_many.jsonnew file mode 100644index 0000000..f182ddb--- /dev/null+++ b/dylib/tests/sigdb-fixtures/calls_too_many.json@@ -0,0 +1,29 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 0,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE",+ "anchor": {+ "kind": "calls",+ "calls": [+ "_a",+ "_b",+ "_c",+ "_d",+ "_e",+ "_f",+ "_g",+ "_h",+ "_i"+ ]+ }+ }+ ]+}diff --git a/dylib/util/log.c b/dylib/util/log.cindex ed327ae..0e49197 100644--- a/dylib/util/log.c+++ b/dylib/util/log.c@@ -3,6 +3,7 @@#include "file.h"#include <stdlib.h>#include <stdint.h>+#include <pthread.h>#include <sys/stat.h>int np_log_level = NP_LVL_INFO;@@ -54,7 +55,7 @@ int np_log_first_hit(const void *anchor, unsigned long tag) {return 0;}-void np_log_init(void) {+static void log_open(int may_rotate) {const char *want = getenv("NOTPROTON_LOG_LEVEL");if (want && want[0]) {int parsed = atoi(want);@@ -76,8 +77,23 @@ void np_log_init(void) {snprintf(logpath, sizeof(logpath), "%s/notproton.log", folder);struct stat info;- int oversize = (stat(logpath, &info) == 0 && info.st_size > NP_LOG_MAX_BYTES);+ int oversize = (may_rotate && stat(logpath, &info) == 0+ && info.st_size > NP_LOG_MAX_BYTES);np_log_file = fopen(logpath, oversize ? "w" : "a");if (np_log_file)setlinebuf(np_log_file);}++void np_log_init(void) {+ log_open(1);+}++static pthread_once_t np_attach_once = PTHREAD_ONCE_INIT;++static void log_attach_once(void) {+ log_open(0);+}++void np_log_attach(void) {+ pthread_once(&np_attach_once, log_attach_once);+}diff --git a/dylib/util/log.h b/dylib/util/log.hindex ad2c57e..9c45585 100644--- a/dylib/util/log.h+++ b/dylib/util/log.h@@ -8,6 +8,7 @@extern int np_log_level;extern FILE *np_log_file;void np_log_init(void);+void np_log_attach(void);enum {NP_LVL_ERR = 0,diff --git a/signatures/macos.arm64/1788400362.json b/signatures/macos.arm64/1788400362.jsonindex 6c1321f..3107d46 100644--- a/signatures/macos.arm64/1788400362.json+++ b/signatures/macos.arm64/1788400362.json@@ -174,12 +174,13 @@"aob_hex": "F4 4F BE A9 FD 7B 01 A9 FD 43 00 91 F3 03 01 AA 00 00 40 F9 ?? ?? ?? ?? C0 00 00 B4 61 02 40 F9 02 00 B0 12 ?? ?? ?? ?? 1F 00 00 71 E0 17 9F 1A FD 7B 41 A9 F4 4F C2 A8 C0 03 5F D6","func_addr_this_build": "0x9ee44","anchor": {- "kind": "call_target",- "value": "CSteamApp::GetShortcut() only valid for shortcuts",- "call_path": [- 5,- 4- ]+ "kind": "calls",+ "calls": [+ "_V_GetFileExtension",+ "_V_strnicmp"+ ],+ "exact": true,+ "no_data_refs": true}},{@@ -188,13 +189,11 @@"aob_hex": "FF C3 01 D1 E9 23 02 6D F8 5F 03 A9 F6 57 04 A9 F4 4F 05 A9 FD 7B 06 A9 FD 83 01 91 F4 03 01 AA F5 03 00 AA ?? ?? ?? ??","func_addr_this_build": "0x9ef90","anchor": {- "kind": "call_target",- "value": "strIconDataBase64",- "nth_xref": 2,- "call_path": [- 11,- 3,- 2+ "kind": "calls",+ "calls": [+ "@sharedWorkspace",+ "@iconForFile:",+ "@drawInRect:fromRect:operation:fraction:"]}}diff --git a/signatures/macos.arm64/1789086785.json b/signatures/macos.arm64/1789086785.jsonindex b1ba94a..f689e7d 100644--- a/signatures/macos.arm64/1789086785.json+++ b/signatures/macos.arm64/1789086785.json@@ -170,12 +170,13 @@"module": "steamui.dylib","aob_hex": "F4 4F BE A9 FD 7B 01 A9 FD 43 00 91 F3 03 01 AA 00 00 40 F9 ?? ?? ?? ?? C0 00 00 B4 61 02 40 F9 02 00 B0 12 ?? ?? ?? ?? 1F 00 00 71 E0 17 9F 1A FD 7B 41 A9 F4 4F C2 A8 C0 03 5F D6","anchor": {- "kind": "call_target",- "value": "CSteamApp::GetShortcut() only valid for shortcuts",- "call_path": [- 5,- 4- ]+ "kind": "calls",+ "calls": [+ "_V_GetFileExtension",+ "_V_strnicmp"+ ],+ "exact": true,+ "no_data_refs": true}},{@@ -183,13 +184,11 @@"module": "steamui.dylib","aob_hex": "FF C3 01 D1 E9 23 02 6D F8 5F 03 A9 F6 57 04 A9 F4 4F 05 A9 FD 7B 06 A9 FD 83 01 91 F4 03 01 AA F5 03 00 AA ?? ?? ?? ??","anchor": {- "kind": "call_target",- "value": "strIconDataBase64",- "nth_xref": 2,- "call_path": [- 11,- 3,- 2+ "kind": "calls",+ "calls": [+ "@sharedWorkspace",+ "@iconForFile:",+ "@drawInRect:fromRect:operation:fraction:"]}}diff --git a/signatures/macos.arm64/1790904859.json b/signatures/macos.arm64/1790904859.jsonnew file mode 100644index 0000000..5433605--- /dev/null+++ b/signatures/macos.arm64/1790904859.json@@ -0,0 +1,197 @@+{+ "schema_version": 3,+ "profile_version": 1,+ "arch": "arm64",+ "platform": "macos",+ "steam_build": 1790904859,+ "steam_build_date": "",+ "signatures": [+ {+ "name": "CCompatManager::Init",+ "aob_hex": "FF C3 04 D1 FC 6F 0D A9 FA 67 0E A9 F8 5F 0F A9 F6 57 10 A9 F4 4F 11 A9 FD 7B 12 A9 FD 83 04 91 F6 03 01 AA",+ "anchor": {+ "kind": "string",+ "value": "STEAM_COMPAT_TOOL_MAPPINGS"+ },+ "func_addr_this_build": "0x6a0e50"+ },+ {+ "name": "CCompatManager::BIsCompatibilityToolEnabled",+ "aob_hex": "FF 03 01 D1 F4 4F 02 A9 FD 7B 03 A9 FD C3 00 91 F4 03 01 AA F3 03 00 AA E1 17 00 B9 ?? ?? ?? ??",+ "anchor": {+ "kind": "string",+ "value": "CCompatManager::BIsCompatibilityToolEnabled"+ },+ "func_addr_this_build": "0x6a56e0"+ },+ {+ "name": "CCompatManager::YldRegisterTool",+ "aob_hex": "FF 43 02 D1 FC 6F 03 A9 FA 67 04 A9 F8 5F 05 A9 F6 57 06 A9 F4 4F 07 A9 FD 7B 08 A9 FD 03 02 91 F4 03 01 AA F3 03 00 AA ?? ?? ?? ?? 08 15 40 F9",+ "anchor": {+ "kind": "string",+ "value": "CCompatManager::YldRegisterTool"+ },+ "func_addr_this_build": "0x6a97c4"+ },+ {+ "name": "CCompatManager::GetOSListOverrideForApp.oslist_gate",+ "aob_hex": "?? ?? ?? ?? ?? ?? ?? ?? 09 30 97 52 E9 05 A0 72 CA 22 40 B9 ?? ?? ?? ?? 08 61 14 91 5F 01 09 6B",+ "anchor": {+ "kind": "insn_pair_in_fn",+ "value": "pTool != nullptr",+ "nth_xref": 1,+ "pair": {+ "first": "0x94000000",+ "first_mask": "0xFC000000",+ "second": "0xB4000000",+ "second_mask": "0xFF00001F",+ "tie_mask": "0x0",+ "land": "second"+ }+ },+ "func_addr_this_build": "0x6a52fc"+ },+ {+ "name": "CCompatManager::ResolveCompatToolForApp.local_redirect",+ "aob_hex": "01 68 40 B9 ?? ?? ?? ?? ?? ?? ?? ?? 08 81 0D 91 08 01 40 F9 09 CC 82 52 00 01 09 8B 02 00 80 52",+ "anchor": {+ "kind": "insn_pair_in_fn",+ "value": "GetAppInstallDir failed for tool %u \"%s\"",+ "pair": {+ "first": "0xB9400000",+ "first_mask": "0xFFC003E0",+ "second": "0x34000000",+ "second_mask": "0xFF000000",+ "tie_mask": "0x1F",+ "land": "first"+ }+ },+ "func_addr_this_build": "0x6a53ec"+ },+ {+ "name": "CAppManager::TerminateProcessByPid",+ "aob_hex": "F4 4F BE A9 FD 7B 01 A9 FD 43 00 91 F3 03 00 AA ?? ?? ?? ?? F4 03 00 AA ?? ?? ?? ?? 00 0D 46 F9 E2 03 13 AA ?? ?? ?? ?? ?? ?? ?? ?? F3 03 00 AA",+ "anchor": {+ "kind": "string",+ "value": "terminate",+ "indirect": true,+ "caller_hops": 1+ },+ "func_addr_this_build": "0xdd3fc"+ },+ {+ "name": "CCompatManager::FindToolForTargetApp",+ "aob_hex": "FF 43 01 D1 F6 57 02 A9 F4 4F 03 A9 FD 7B 04 A9 FD 03 01 91 E1 1F 00 B9 08 40 60 39 1F 05 00 71",+ "anchor": {+ "kind": "string",+ "value": "FindToolForTargetApp matched with itself - ignoring: %u %s"+ },+ "func_addr_this_build": "0x6a4de4"+ },+ {+ "name": "CCompatManager::GetValidPlatforms",+ "aob_hex": "FF 03 01 D1 F6 57 01 A9 F4 4F 02 A9 FD 7B 03 A9 FD C3 00 91 F4 03 01 AA F6 03 00 AA ?? ?? ?? ??",+ "anchor": {+ "kind": "string",+ "value": "AppID %u does not advertise linux as a supported platform, but a linux specific depot is present.\n"+ },+ "func_addr_this_build": "0x6a3850"+ },+ {+ "name": "CWebUIJobDispatcher::RegisterHandler",+ "aob_hex": "FF C3 00 D1 F4 4F 01 A9 FD 7B 02 A9 FD 83 00 91 F4 03 01 AA F3 03 00 AA 28 00 40 F9 08 01 40 F9",+ "anchor": {+ "kind": "string",+ "value": "WebUI method '%s' has already been registered. Skipping duplicate registration"+ },+ "func_addr_this_build": "0x93e60"+ },+ {+ "name": "CWebUITransport::DispatchJob",+ "aob_hex": "FF 43 07 D1 FC 6F 19 A9 F6 57 1A A9 F4 4F 1B A9 FD 7B 1C A9 FD 03 07 91 F4 03 01 AA F3 03 00 AA",+ "anchor": {+ "kind": "string",+ "value": "no handler for message: %s"+ },+ "func_addr_this_build": "0x94064"+ },+ {+ "name": "CWebUIMsgJob::SendResponse",+ "aob_hex": "FF C3 00 D1 F4 4F 01 A9 FD 7B 02 A9 FD 83 00 91 F3 03 01 AA F4 03 00 AA 20 0C 40 F9 ?? ?? ?? ??",+ "anchor": {+ "kind": "string",+ "value": "CWebUIMsgJob: failed to send response for job: %s",+ "nth_xref": 1+ },+ "func_addr_this_build": "0x9453c"+ },+ {+ "name": "CCompatManager::SetCompatToolMapping",+ "aob_hex": "F8 5F BC A9 F6 57 01 A9 F4 4F 02 A9 FD 7B 03 A9 FD C3 00 91 F3 03 04 AA F4 03 03 AA F5 03 02 AA F7 03 00 AA",+ "anchor": {+ "kind": "string",+ "value": "Software\\Valve\\Steam\\CompatToolMapping",+ "nth_xref": 1,+ "caller_hops": 1,+ "caller_tail": true+ },+ "func_addr_this_build": "0x6a4b34"+ },+ {+ "name": "CCompatManager::InternalSpecifyCompatTool",+ "aob_hex": "FF 43 02 D1 FA 67 04 A9 F8 5F 05 A9 F6 57 06 A9 F4 4F 07 A9 FD 7B 08 A9 FD 03 02 91 F5 03 04 AA F6 03 03 AA",+ "anchor": {+ "kind": "string",+ "value": "CCompatManager::InternalSpecifyCompatTool"+ },+ "func_addr_this_build": "0x6a3cb4"+ },+ {+ "name": "CCompatManager::FindMapping",+ "aob_hex": "FF 83 00 D1 FD 7B 01 A9 FD 43 00 91 A1 C3 1F B8 ?? ?? ?? ?? 00 E0 0F 91 A1 13 00 D1 ?? ?? ?? ??",+ "anchor": {+ "kind": "string",+ "value": "FindMapping: Invalid unAppID == k_nAppIdAll, use GetWildcardMapping()."+ },+ "func_addr_this_build": "0x6a4fc4"+ },+ {+ "name": "CCompatManager::GetWildcardMapping",+ "aob_hex": "FF 43 01 D1 F6 57 02 A9 F4 4F 03 A9 FD 7B 04 A9 FD 03 01 91 E1 1F 00 B9 ?? ?? ?? ?? F5 03 01 AA",+ "anchor": {+ "kind": "string",+ "value": "GetWildcardMapping: Invalid unAppID k_nAppIdAll"+ },+ "func_addr_this_build": "0x6a503c"+ },+ {+ "name": "steamui::ShortcutExtensionMatches",+ "module": "steamui.dylib",+ "aob_hex": "F4 4F BE A9 FD 7B 01 A9 FD 43 00 91 F3 03 01 AA 00 00 40 F9 ?? ?? ?? ?? ?? ?? ?? ?? 61 02 40 F9",+ "anchor": {+ "kind": "calls",+ "calls": [+ "_V_GetFileExtension",+ "_V_strnicmp"+ ],+ "exact": true,+ "no_data_refs": true+ },+ "func_addr_this_build": "0xa5478"+ },+ {+ "name": "steamui::ShortcutIconRender",+ "module": "steamui.dylib",+ "aob_hex": "FF C3 01 D1 E9 23 02 6D F8 5F 03 A9 F6 57 04 A9 F4 4F 05 A9 FD 7B 06 A9 FD 83 01 91 F4 03 01 AA",+ "anchor": {+ "kind": "calls",+ "calls": [+ "@sharedWorkspace",+ "@iconForFile:",+ "@drawInRect:fromRect:operation:fraction:"+ ]+ },+ "func_addr_this_build": "0xa55fc"+ }+ ]+}