Skip to content

Incorrect local variable matching #3333

Open
@k-badz

Description

Environment information

  • Operating System: FLARE-VM
  • Cutter version: 2.1.2
  • Obtained from: FLARE-VM
  • File format:

Describe the bug

In screenshots below, Cutter didn't match local variables correctly (lpFilename and var_60h_2), both of them have the same state of ESP, and are the same instructions. Their memory operand is [esp+60h].

You can see that Cutter assigned different stack offset for these (difference of 0xC). It looks like it didn't properly recognized GetModuleFileNameW calling convention and assumed that ESP should be cleaned by caller.

To Reproduce

Steps to reproduce the behavior:

  1. Open https://github.com/HuskyHacks/PMAT-labs/blob/main/labs/2-1.AdvancedStaticAnalysis/Dropper.DownloadFromURL.exe.malz/Dropper.DownloadFromURL.exe.7z/
  2. Navigate to "main" function.
  3. Check the offsets from screenshots.

Expected behavior

lpFilename and var_60h_2 should be considered the same local variable.

Both IDA Free and Ghidra do that properly.

Screenshots

Cutter:
image
image

Ghidra:
image

IDA Free:
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions