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

dotnet update: emit enclosing class information for nested classes #1913

Merged
merged 50 commits into from
Jan 5, 2024

Conversation

bkojusner
Copy link
Contributor

Draft PR with progress to resolve #1780

Copy link

google-cla bot commented Dec 20, 2023

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.

Copy link
Collaborator

@mike-hunhoff mike-hunhoff 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 @bkojusner - your code is coming along nicely. Please see my comments and suggestions. Let me know here if you have any questions 🚀

capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/types.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/types.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@mike-hunhoff mike-hunhoff left a comment

Choose a reason for hiding this comment

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

Good work @bkojusner this is coming together nicely. Please address my comments and re-request a review from me when you're ready. Let me know if you have any questions along the way 😃.

capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/types.py Outdated Show resolved Hide resolved
capa/features/extractors/dotnetfile.py Outdated Show resolved Hide resolved
@bkojusner
Copy link
Contributor Author

Latest changes look great @bkojusner! I've left some minor comments for you to address.

We have two more items to complete:

  1. Update the changelog to include an entry for the work that you completed in this PR
  2. Add unit tests so we can ensure your code continues working after your PR is merged (see
    FEATURE_PRESENCE_TESTS_DOTNET = sorted(

    )

Uploaded two test samples for the unit tests at mandiant/capa-testfiles#224.

@bkojusner bkojusner marked this pull request as ready for review January 5, 2024 15:50
Copy link
Collaborator

@mike-hunhoff mike-hunhoff left a comment

Choose a reason for hiding this comment

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

@bkojusner nice work! A few small changes for you to address and then we are ready to merge 🚀

capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
capa/features/extractors/dnfile/helpers.py Outdated Show resolved Hide resolved
nested_class_table = {}

# Used to find nested classes in typedef
for _rid, nestedclass in iter_dotnet_table(pe, dnfile.mdtable.NestedClass.number):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is _rid being used here? If not, see my suggestion above

@mike-hunhoff mike-hunhoff self-requested a review January 5, 2024 17:07
Copy link
Collaborator

@mike-hunhoff mike-hunhoff left a comment

Choose a reason for hiding this comment

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

great job @bkojusner LGTM 🚀

@mike-hunhoff mike-hunhoff merged commit 7584e4a into mandiant:master Jan 5, 2024
25 checks passed
@williballenthin
Copy link
Collaborator

woohoo congrats @bkojusner!

@mr-tz
Copy link
Collaborator

mr-tz commented Jan 8, 2024

awesome! 🥳

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.

dotnet: emit enclosing class information for nested classes
4 participants