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

[Expression Propagation] Propagating global variables #400

Open
fnhartmann opened this issue Mar 14, 2024 · 0 comments
Open

[Expression Propagation] Propagating global variables #400

fnhartmann opened this issue Mar 14, 2024 · 0 comments
Labels
feature-request New feature or request

Comments

@fnhartmann
Copy link
Collaborator

fnhartmann commented Mar 14, 2024

Proposal

We are currently skipping global variables in the Expression Propagation stages. But for example in extractme.zip it would be better for the readability to propagate them.

For the example, consider this block:

ecx_1#2 = *(i#2 + shellcode#2)
*(i#2 + shellcode#2) = ecx_1#2 ^ 0x13
shellcode#5 -> shellcode#2
eax_3#6 = i#2 + 0x1

ecx_1#2 should be propagated like this:

ecx_1#2 = *(i#2 + shellcode#2)
*(i#2 + shellcode#2) = (*(i#2 + shellcode#2)) ^ 0x13
shellcode#5 -> shellcode#2
eax_3#6 = i#2 + 0x1

(The example was decompiled with the changes made in #397.)

The restriction should be checked and maybe removed.

Used Binary Ninja version: 3.5.4526

Approach

A problem with global variables can be the memory version of the variable in the expression. So we could implement a check if the memory versions are matching. If so, the global variables can be propagated.

Afterwards, this should be tested in detail.

@fnhartmann fnhartmann added the feature-request New feature or request label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant