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

Add a more specific RunFinalizer signature for Summer Vacation! Scramble #199

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

y0soro
Copy link
Contributor

@y0soro y0soro commented Jan 8, 2025

The "Test Game" signature is a bit general that it matched MS.Internal.Xml.Cache.XPathDocumentNavigator$$MoveToId in Summer Vacation! Scramble(SVS) assembly, causing NULL finalier access crashes due to HasFinalize not being handled.

The one actually matched RunFinalizer in SVS is "V Rising" signature, though it's listed after the "Test Game" signature.

Although a simple reorder can fix the issue for SVS, both signatures mentioned are quiet general so this could breaks other games relying on this matching order, otherwise the same crash can happen due to hooking on the wrong location.

Thus I instead add a more specific signature that should solely matches RunFinalizer on SVS or other games with similar compilation options before the too general one.


This supersedes #196 and is less aggressive. The added signature is the most specific one so it should not match functions other than RunFinalizer in other games.

Tested working on SVS v1.1.3 and verified that this signature matches RunFinalizer on SVS v1.0.2, v1.1.1 and v1.1.2 assembly.

[Debug :Il2CppInterop] GarbageCollector::RunFinalizer found: 0x633D02E0

The "Test Game" signature is a bit general that it matched `MS.Internal.Xml.Cache.XPathDocumentNavigator$$MoveToId`
in Summer Vacation! Scramble(SVS) assembly, causing NULL finalier access
crashes due to HasFinalize not being handled.

The one actually matched RunFinalizer in SVS is "V Rising" signature,
though it's listed after the "Test Game" signature.

Although a simple reorder can fix the issue for SVS, both signatures
mentioned are quiet general so this could breaks other games relying on
this matching order, otherwise the same crash can happen due to hooking
on the wrong location.

Thus I instead add a more specific signature that should solely matches
RunFinalizer on SVS or other games with similar compilation options
before the too general one.
Copy link
Member

@ManlyMarco ManlyMarco left a comment

Choose a reason for hiding this comment

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

#196 already got approved and this is straight up better so should be fine to merge right away.

@ManlyMarco ManlyMarco merged commit a096080 into BepInEx:master Jan 11, 2025
2 checks passed
@y0soro y0soro deleted the add-svs-signature branch January 13, 2025 07:00
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.

2 participants