Help! How to Hook GameObject

imls01245

Platinian
in dump.cs

C#:
// RVA: 0x117A220 Offset: 0x1176220 VA: 0x117A220
    public static GameObject unlockNextSphere(sphereType sType) { }

    // RVA: 0x117AA58 Offset: 0x1176A58 VA: 0x117AA58
    public static bool areAnyLocked(string name) { }

    // RVA: 0x117A240 Offset: 0x1176240 VA: 0x117A240
    private static GameObject unlockRank() { }

    // RVA: 0x117A6C4 Offset: 0x11766C4 VA: 0x117A6C4
    private static GameObject unlockSecret() { }

i tried to hook this using normal void hook, it doesnt work
 
The method literally returns a GameObject type… and you're saying it's fine to hook it with void?


Seriously, why does everyone here think you can just slap void on anything and hope it's going to work it's irritating how false information people spread to others you can really spend 5 minutes reading about return types to understand how to handle this


You’ve got two options:


Actually define the GameObject structure and return it


Or just hook it as void pointer ( void* )


you're welcome
 
Actually define the GameObject structure and return it
Yes, I know this is the better way of doing it, not saying it's ideal to handle it with void. That's why I asked to see the hook. For how most people would use GameObject, like simply getting that gameobject, passing it as a parameter somewhere else, or just calling a function for that GO. That type of stuff works with just void. Returning a new GO is a bit more complicated, and yes requires the struct, or a library.

But yeah, I agree👍 Maybe it's not good to teach to use void for everything. Better to learn BNM, structs etc.
 
Yes, I know this is the better way of doing it, not saying it's ideal to handle it with void. That's why I asked to see the hook. For how most people would use GameObject, like simply getting that gameobject, passing it as a parameter somewhere else, or just calling a function for that GO. That type of stuff works with just void. Returning a new GO is a bit more complicated, and yes requires the struct, or a library.

But yeah, I agree👍 Maybe it's not good to teach to use void for everything. Better to learn BNM, structs etc.
Saying "it works with just void" doesn't make it correct. Just because the function doesn't crash when you used void doesn't mean you're doing it right—it just means you're lucky the memory layout didn't break things yet.

And assuming by BNM you meant By Name Modding sure it's good and fun but won't teach you anything it's always better to start from the very fundamentals if someone would know the return types and what each do , you would know it's just wrong
 
The method literally returns a GameObject type… and you're saying it's fine to hook it with void?


Seriously, why does everyone here think you can just slap void on anything and hope it's going to work it's irritating how false information people spread to others you can really spend 5 minutes reading about return types to understand how to handle this


You’ve got two options:


Actually define the GameObject structure and return it


Or just hook it as void pointer ( void* )


you're welcome
How to hook it as void pointer then, is not like this?

i know this is a void function pointer if its not, then what is it?
void *(old_funcname)(void*instance); ?
 
Back
Top Bottom