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

incorrect value/control flow recovery #1201

Open
yangzao opened this issue Apr 29, 2024 · 0 comments
Open

incorrect value/control flow recovery #1201

yangzao opened this issue Apr 29, 2024 · 0 comments

Comments

@yangzao
Copy link

yangzao commented Apr 29, 2024

Description:
RetDec doesn't recover correct final values. (Not sure if it's due to incorrect control flow recovery)
In the original code, the arguments passed to set_var should be 2, 321, and 13134243433 (0x30edca669)
Instead, they are 15, 123, and 0x30edca669 in the decompiled code.
And the printed string should be "another local string".

Decompiled code:

while (v1 < 111 != (110 - v1 & v1) < 0) {
        // 0x4012e0
        v1++;
        v2 = 0x30edca669;
        __asm_lfence();
    }
    // 0x401304
    set_var(15, 123, v2);                         // should be (2, 321, v2)
    *(int64_t *)&g4 = (int64_t)"local string";
    return printf("%s", "local string");           // should be "another local string"

Files:
retdec.zip
The original code, compiled program and the decompiled code are included.
The program is compiled by clang-12.
Unfortunately I don't have the optimization options used to compile the program,
but if you run it, it'll print out the string assigned to str ("another local string"),
which is not presented in the decompiled code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant