diff options
| author | Josh Ferrell <josh@vector35.com> | 2026-04-22 17:10:53 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2026-04-22 17:10:53 -0400 |
| commit | 84d66dc7e6244e6ef78ebb3a2aa24b57a6ed4345 (patch) | |
| tree | f312835e717eef396445645498d6bb83fdd0a18b /plugins/pdb-ng | |
| parent | 4bba210293dc020fbd8ef84f9f1b91676a4c7432 (diff) | |
[PDB Import] Only adjust sp-relative locals on x86_64
Diffstat (limited to 'plugins/pdb-ng')
| -rw-r--r-- | plugins/pdb-ng/src/symbol_parser.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/pdb-ng/src/symbol_parser.rs b/plugins/pdb-ng/src/symbol_parser.rs index 5e3cb166..a4ee4a6c 100644 --- a/plugins/pdb-ng/src/symbol_parser.rs +++ b/plugins/pdb-ng/src/symbol_parser.rs @@ -1721,15 +1721,21 @@ impl<'a, S: Source<'a> + 'a> PDBParserInstance<'a, S> { is_param, .. })) => { - // Adjust RSP-relative locations to RSP_entry-relative before param detection + // Adjust RSP-relative locations to RSP_entry-relative before param detection. + // Only for x86_64, because REGREL32 RSP offsets are measured after the prolog >:( + // On x86, offsets are already relative to the entry stack pointer + let frame_adjustment = if self.arch.address_size() == 8 { + data.frame_byte_count as i64 + } else { + 0 + }; let adjusted_storage: Vec<ParsedLocation> = storage .iter() .map(|loc| { if loc.stack_relative { ParsedLocation { location: Variable { - storage: loc.location.storage - - data.frame_byte_count as i64, + storage: loc.location.storage - frame_adjustment, ..loc.location }, stack_relative: false, |
