fix(ghidra): classify modern Swift manglings in swift type analysis (#1208)

* fix(ghidra): classify modern Swift manglings in swift type analysis

Categorize modern Swift 4.2+ manglings ($s, _$s) instead of dropping them
in analyze_swift_types. The classifier only accepted the legacy _Tt marker,
so procedure names reported by current providers produced an empty inventory.
Legacy _Tt families and behavior are unchanged. Fixes #1187.

* fix(swift): retain provider aliases and category unknowns

---------

Co-authored-by: Saim Shafique <sx4imm@gmail.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
Saim Shafique
2026-10-09 16:10:55 +08:00
committed by GitHub
co-authored by Saim Shafique morluto
parent 04a516b1e3
commit 6935dc7fe1
13 changed files with 968 additions and 31 deletions
+4 -2
View File
@@ -30,12 +30,14 @@ export const enhancedInputSchemas = {
category: z
.enum(["classes", "structs", "enums", "protocols", "extensions", "other"])
.optional()
.describe("Limit results to one Swift symbol category."),
.describe(
"Limit categorized results to one Swift category; unresolved category observations remain in unclassified.",
),
pattern: z
.string()
.optional()
.describe(
"Case-sensitive literal filter applied to mangled symbol names.",
"Case-sensitive literal filter applied to provider procedure names and their supporting Swift manglings.",
),
}),
find_xrefs_to_name: z.strictObject({ name: z.string() }),
+1 -1
View File
@@ -54,7 +54,7 @@ export const ENHANCED_TOOL_CONTRACTS = [
),
enhanced(
"analyze_swift_types",
'Categorize analyzed procedure names into Swift classes, structs, enums, protocols, extensions, and other symbols. Returns deduplicated names grouped with counts. Optionally select one category and/or apply a case-sensitive literal name filter; for example, use {category: "classes", pattern: "Account"} to find matching class symbols.',
'Categorize analyzed Swift procedure names using their manglings or same-address Swift symbol aliases. Decodes legacy and literal modern nominal contexts into classes, structs, enums, protocols, and extensions. Preserves provider names and supporting mangled_names; unresolved categories appear in other and in unclassified, which remains inline even under category filters. Returns deduplicated procedure-name counts, not unique source types, plus identification limitations. Optionally select one category and/or apply a case-sensitive literal filter to provider names or supporting manglings; for example, use {category: "structs", pattern: "Pair"}.',
enhancedInputSchemas.analyze_swift_types,
),
enhanced(
+13 -1
View File
@@ -283,9 +283,21 @@ export const enhancedOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
z.string(),
z.object({
count: z.number().int().min(0),
items: z.array(addressedEntry),
items: z.array(
addressedEntry.extend({
mangled_names: z.array(z.string()),
}),
),
}),
),
unclassified: z.array(
addressedEntry.extend({
mangled_names: z.array(z.string()),
reason: z.enum(["category_not_decoded", "conflicting_categories"]),
}),
),
limitations: z.array(z.string()),
symbol_inventory_error: analysisErrorProjectionSchema.exactOptional(),
}),
),
find_xrefs_to_name: resultOf(