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

Low-level Error: Overlapping input varnodes #11

Open
brainstorm opened this issue Oct 23, 2024 · 0 comments
Open

Low-level Error: Overlapping input varnodes #11

brainstorm opened this issue Oct 23, 2024 · 0 comments

Comments

@brainstorm
Copy link

I'm reversing this STM8S003 firmware (flash.bin file):

https://github.com/brainstorm/treadmill-re/tree/master/control

The decompilation seems to fail (offset 0x8ee9)... any ideas on what might be causing this error?:

Screenshot 2024-10-23 at 10 37 43 pm

According to similar issues, there seems to be some register conflict so perhaps there's some flaw in the sleigh definition? ... oh, I just found I reported it last year (totally forgot): NationalSecurityAgency/ghidra#3602 (comment)

Anyway, it seems to work with radare2's r2ai decompilation for now:

int fcn_00008ee9(int x, int y) {
    uint16_t sp[10];
    uint8_t a, xl, yl;
    uint16_t res;

    fcn_00008c70();
    fcn_00008e06();

    if (x >= 0x01f4) {
        x = 0x03e8;
    }

    while (x < 0x018b) {
        x++;
    }

    while (x > 0x0640) {
        x -= sp[9];
    }

    for (int i = 0; i < 5; i++) {
        fcn_00009e24();
        fcn_00009e07();
    }

    fcn_00009cbf();
    fcn_00009cd1();
    fcn_00009bf7();
    fcn_00009ba8();

    *(uint8_t*)PORTA_DDR |= (1 << 1);
    *(uint8_t*)PORTA |= (1 << 1);
    *(uint8_t*)PORTA &= ~(1 << 2);

    for (int i = 0; i < 3; i++) {
        fcn_00009e24();
        fcn_00009e07();
        fcn_00009cbf();
        fcn_00009cd1();
    }

    fcn_00009bc8();
    fcn_00009bef();

    *(uint8_t*)PORTA |= (1 << 3);
(...)
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