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 function calls #123

Closed
rfalke opened this issue Oct 29, 2018 · 2 comments
Closed

Missing function calls #123

rfalke opened this issue Oct 29, 2018 · 2 comments
Labels
type: bug (I) Something is not working as intended
Milestone

Comments

@rfalke
Copy link

rfalke commented Oct 29, 2018

Version: ed7a3e1
Exe: https://github.com/rfalke/decompiler-subjects/blob/master/from_holdec/dmi/output/ia32_elf/subject.exe
Source:

int main(int argc, char *argv[])
{
        int result = 0;
        result += basic_1_ternary_simple(argc);
        result += basic_2_ternary_other(argc);
        result += intermediate_1_ternary_blocks(argc);
        result += intermediate_2_other_in_blocks(argc);
        result += intermediate_10_double_word_signed_math(argc, argc, argc);
        result += intermediate_10_double_word_unsigned_math(argc, argc, argc);
        result += advanced_1_unrolled_loop();

        return result + argv[0][0];
}

Output:

/** address: 0x08048340 */
int main(int argc, char *argv[])
{
    __size8 al;                 // r8
    __size32 eax;               // r24
    __size32 ebp;               // r29
    __size32 ebx;               // r27
    int edi;            // r31
    int esi;            // r30
    union { __size32; __size32 *; } esp;                // r28
    __size32 local4;            // m[esp]

    eax = basic_1_ternary_simple(argc); /* Warning: also results in al */
    basic_2_ternary_other(al, eax, esp + 4, argv, eax, esp - 8, argc, argc >> 31, SARFLAGS(argc >> 31, argc, 31), SARFLAGS(argc >> 31, argc, 31), SARFLAGS(argc >> 31, argc, 31), a
rgc, argv, local4, ebp, edi, esi, ebx, esp + 4, argv, argc, pc);
}
  • The other function calls are not there
  • There is no return statement for a non-void function
  • The result of the basic_2_ternary_other isn't used
  • minor: the parameters of basic_2_ternary_other are wrong
@ceeac ceeac added the type: bug (I) Something is not working as intended label Oct 29, 2018
@ceeac
Copy link
Member

ceeac commented Oct 30, 2018

This is caused by the same issue as in #122 (missing cmovs semantics).

@ceeac ceeac added this to the v0.5.0 milestone Oct 30, 2018
@ceeac
Copy link
Member

ceeac commented Nov 14, 2018

This is fixed now that #69 is merged.

@ceeac ceeac closed this as completed Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug (I) Something is not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants