ghidra
ghidra copied to clipboard
Struct members shown in disassembly but not in decompiler
Describe the bug
Struct members assigned to a local variable are correctly shown in the disassembly but they are not show in the decompilation, and they look odd, as show in the attached screenshot.
To Reproduce
- Open DXCaptureReplay.dll from Windows 10, load the PDB, analyse it, etc...
- Go to
CheckForWindowClosureImpl. - Change
lpMessagelocal variable type toMSG. - Assignments to strut members won't be shown properly in the decompiler while they will properly appear in the disassembly.
Expected behavior Seeing the same member names in the disassembly and the decompiler.
Screenshots
Environment (please complete the following information):
- OS: Ubuntu Linux 22.04.3 LT
- Java Version: 17.0.9
- Ghidra Version: 11.0
- Ghidra Origin: Github
PS: The "best" outcome here, however, would be to just collapse the 3 ZEXT816() calls into a single memset(lpMessage, '\0', sizeof(MSG)) instruction.
The disassembly markup does not consider the access size which does not align with actual component sizes. It simply identifies the location where the write occurs.
The decompiler will not show as structure member access since the accesses do not match-up properly with components. The writes are compiler generated for simplified/rapid clearing of structure data.