Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non compliance of user choice for union's type (using Force Field facility) #6465

Open
Wall-AF opened this issue Apr 28, 2024 · 3 comments
Open
Assignees
Labels
Feature: Decompiler Status: Triage Information is being gathered

Comments

@Wall-AF
Copy link

Wall-AF commented Apr 28, 2024

Describe the bug
When using a structure containing a 'type description value' followed by a union of possible structures (representing those types) using the Force Field option to correct Ghidra's choice is sometimes ignored.

To Reproduce
Steps to reproduce the behavior:

  1. Load in the enclosed function (from the Decompile:Panels Debug Function Decompilation menu)
  2. Goto case 41a: and try to coerce the datatype used in the line pszName = (pDataToCopy->u).d402.szName + 8; to be (pDataToCopy->u).d41a (line 318)
  3. See no change

Expected behavior
If the user wishes to correct the datatype, Ghidra should accept and use it.

Screenshots
N/A

Attachments
dgndmn32_ProcessRPCRequest.zip

Environment (please complete the following information):

  • OS: Windows 11
  • Java Version: 17.0.3.1
  • Ghidra Version: 11.1-DEV
  • Ghidra Origin: locally

Additional context
N/A

@Wall-AF
Copy link
Author

Wall-AF commented Apr 28, 2024

For reference, replacing the union with the actual datatype results in
pszName = (pDataToCopy->u).szParamName;

@Wall-AF
Copy link
Author

Wall-AF commented Apr 28, 2024

Also, if I change the member of the datatype of d402 to a char array of size 8 or less, that automatically fixes the issue!

@Wall-AF
Copy link
Author

Wall-AF commented Apr 28, 2024

Also, in case 0x402, the actual use of the union type is missing from nLen = _strlen((char *)&pDataToCopy->u); and memcpy(g_szBringUpGroupName,&pDataToCopy->u,nLen + 1); and cannot be forced as the option isn't available!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Decompiler Status: Triage Information is being gathered
Projects
None yet
Development

No branches or pull requests

3 participants