Skip to content

Fix invalid return value when calling injected methods via Il2Cpp reflection#74

Merged
Kasuromi merged 1 commit intoBepInEx:masterfrom
limoka:fix-reflection-return-value
Feb 14, 2023
Merged

Fix invalid return value when calling injected methods via Il2Cpp reflection#74
Kasuromi merged 1 commit intoBepInEx:masterfrom
limoka:fix-reflection-return-value

Conversation

@limoka
Copy link
Copy Markdown
Contributor

@limoka limoka commented Feb 13, 2023

This PR fixes an issue where calling injected methods via Il2Cpp reflection resulted in garbage data for value types and null for reference types returned.
This issue is caused by change in signature of invoker_method in Il2Cpp version 29

@limoka
Copy link
Copy Markdown
Contributor Author

limoka commented Feb 13, 2023

So far I have tested value type and reference types being passed correctly. Not sure about byref ones though. Also probably a test on 27 version of il2cpp would good.

Copy link
Copy Markdown
Member

@Kasuromi Kasuromi left a comment

Choose a reason for hiding this comment

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

Behavior remains the same for pre-v29 game versions.
Tested on v24 & two v27 games.

@Kasuromi Kasuromi merged commit e28b791 into BepInEx:master Feb 14, 2023
@limoka limoka deleted the fix-reflection-return-value branch February 14, 2023 06:30
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