Skip to content

add better error handling for processes whose memory can't be read#1

Open
binary1230 wants to merge 1 commit intowh0am15533:masterfrom
binary1230:master
Open

add better error handling for processes whose memory can't be read#1
binary1230 wants to merge 1 commit intowh0am15533:masterfrom
binary1230:master

Conversation

@binary1230
Copy link

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.

throw new InjectorException("Failed to read process memory", new Win32Exception(Marshal.GetLastWin32Error()));

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

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