mandiant / mandiant/capa

Broken offset matching in IDA

Open
#2,638 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug ida
Dominant language
Python
Stars
6.2k
Forks
726
Avg merge
11d 11h
Merged PRs (30d)
7

Description

### Description

During the development of rules for donut-related rules, it is discovered that `offset` keyword does not match instructions that should match per capa's specs. When investigated, I found out that the `offset` matching behavior within capa standalone and IDA capa explorer differs. At the moment, the `offset` matching works in capa standalone but not within IDA.

### Steps to Reproduce

1. Open shellcode sample referenced in https://github.com/mandiant/capa-rules/pull/997 in IDA
2. Open capa explorer
3. Wait for analysis results

**Expected behavior:**

Rules that use the `offset` keyword to match the relevant instructions

**Actual behavior:**

Sample does not match the `offset` keyword defined within the rule

![Image](https://github.com/user-attachments/assets/d36520f1-d02e-4cf4-a386-fcb729a51307)

### Versions

- capa 9.1.0 (3bd339522e57afe4b1103ca00bfac928cdcb8f2c)
- IDA Pro 9.0.241217
- vivisect
viv_utils 0.8.0
vivisect 1.2.1

### Additional Information

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the mismatch with the shellcode sample referenced in capa-rules PR 997, using IDA Pro's capa explorer. Compare how the offset keyword is matched in capa standalone and the IDA integration, then verify that the relevant rules match in both environments. The issue is for capa 9.1.0 with IDA Pro 9.0.241217, viv_utils 0.8.0, and vivisect 1.2.1.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
reverse-engineering, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.