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

Restrict signature debug logging to vivisect backend #2044

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

acelynnzhang
Copy link
Contributor

I noticed that signatures will only load when the backend is vivisect:

capa/capa/main.py

Lines 695 to 698 in 7debc54

def get_signatures_from_cli(args, input_format: str, backend: str) -> List[Path]:
if backend != BACKEND_VIV:
logger.debug("skipping library code matching: only supported by the vivisect backend")
return []

I moved the debug logging from handle_common_args to get_signatures_from_cli, so it's only printed when the signatures are actually used. This means that other backends don't need the default signatures directory to exist.

Closes #1875

Checklist

  • No CHANGELOG update needed
  • No new tests needed
  • No documentation update needed

Copy link

google-cla bot commented Apr 2, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@acelynnzhang acelynnzhang force-pushed the dynamic-signature-fix branch 2 times, most recently from f182641 to 16b0248 Compare April 2, 2024 06:54
capa/main.py Outdated Show resolved Hide resolved
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.

see inline comment, then good to go

@acelynnzhang
Copy link
Contributor Author

see inline comment, then good to go

is this good? thanks!

@acelynnzhang acelynnzhang requested a review from mr-tz April 2, 2024 16:13
Copy link
Collaborator

@williballenthin williballenthin left a comment

Choose a reason for hiding this comment

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

thanks!

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.

thank you

@mr-tz mr-tz merged commit 9171dc2 into mandiant:master Apr 3, 2024
25 checks passed
@acelynnzhang acelynnzhang deleted the dynamic-signature-fix branch April 3, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dynamic: don't load signatures for dynamic analysis
3 participants