add better error handling for processes whose memory can't be read#1
Open
binary1230 wants to merge 1 commit intowh0am15533:masterfrom
Open
add better error handling for processes whose memory can't be read#1binary1230 wants to merge 1 commit intowh0am15533:masterfrom
binary1230 wants to merge 1 commit intowh0am15533:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Win10, when hitting Refresh in the GUI, was getting an exception here of "Failed to read process memory", which was unhandled and caused the app to crash.
SharpMonoInjector/SharpMonoInjector/Memory.cs
Line 62 in ae35e07
Weirdly, this is for an unrelated EXE I didn't care about - JetBrains.ReSharper.Host64.exe (my Jetbrains visual studio plugin)
This PR catches exceptions like this, logs them, and skips the offending EXE. With it in place, I can pick up the EXE I care about and things go well from there.
I also modified the logging to reduce code copy+paste.
I could have made this PR a little cleaner and separated the logging cleanup from the exception handling but.... 🤷 If that's an issue, let me know I'll clean it up.
Thanks! Btw, ever consider doing releases here on Github instead of on the forum? Just easier to deal with, unless there's a reason to keep it on the forum.
-Dom