Help! Getting Error In Mono Araay!!!

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
Basically, I'm making a Hack to Kill All through Mono Array as shown in this thread :
How to hook arrays in Unity's Il2cpp - Platinmods.com - Android & iOS MODs, Mobile Games & Apps

So, I have
This code is in Main.cpp above Hack Thread :
IMG_20240615_124404.jpg

Sorry Can't Show Full Code As It Can Be Copy/Pasted If you want full code to help and understand it in beeter way then please give me your telegram username I will send you there!!!

Code is like this :
Example :

C++:
void (*Kill)(void *instance);

void (*old_Update)(void *instance);
void Update(void *instance) {
if (instance != NULL) {
auto players = get_PlayerList();
for (int i; i < players->getLength; i++) {
auto player = players->getPointer();
Kill(player);
}
}
old_Update(instance);
}
And it's giving me this error :
IMG_20240615_124427.jpg


I have added struct of Mono Array in different file MonoArray.h I have also included that in Main.cpp :
IMG_20240615_124801.jpg


Please tell me where I'm doing wrong.

And please also correct me if I'm wrong should I add this hook in MonoArray.h or somewhere else?
Because I tried to add this hook in Main.cpp under hack thread it gave me errors.

monoArray<void *> *(*PhotonNetwork_get_OtherPlayers)() = (monoArray<void *> *(*)())il2cppAddress + 0xOFFSET;
 
Last edited:

ByteX

Platinian
Jun 15, 2024
20
1
3
15
To fix this error, you need to cast the void* pointer to the correct type before accessing its members.
 

ByteX

Platinian
Jun 15, 2024
20
1
3
15
The error "Subscript of Pointer to Incomplete type 'void'" is because you're trying to use the subscript operator ([]) on a void* pointer, which is not allowed.

In your code, players->getPointer() returns a void* pointer, and you're trying to use it as an array with player = players->getPointer();. This is not valid C++ syntax.

To fix this, you need to cast the void* pointer to the correct type, which is likely a MonoObject* or a MonoArray* depending on the type of players.

Here is the Correct one:

Code:
void (*Kill)(void *instance);

void (*old_Update)(void *instance);
void Update(void *instance) {
    if (instance != NULL) {
        MonoArray* players = get_PlayerList();
        for (int i = 0; i < mono_array_get_length(players); i++) {
            MonoObject* player = mono_array_get(players, i);
            Kill(player);
        }
    }
    old_Update(instance);
}
 

ByteX

Platinian
Jun 15, 2024
20
1
3
15
Cast the void* pointer to a PhotonPlayer* pointer using static_cast:
auto photonPlayer = static_cast<PhotonPlayer*>(PhotonPlayer->getPointer())[i];
 

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
Cast the void* pointer to a PhotonPlayer* pointer using static_cast:
auto photonPlayer = static_cast<PhotonPlayer*>(PhotonPlayer->getPointer())[i];
I will send you real code there. The code you fixed is not real that was just an example.
 

libModz

Awesome Active Platinian
Jun 2, 2022
196
42
28
UK
You sir, are stupid. You clearly don't know how to code, you talk about people potentially copying your code when that's pretty much what you've done from me and probably others too.

If you even bothered to read that post about monoArray hooking and some of the top comments you'll have seen that this error was fixed by adding another * in the monoArray function like so...

monoArray<void**>*(*PhotonNetwork_get_OtherPlayers)() = (monoArray<void**>*(*)())il2cppAddress + 0xOFFSET;

Go and learn how to code C++ programming language then you can stop bothering me and other people with a fake account, YOURDADPRODUCTION or whoever you really are.
 

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
You sir, are stupid. You clearly don't know how to code, you talk about people potentially copying your code when that's pretty much what you've done from me and probably others too.

If you even bothered to read that post about monoArray hooking and some of the top comments you'll have seen that this error was fixed by adding another * in the monoArray function like so...

monoArray<void**>*(*PhotonNetwork_get_OtherPlayers)() = (monoArray<void**>*(*)())il2cppAddress + 0xOFFSET;

Go and learn how to code C++ programming language then you can stop bothering me and other people with a fake account, YOURDADPRODUCTION or whoever you really are.
Note : My English is Weak So Please Don't Judge!

For your kind information Sir, I read all the top comments already and I tried the way you're telling me now and it's crashing my Game!

And if you think I'm a copy paster then I would not have added many hacks in my mod menu. There's many things I managed to do myself like Add Points, End Round, Change Prop Item, My Player Size, Enemy Player Size, ESP There's Even Many More. How?? Because you teached me and I figured out some myself. You remember that isn't you? You helped me to teach how to code and I respect that. Yeah I was wrong I made fake account to get help from you but I did only to learn not to copy paste. Yes I'm noob/beginner in C++ because I'm new in this language but I'm still trying to learn. I did Lua for past many years and I was God in that. But in C++ I'm not because anyone do not get professional in anything in the first time without learning that very well. And you must know this very well! Han? Didn't you spent money to learn how to use RPC because you had no other option you were not professional enough to do it yourself.😒 You have to learn that from someone by paying money.

Imagine if I would not have tell you the truth. But I still did because I wanted to let you know who you are really helping. I didn't wanted to be fake anymore.

Yeah I was pretty much stupid who did this all to learn not to copy paste. Atleast I'm still trying to learn tho.

Atlast I just wanna ask one thing why do you hate YØURDAD PRODUCTION?
Because when I told you the truth you immediately blocked me I still don't know real reason behind that what he have done wrong to you bruh?
 

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
You sir, are stupid. You clearly don't know how to code, you talk about people potentially copying your code when that's pretty much what you've done from me and probably others too.

If you even bothered to read that post about monoArray hooking and some of the top comments you'll have seen that this error was fixed by adding another * in the monoArray function like so...

monoArray<void**>*(*PhotonNetwork_get_OtherPlayers)() = (monoArray<void**>*(*)())il2cppAddress + 0xOFFSET;

Go and learn how to code C++ programming language then you can stop bothering me and other people with a fake account, YOURDADPRODUCTION or whoever you really are.
Screenshot_2024-06-15-15-50-03-979_com.excelliance.multiaccount.assist.jpg
 

libModz

Awesome Active Platinian
Jun 2, 2022
196
42
28
UK
RPC is complicated so yes I spent money to learn how to do that with parameters, I already knew how to use RPC with no params

You didn't even understand how to do the basic things, like for example where to hook...

monoArray<void**>*(*PhotonNetwork_get_OtherPlayers)();

Which goes in main.cpp above hack thread btw. All hooked function go in main.cpp. You would know this if you took the time to read/watch some tutorials on here and on YouTube.

I'm not surprised your game is crashing, you're trying to pass Photon Players into the Kill() function, which is not designed to take Photon Players as a parameter. I already told you kill all players is RPC.
Just because there is a method called Kill() doesn't mean you can kill all players using that function, it doesn't work like that. Learn how to code better.

As for why I blocked you, I've been told by several people that you copy their code. You already had lot of code from me, I'm done helping you now don't bother me anymore.
 

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
RPC is complicated so yes I spent money to learn how to do that with parameters, I already knew how to use RPC with no params

You didn't even understand how to do the basic things, like for example where to hook...

monoArray<void**>*(*PhotonNetwork_get_OtherPlayers)();

Which goes in main.cpp above hack thread btw. All hooked function go in main.cpp. You would know this if you took the time to read/watch some tutorials on here and on YouTube.

I'm not surprised your game is crashing, you're trying to pass Photon Players into the Kill() function, which is not designed to take Photon Players as a parameter. I already told you kill all players is RPC.
Just because there is a method called Kill() doesn't mean you can kill all players using that function, it doesn't work like that. Learn how to code better.

As for why I blocked you, I've been told by several people that you copy their code. You already had lot of code from me, I'm done helping you now don't bother me anymore.
That's what I said brother I'm new in this language that's why I don't know basic things.

And the people's who told you I copied their code they scammed me first. I have been scammed many time for Hacks or something which I have knowledge about. I still know them.
There could be more I don't remember now!
You don't know the truth that's why you think I'm the biggest scammer blah blah.
 

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
RPC is complicated so yes I spent money to learn how to do that with parameters, I already knew how to use RPC with no params

You didn't even understand how to do the basic things, like for example where to hook...

monoArray<void**>*(*PhotonNetwork_get_OtherPlayers)();

Which goes in main.cpp above hack thread btw. All hooked function go in main.cpp. You would know this if you took the time to read/watch some tutorials on here and on YouTube.

I'm not surprised your game is crashing, you're trying to pass Photon Players into the Kill() function, which is not designed to take Photon Players as a parameter. I already told you kill all players is RPC.
Just because there is a method called Kill() doesn't mean you can kill all players using that function, it doesn't work like that. Learn how to code better.

As for why I blocked you, I've been told by several people that you copy their code. You already had lot of code from me, I'm done helping you now don't bother me anymore.
Btw, still my game crashing even adding that hook above hack thread and I'm doing CloseConnection now

Above Update

monoArray<void**>*(*PhotonNetwork_getOtherPlayers)() = (monoArray<void**>*(*)()) getAbsoluteAddress("libil2cpp.so", 0x123456);

bool (*CloseConnection)(void *instance);

old_Update
Update
...
...
...
old_Update(instance)

Under Hack Thread

CloseConnection = (bool(*)(void*)) getAbsoluteAddress(targetLibName, 0x123456);

JUST HELP ME WITH THIS AND I WILL NEVER BORTHER YOU AGAIN!
 

Tosilegit

Platinian
Feb 1, 2022
14
1
3
Perttilä
Perhaps unrelated and not answering your problem, but since LibModz won't answer you anymore I thought I'd share some information.

Imo, if you want to destroy other players the best to do so is to use:
public void DestroyPlayerObjects(int playerId, bool localOnly)
in NetworkingPeer.

You'll get the playerId from the PhotonPlayer instances in the array (*PhotonNetwork_getOtherPlayers)(), that you have. And you can exclude your PhotonPlayer by checking: bool get_isLocal().

The reason this is the best way is that you can destroy players regardless of if you are the master client or not. And you don't have to use any complicated RPC methods.
 

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
Perhaps unrelated and not answering your problem, but since LibModz won't answer you anymore I thought I'd share some information.

Imo, if you want to destroy other players the best to do so is to use:
public void DestroyPlayerObjects(int playerId, bool localOnly)
in NetworkingPeer.

You'll get the playerId from the PhotonPlayer instances in the array (*PhotonNetwork_getOtherPlayers)(), that you have. And you can exclude your PhotonPlayer by checking: bool get_isLocal().

The reason this is the best way is that you can destroy players regardless of if you are the master client or not. And you don't have to use any complicated RPC methods.
Thanks for replying.

Do you have Telegram?
I will send you the complete code there, just check the code and correct me.
 

xAMAL1991

Platinian
Mar 17, 2022
5
3
3
33
Jeddah
Dumbass dont know how to code or fix a stupid error, and he worried about someone to copy paste his code, oh sorry, that's not even your code
 

Demon x Gaming

Platinian
Original poster
May 7, 2024
15
1
3
23
Dumbass dont know how to code or fix a stupid error, and he worried about someone to copy paste his code, oh sorry, that's not even your code
For your kind information Dumbass, I have already fixed that shit so now Shut Yo Bitch Ass Up.