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

Changing local variable's datatype is denied, causing Unable to use type for symbol ... message #6908

Closed
Wall-AF opened this issue Sep 13, 2024 · 1 comment
Assignees

Comments

@Wall-AF
Copy link

Wall-AF commented Sep 13, 2024

Describe the bug
With a structure defined in the application's data segment (DS) and members of said structure also defined, accessing a defined member is causing an incorrect datatype to be assigned to the local variable that cannot be changed. I.e.:
lVar1 = *(long *)&DgnInter_1028_0000_0x61_t_1078_11be.field2_0x6;
where field2_0x6 is of type DgnInter_1018_0d46_0x?_t *32 and the assembly is:
1018:0d55 66 a1 c4 11 012 MOV EAX,DS:[0x11c4]

Note the use of a single 32-bit register instead of two 16-bit ones.

To Reproduce
Steps to reproduce the behavior:

  1. Load in the enclosed function (from the Decompile:Panels Debug Function Decompilation menu)
  2. Try changing the datatype of lVar1
  3. Observe the warning message
  4. See error in that the datatype hasn't changed and the later else if statement (line 30) is still malformed

Expected behavior
The size of the register to load an address shouldn't:

  1. Affect the automatic datatype detection
  2. Stop manual overriding

Screenshots
N/A

Attachments
dgninter_FUN_1018_0d46.zip

Environment (please complete the following information):

  • OS: Windows 11
  • Java Version: Temurin-21.0.3+9
  • Ghidra Version: 11.2-DEV
  • Ghidra Origin: locally built (based upon commit 34ba255)

Additional context
This is a Protected-Mode 16-bit Windows NE EXE from a Borland C/C++ v 4.?? compiler.

@Wall-AF
Copy link
Author

Wall-AF commented Sep 23, 2024

In this case (where I'm assuming the application shares the stack SS and data DS segments), setting the SS to the same value as DS for the first assembly instruction where it is MOV <reg>, SS solves the issue. Therefore I'll close this.

@Wall-AF Wall-AF closed this as completed Sep 23, 2024
@ryanmkurtz ryanmkurtz removed the Status: Triage Information is being gathered label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants