-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Condition being disregarded leading to wrong output #6473
Comments
This could be a red herring, but I'm unsure. Because of what the |
The decompiler's analysis looks valid to me. The TEST / JGE branches if ECX is greater than or equal to zero, which is always true because the XOR ECX,ECX clears the sign bit and the MOV CL,byte ptr [...] doesn't alter it. |
@caheckman I came to the same conclusion, but .... I wonder if there's some undocumented thing going on that, back in the day, treated that prticular |
Closing because there doesn't seem to be a problem with Ghidra. The conversation can continue in the "closed" state. |
Describe the bug
A
condition
based upon the contents of a global byte array (initially within an undefined memory block, but recently joined with its predecessor to make one contiguous area, as the array spanned both areas when loaded into Ghidra) is being treated as having a value of0
when interpreted by the decompiler, even if the mutability is changed fromnormal
tovolatile
-normal
should work. This is leading to incorrect C code. I.e. instead ofor nothing (if option
Eliminate unreachable code
ison
), we should see(edited the condition to be
<
)the assembly that is corresponding to
if (false) {
isTo Reproduce
Steps to reproduce the behavior:
Decompile:
PanelsDebug Function Decompilation
menu)Expected behavior
The enclosing guard condition should not be deemed superfluous and should appear in the reproduced C code.
Screenshots
N/A
Attachments
dd25hook_FUN_10007bb7.zip
Environment (please complete the following information):
Additional context
This is a 32-bit DLL compiled with MSVC 4.1/4.2 compiler.
The text was updated successfully, but these errors were encountered: