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

Several bugs found: incorrect function argument order, double type value, and strings #1337

Closed
yangzao opened this issue Apr 16, 2024 · 2 comments
Labels
bug This issue describes a defect in Reko

Comments

@yangzao
Copy link

yangzao commented Apr 16, 2024

Hello, I'm using the CLI version of Reko 0.11.5.0 on Linux and found some issues regarding the decompiled code.
The executables and their corresponding source code, decompiled code, and compiler options are included in Reko.zip.

[*] Program 1:

original code:
image
decompiled code:
image

The argument order of set_var() is recovered incorrectly.
The order of qwLoc18_141 (corresponds to l_l) and dwLoc0C_144 (corresponds to i_l) gets reversed.

[*] Program 2:

issue 1:
original code:
image
decompiled code:
image

(double)(i_l) (i_l equals to 1) is recovered as 1e-45F

issue 2:
decompiled code:
image

The decompiled multiply is appended with an extra s.

[*] Program 3:

Reko does not generate any decompiled code in each function of this program.

[*] Program 4:
original code:
image
image
decompiled code:
image
image

str is a char * in the original code.
But in decompiled code, it is defined as a word64 (I assume it's int64_t).
And printf tries to access it with dereferencing.

[*] Program 5:

When the original code is compiled by GCC, Microsoft Visual C++ compiler (MSVC), Tiny C compiler, and Clang targeted for Mach-O,
the string literals are not recovered in the decompiled code.

@uxmal
Copy link
Owner

uxmal commented Apr 17, 2024

@yangzao: thanks for reporting these errors. I've opened separate issues for each of them to make it easier to track and discuss.

@uxmal uxmal added the bug This issue describes a defect in Reko label Apr 17, 2024
@uxmal
Copy link
Owner

uxmal commented Apr 30, 2024

This has been fixed in commit 02e40b8.

@uxmal uxmal closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect in Reko
Projects
None yet
Development

No branches or pull requests

2 participants