Skip to content

Fix issue finding GetFieldDefaultValue on 2021.3.23#90

Merged
ds5678 merged 2 commits intoBepInEx:masterfrom
limoka:fix_finding_get_field_default_value
Aug 28, 2025
Merged

Fix issue finding GetFieldDefaultValue on 2021.3.23#90
ds5678 merged 2 commits intoBepInEx:masterfrom
limoka:fix_finding_get_field_default_value

Conversation

@limoka
Copy link
Contributor

@limoka limoka commented May 7, 2023

This PR fixes an issue where Class::GetDefaultFieldValue() is not found by signature and traversal search returns wrong value because of compiler optimization.
Added a check for such optimization and added the signature from the game where issue occured.
Tested on Idle Slayer Unity 2021.3.23 and Core Keeper Unity 2021.3.14

@ds5678
Copy link
Collaborator

ds5678 commented Dec 13, 2024

@limoka can you rebase?

@limoka limoka force-pushed the fix_finding_get_field_default_value branch from 4e6132e to 37168ce Compare January 16, 2025 14:17
@limoka
Copy link
Contributor Author

limoka commented Jan 16, 2025

@ds5678 rebased as you asked. Sorry it took a while, I was busy with IRL things.

@limoka
Copy link
Contributor Author

limoka commented Jan 18, 2025

@ds5678 addressed your comments. You can have a look at why these changes were made in these Discord messages. https://discord.com/channels/623153565053222947/623153565661265952/1104817110888235018

This message in particular shows exactly the situation in which this check is triggered.

A correct match should not contain more than 4 jumps, at least on metadata version 30 and below (IDK about further versions, this needs more testing)

@ds5678
Copy link
Collaborator

ds5678 commented Feb 14, 2025

It looks fine to me, but I probably won't merge it without @js6pak giving it a look too. Runtime changes aren't really my area of expertise.

Copy link
Collaborator

@ds5678 ds5678 left a comment

Choose a reason for hiding this comment

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

Approving due to extensive battle testing from MelonLoader users.

@ds5678 ds5678 merged commit bc570c3 into BepInEx:master Aug 28, 2025
2 checks passed
@limoka limoka deleted the fix_finding_get_field_default_value branch August 28, 2025 03:59
@ds5678 ds5678 added this to the 1.5.1 milestone Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants