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

Missing and incorrrect variable assignments resulting from function calls #6488

Open
Wall-AF opened this issue May 8, 2024 · 0 comments
Open
Assignees
Labels
Feature: Decompiler Status: Triage Information is being gathered

Comments

@Wall-AF
Copy link

Wall-AF commented May 8, 2024

Describe the bug
Returned values not being assigned to their appropriate variable(s) and additional spurious assignments appearing in the decompiled code that don't appear in the assembly. (This occurs throughout this function.)

Also of possible significance is that when highlighting the resulting C code (from within the Decompile:Panel), only 6 out of the 15 assembly statements are highlighted as belonging to the source of the decompiled resulting C, whereas highlighting the assembly (from within the Listing:Panel) the whole case statement apart from the break; statement is highlighted!

To Reproduce
Steps to reproduce the behavior:

  1. Unzip the attachment
  2. Load the .gzf file into Ghidra
  3. Goto function void PerformRequestedOperation(void) (address 10003df6 for the case in the image below)
  4. Examine the assembly vs the C
  5. See error

Expected behavior
All assignments correctly identified and displayed as correct C. For the case highlighted, the C output should be:

   case OP_GetToggleAsyncKeyStates:
      g_unionDataStore_1001c3c8.aKeyStates[0] = GetAsyncKeyState(VK_SHIFT);
      g_unionDataStore_1001c3c8.aKeyStates[1] = GetAsyncKeyState(VK_MENU);
      g_unionDataStore_1001c3c8.aKeyStates[2] = GetAsyncKeyState(VK_CONTROL);

Screenshots
image
Fig. 1 - Assembly

image
Fig. 2 - C

Attachments
DD25HOOK.DLL.zip

Environment (please complete the following information):

  • OS: Windows 11
  • Java Version: 17.0.3.1
  • Ghidra Version: 11.2-DEV
  • Ghidra Origin: locally built - f59f9fb

Additional context
N/A

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