Jump to content

1 post in this topic

Recommended Posts

Posted

So Ive been trying to hook an array for enemy players through photon. I used this header that I found on GitHub:

template <typename T>
struct monoArray
{
    void* klass;
    void* monitor;
    void* bounds;
    int   max_length;
    void* vector [1];
    int getLength()
    {
        return max_length;
    }
    T getPointer()
    {
        return (T)vector;
    }
};

I used this hook and pointer for the function I was trying to hook:

//pointer
monoArray<void *> *(*PhotonNetwork_get_OtherPlayers)() = (monoArray<void *> *(*)())getRealOffset(0x1018291A8);

//hook
monoArray<void **> *otherPlayers = PhotonNetwork_get_OtherPlayers();

for (int i = 0; i < otherPlayers->getLength(); ++i)
{
    void *ePlayerr = otherPlayers->getPointer()[i];

  //run my code for the hack im trying to do. examples = telekill, masskill, scale players ect..
      
}

I get this error tho:

Tweak.xm:531:21: error: cannot initialize a variable of type
      'monoArray<void **> *' with an rvalue of type 'monoArray<void *> *'
monoArray<void **> *photonplayers = PhotonNetwork_get_OtherPlayers();

How do I fix this? Already tried on my own and looking it up,  Just gave me even more errors

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines