Help! How to bx lr a function with C++ instead of ARM instruction?

PixelYT

Verified Modder
Verified Modder
Feb 20, 2020
31
13
8
Soviet Union
What do I do if I want to bx lr a function in C++ through hooking instead of ARM instruction?
For example, if I had this method and I hooked it and I wanted to bx lr it with C++ instead of ARM:
C#:
private void objectCollision(); // 0x39D8347
How would I do it? And would I be able to do it on non-void methods too?

(I know what bx lr is and what it does, I don't need explanation for that)
 

PixelYT

Verified Modder
Verified Modder
Feb 20, 2020
31
13
8
Soviet Union
hook it like normal an return ;
So you mean I would just put this inside the body of the hook and it would be equivalent to a bx lr?
C++:
void(*old_ObjectCollision)(void *instance);
void ObjectCollision(void *instance)
{
    return;
}
// MSHook blaha blahah blaha bla
Okay but the void datatype doesn't return anything, meaning we can't use return, or is it just that 'return'; works because it doesn't actually return anything??
 

About us

  • Welcome to Polarmods.com! We are an ever-expanding gaming community that loves to both help others, and make mods for everyone to enjoy! Although we're currently quite small, we can guarantee you that we offer the best game mods for the game that you're looking for! If you don't find what you're looking for please request it in the android mods request section. We're always trying to improve ourselves and to make you guys happy. We also want to help you out, that's why we offer tutorials on modding, and tools to help you out! So what are you waiting for? Join in on the fun! If you need anything, be sure to join our discord server, or contact us on one of your social medias below. We hope you have a great day :)

Quick Navigation

User Menu