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

ghidra: add Ghidra feature extractor and supporting code #1770

Merged
merged 64 commits into from
Aug 30, 2023

Conversation

mike-hunhoff
Copy link
Collaborator

This PR is a result of @colton-gabertan 's Google Summer of Code (GSoC) 2023 project that integrates capa with Ghidra using the Python 3 support provided by Ghidrathon. Colton has provided a summary of his work on this project here.

Closes #49.

colton-gabertan and others added 30 commits May 19, 2023 14:38
New Feature: Ghidra Backend - Initial Merge
* ghidra-backend ci working, fix CHANGELOG

* temp: Add backend-ghidra to CI test workflow & add versioning to matrix

* lint to avoid failure

* linting for CI

* cleanup CI, integrate actions, simplify installations

* fix gradle repo

* fix typo

* fix submodule checkout for rules & test data

* fix relative test data path

* remove unnecessary steps

* add flag to mkdir to resolve pipeline failure
* Revert "colton: removed redundant imports & object, locally tested"

This reverts commit 3da233d.

* removed redundant imports & objects, local test confirmation

* linted with isort

* linted with black

* linted with pycodestyle

* additional linting

* rebasing to avoid merge conflicts
Implement Ghidra backend file feature extraction
* save progress

* implement loop detection

* implement recursive call detection

* lint repo

* fix python/java import errors

* simplify recursion detection

* streamline loop detection, fix helper function signature
* save progress

* implement loop detection

* implement recursive call detection

* lint repo

* fix python/java import errors

* simplify recursion detection

* implement tight loop extraction

* streamline loop detection, fix helper function signature

* begin stackstring extraction

* implement is_mov_imm_to_stack()

* implement stackstring extraction, fixture test passing

* clean & lint, pass fixture tests

* temp: resolve linting issues

* temp: fix linting issues

* implement reviewed changes, simplify functions

* fix tight loop extraction
@mike-hunhoff mike-hunhoff added enhancement New feature or request ghidra Related to Ghidra integration gsoc Work related to Google Summer of Code project. labels Aug 28, 2023
Copy link
Collaborator

@colton-gabertan colton-gabertan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome quick, last-minute changes and fixes. Looks good for the initial merge to me 👍

@mike-hunhoff
Copy link
Collaborator Author

@williballenthin and @mr-tz thoughts on squashing the merge when ready?

@mr-tz
Copy link
Collaborator

mr-tz commented Aug 29, 2023

The history looks fairly clean so we could also do a merge, but squash also works for me.

Copy link
Collaborator

@mr-tz mr-tz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, excited to see Ghidra support in capa!!

.github/workflows/tests.yml Outdated Show resolved Hide resolved
capa/ghidra/README.md Outdated Show resolved Hide resolved
capa/ghidra/README.md Outdated Show resolved Hide resolved
capa/ghidra/README.md Outdated Show resolved Hide resolved
capa/ghidra/README.md Outdated Show resolved Hide resolved
capa/ghidra/README.md Outdated Show resolved Hide resolved
capa/ghidra/README.md Outdated Show resolved Hide resolved
tests/fixtures.py Show resolved Hide resolved
@williballenthin
Copy link
Collaborator

I can do a detailed review on Thursday. But, given the other LGTMs, no need to delay on my account. I will add comments here regardless that we can address after-the-fact.

@mike-hunhoff mike-hunhoff merged commit 7b08f2d into master Aug 30, 2023
25 checks passed
@mike-hunhoff mike-hunhoff deleted the backend-ghidra branch August 30, 2023 16:41
@williballenthin
Copy link
Collaborator

woohoo!

@mr-tz
Copy link
Collaborator

mr-tz commented Sep 1, 2023

Awesome job on this! Thanks @colton-gabertan and @mike-hunhoff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ghidra Related to Ghidra integration gsoc Work related to Google Summer of Code project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integrate capa with ghidra
4 participants