Squirrelies / RE2REmakeSRT

An SRT (SpeedRun Tool) for Resident Evil 2 (2019).
MIT License
48 stars 11 forks source link

[BUG] SRT crashes upon attaching to game process. #12

Closed LeafBucket closed 5 years ago

LeafBucket commented 5 years ago

Computer Information:

Describe the bug SRT does not start, I get error popup

Steps to Reproduce Steps to reproduce the behavior: I get the normal "The program will start once re2.exe is detected as running..." window when I start the game I get the error message and the srt fails to start.

capture

Squirrelies commented 5 years ago

I know where in the code it is happening but not why since it doesn't happen on my machine. Would you be willing to run a test build and help me track this down?

LeafBucket commented 5 years ago

Yupp

Squirrelies commented 5 years ago

Ok I'll make a test build shortly with extra try/catch statements and debug info to see what parameter is invalid.

LeafBucket commented 5 years ago

I restarted my computer and tried to run as administrator again and I got this error now. capture

jorgebonafe commented 5 years ago

I can confirm the same error is happening for me, both running SRT before the game (it crashes when the game opens), and after the game is running, same version, 1.1.8.3.

Edit. I also tried versions 1.1.8.2 down to 1.1.7.1. 1.1.8.2 crashes with the same error and lower versions crash with no error messages.

image

Squirrelies commented 5 years ago

http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1184-Beta-Signed-Debug.7z

This won't fix the issue but should give me more info to find the problem. Can you get me the error message from this build?

jorgebonafe commented 5 years ago

This is the new error message:

image

Squirrelies commented 5 years ago

By any chance is your Scaling Factor set to 75 instead of 0.75?

Regedit: HKEY_CURRENT_USER\Software\RE2REmakeSRT\ScalingFactor

LeafBucket commented 5 years ago

capture I am getting a slightly different error message and I checked my Regedit and the scaling factor option was not there!

jorgebonafe commented 5 years ago

Ok, I tried what LeafBucket tried, rebooted and ran it on Admin mode, and got a different message:

image

Also, my registry on RE2REmakeSRT has no values at all:

image

Sorry about the portuguese on the error message, I don't know how to change that... It says: "Only a portion of a request ReadProcessMemory or WRiteProcessMemory has concluded in ..."

Squirrelies commented 5 years ago

Yeah we're dealing with two different issues at the same time.

The ReadProcessMemory error is a different issue. We should open a separate bug for that one.

One moment while I prepare another build. I want to see what Program.programSpecialOptions.ScalingFactor returns.

Squirrelies commented 5 years ago

http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1184-Beta-Signed-Debug-2.7z

While you are running this, I am going to work on a quick change that might fix the other issue.

LeafBucket commented 5 years ago

capture Error I got after downloading your latest link!

Squirrelies commented 5 years ago

Ok, that is the other error again. Let me finish up these P/Invoke calls since some people suggest that ERROR_PARTIAL_COPY (299) which triggers that Win32Exception can be caused by weird WoW64 behavior.

With EnumProcessModulesEx I can explicitly tell it to only give me 64-bit modules and also just avoid all of the extra stuff .NET is doing in the background when I call Process.BaseAddress and Process.MainModule.FullPath.

I should have a new build shortly.

Squirrelies commented 5 years ago

http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1184-Beta-Signed-Debug-3.7z

P.s. I really appreciate your help with this since I am unable to reproduce this on my machine. I am not sure what is different between our environments but I am curious what the cause is so we can finally solve this. :) <3

Squirrelies commented 5 years ago

If the Win32Exception disappears and the other error reappears (ArgumentException), that is a good sign. it means we may have fixed that Win32Exception error.

LeafBucket commented 5 years ago

capture My pleasure :). This is the new error I am getting

Squirrelies commented 5 years ago

Excellent, so for some reason the scaling factor is defaulting or being set to 0 which causes the image to try to resize to 0x0 which .NET is telling me is not possible.

I'll search in the settings code and see if I can find out why it is being dumb. I may just add code for now that says the value must be greater than 0 and less than or equal to 4 (400%)

LeafBucket commented 5 years ago

Sounds good!

Squirrelies commented 5 years ago

http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1184-Beta-Signed-Debug-4.7z

This code has checks for the scalingFactor and will set it to 0.75 if its less than or equal to 0 or greater than 4. It also has error handling on the registry reading code. See if this helps.

LeafBucket commented 5 years ago

That did it 👍 Thanks for the help!

Squirrelies commented 5 years ago

Awesome, thanks for all of your help on this. This has been a nagging issue for a little while now. :)

LeafBucket commented 5 years ago

My pleasure. Great work on the program!

Squirrelies commented 5 years ago

http://dudley.gg/squirrelies/re2/RE2REmakeSRT-1184-Beta-Signed-Release.7z

Release build with the fix.