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

COMHunter update #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rpgmaster280
Copy link

@rpgmaster280 rpgmaster280 commented Aug 10, 2022

  • Changed from Trim to custom TrimEnd function in order to make program compatible with versions of .NET < 4.6
  • Added ability to list method information using reflection. This method seems to work for internal windows COM classes. Ive seen it work occasionally on third party COM classes, but I'm not sure under what conditions. To-do: Include method signature information (the duplicate methods occasionally listed are a result of method overloading).
  • Added -includesystem flag for searching system COM methods.

- Changed from Trim to custom TrimEnd function in order to make program compatible with versions of .NET < 4.6
- Added ability to list method information using reflection. This method seems to work for internal .NET COM classes. Ive seen it work occasionally on third party COM classes, but I'm not sure under what conditions. To-do: Include method signature information (the duplicate methods occasionally listed are a result of method overloading).
- Added -includesystem flag for searching system COM methods.
@rpgmaster280
Copy link
Author

rpgmaster280 commented Aug 10, 2022

Some other proposed changes that might be added later:

  • Ability to filter classes and methods based on search term.
  • Ability to instantiate COM servers and list exposed methods via an -unsafe flag. Did not notice a difference on my test machine regarding instantiating the class vs using reflection only, but this could of been because the machine in question is a lab machine. Needs further testing.

Based on some testing I did, you can instantiate all COM classes in a safe manner by using Marshal.ReleaseCOMObject. This method will properly dispose the instantiated COM server objects, preventing a system crash. Note that doing this is operationally loud and not recommended. It's also slower than using reflection only. Decided to exclude this functionality from the pull request:

https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.releasecomobject?view=net-6.0

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.

1 participant