aboutsummaryrefslogtreecommitdiffstats
path: root/fw/ta_types.py (follow)
Commit message (Collapse)AuthorAge
* fw: restore AMD's own function names and apply prototypes/types across the TAsuser2026-09-29
Names alone left Hex-Rays emitting *(_DWORD *)(a1 + 7680) for the most important expression in this audit, so this adds function prototypes and structure types, and in the process corrects names that had drifted. GCP logs AMD_TA_GCP: <Name> ENTER on entry to most handlers, which is ground truth. fw/ta_name_audit.py checks every derived symbol against it and found 18 mismatches in GCP, plus two false positives in WSPE where the logged words are ordinary prose. Combined with a fresh decode of the dispatcher's two tbb tables, giving command to handler address rather than the stale name-keyed map, this corrects: cmd 3 is ActivateDRMCertAuthSession and was not defined as a function at all; FE03 to FE06 are unimplemented and share the error arm; FE07 is CreateAuthenticatedSession; FE0C and FE0D are Create and DestroyCryptoSession; FE0A is QueryAuthenticatedSession rather than the invented QueryAccessibilityAttributes; FE0E and FE0F likewise. The hardware sweep independently agrees, since FE03 to FE06 all returned an identical 0x102 while FE07 alone returned 0, which had been sitting in the output mislabelled. This also corrects a finding's wording: FE0B manages the stride-80 auth array and FE0D the stride-88 crypto array, so they are two destroy paths over different arrays rather than a same-type sibling pair. The in-database comment is updated, including replacing its now-stale 'not yet shown' caveat with the hardware result. Five structures declared and verified by reading the layout back from IDA and comparing against the addressing the code performs; the three session arrays tile the context exactly, which is the check. 179 prototypes applied across all twelve TAs with no failures. Measured against a pristine database rather than one that already carries the work: raw casts 81 to 7, anonymous parameters 113 to 0. Method notes recorded: do not drive the TUI struct editor, since a focus change types into the filter box and a half-applied redeclare silently truncated three structs; declare interdependent structs in one parse unit; build prototypes from the database rather than the stale dump; a type that misrepresents addressing is worse than none, which is why the lvar retype was reverted; and two metric bugs were caught only by disbelieving a number that flattered or unfairly punished the work. Adds fw/ta_ida.py, fw/ta_name_audit.py, fw/ta_rename_from_logstrings.py, fw/cmdmaps/gcp_ea.json, fw/audits/name_vs_logstring.json and fw/pseudo/ artifacts.