Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(native): keep truncated empty class-import scans partial (#6153)

Vinícius Andradeab2119e9b89e
diff --git a/src/native/AppleObjcClassImportBindings.test.ts b/src/native/AppleObjcClassImportBindings.test.ts
index f63330a4a..bf7244f71 100644
--- a/src/native/AppleObjcClassImportBindings.test.ts
+++ b/src/native/AppleObjcClassImportBindings.test.ts
@@ -201,4 +201,25 @@ describe("Objective-C import binding address inspection", () => {
},
});
});
+
+ it("keeps an explicitly truncated empty candidate scan partial", () => {
+ expect(
+ inspectObjcClassImportBindings(
+ createInput({ addresses: [], addressesComplete: false }),
+ ),
+ ).toMatchObject({
+ bindings: [],
+ coverage: {
+ status: "partial",
+ examined: 0,
+ decoded: 0,
+ reason: expect.stringContaining("max_records limit"),
+ },
+ });
+ expect(
+ inspectObjcClassImportBindings(
+ createInput({ addresses: [], addressesComplete: true }),
+ ).coverage,
+ ).toMatchObject({ status: "not_requested", reason: null, examined: 0 });
+ });
});
diff --git a/src/native/AppleObjcClassImportBindings.ts b/src/native/AppleObjcClassImportBindings.ts
index e55eea725..fd00698de 100644
--- a/src/native/AppleObjcClassImportBindings.ts
+++ b/src/native/AppleObjcClassImportBindings.ts
@@ -23,7 +23,9 @@ export const inspectObjcClassImportBindings = (input: {
}): ObjcClassImportBindingScan => {
const { bytes, layout, fixups, addresses, addressesComplete, maxRecords } =
input;
- if (addresses === undefined || addresses.length === 0)
+ // An explicitly truncated candidate scan keeps its limitation even when no
+ // candidate was retained.
+ if (addresses === undefined || (addresses.length === 0 && addressesComplete))
return {
bindings: [],
coverage: {