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

type casted value recovered as 0 #136

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

type casted value recovered as 0 #136

yangzao opened this issue Apr 19, 2024 · 0 comments

Comments

@yangzao
Copy link

yangzao commented Apr 19, 2024

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.

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