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

Typecasted value becomes 0 #4590

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

Typecasted value becomes 0 #4590

yangzao opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something is broken needs-triage Issue has yet to be looked at by a maintainer

Comments

@yangzao
Copy link

yangzao commented Apr 17, 2024

Description

Original code:

v0 = 0 * v0 + (unsigned short)((v0 | 321) * 0 * v0) + 363;

Decompiled code:

s_l = 321 + 42 + ((short)((((double)(s_l)) * ((double)(321))))) * ((short)((((int)(s_l)) | ((int)(321))))) + ((int)((((double)(s_l)) * ((double)(321)))));

Both (doube)(321) and (int)(321) are recovered as 0.

Steps to reproduce the bug

Files:
10.zip

(0. the exec is included as orig_exec)

  1. compile orig,c with GCC and -O0.
  2. decompile the exec with angr.
  3. the issue is at the first for loop near the beginning of func_1.

Environment

No response

Additional context

No response

@yangzao yangzao added bug Something is broken needs-triage Issue has yet to be looked at by a maintainer labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken needs-triage Issue has yet to be looked at by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant