Skip to content

Improve iterator variable inferrence in OneTurn loops #83

@dolphinau

Description

@dolphinau

Currently, the deobfuscation of OneTurn loops is partial
As soon as the iterator var is modified (by an assignment), it stops being replaced

Moreover, any operation performed on iterator var is not handled by the deobfuscator

Take this input

for ($i = 0; $true; $i++) {
  echo $i;
  $i = $i + 1;
  echo $i;
  break;
  $i = $i - 1
}

For now it is deobfuscated to

$i = 0
echo 0
$i = $i + 1
echo $i

But it should be

echo 1
echo 2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions