#R2 Hook.OriginalFunction crashing

8 messages · Page 1 of 1 (latest)

molten token
#

I'm not entirely sure what's happening here, since the mod (in its entirety) was working completely fine for me when I was working on it over the past 2 days, but somewhere along me setting up a repo and before publishing to GameBanana it now just crashes the game. It seems to run fine the first time I build it, but subsequent launches of the game causes it to crash before loading in to the title screen.

I've isolated that the problem comes from my _cameraHook.OriginalFunction call - commenting out my custom function logic still crashes, but removing the original function call will run. The only thing I can think of would be that the registers/parameters aren't correctly defined or interacted with in my code, but I'm not sure why it was working before.

My logging statements also print to console and seem to indicate no issue at all in this section, including the memory modifications, though they don't get written to the actual log file due to the game crashing.

I took a look through the resulting assembly code through CE, and didn't identify anything clearly wrong but my assembly skills are pretty lacking, and the game crashing on launch is making debugging difficult :/ Any help would be greatly appreciated, kinda at a loss atm.

https://github.com/MonoHearted/p5rpc.ultrawide

GitHub

Contribute to MonoHearted/p5rpc.ultrawide development by creating an account on GitHub.

rose sparrow
#

I was able to fix the crash by setting shadowspace to "true"

#

also according to ida the function actually has a return type of uint*

molten token
#

oh, interesting

#

i wasn't sure what the shadowspace actually did but i should look into it. Does the return type of the delegate matter? I was under the impression that it shouldn't since I'm calling the original function at the end anyway

#

but yeah thanks, good to know. I wrote this before my ghidra finished and I didn't bother to check the return type haha

#

lemme try to see if this fixes the crash for me

#

it works femc thanks a lot secrec