Skip to content

type casted value recovered as 0 #136

Open
@yangzao

Description

@yangzao

Environment

Thu Apr 18 08:05:01 PM MDT 2024
radare2 5.8.9 31711 @ linux-x86-64
birth: git.5.8.8-1074-gbe75b2d9ee 2024-02-13__17:26:56
commit: be75b2d9ee0701582aae047c2a717c4a64d6503e
options: gpl -O1 cs:5 cl:2 make
Linux x86_64

Description

When using R2Ghidra to decompile a program, a type casted value is recovered as 0
Original code:

(long)((((int)(9876543)) % ((int)(l_l))))

Decompiled code:

0 % iStack_20

((int)(9876543)) becomes 0 (iStack_20 corresponds to l_l)

Test

Files:
3.zip

commands used:

r2 orig_exec
aaa
pdg @ sym.func_1

the issue is at the line (iStack_20 = (iStack_20 * iStack_20 ...) before the last for loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions