ExtraJuiceMan / ChristWareAmongUs

A cheat for the recently popular fad game Among Us
MIT License
110 stars 33 forks source link

Vote removing #11

Closed MenuGamer closed 4 years ago

MenuGamer commented 4 years ago

So I am using the following code and expecting to remove everyones vote, but it only removes the vote from my self. I am not sure if I am doing this wrong or something.

InnerNetClient* net = (InnerNetClient*)(*AmongUsClient__TypeInfo)->static_fields->Instance;
int32_t oldClientId = net->fields.ClientId;
for (auto player : GetAllPlayers())
{
                if (MeetingHud_DidVote((*MeetingHud__TypeInfo)->static_fields->Instance, GetPlayerData(player)->fields.PlayerId, NULL)) {
                    net->fields.ClientId = InnerNetClient_GetClientIdFromCharacter(net, (InnerNetObject*)player, NULL);
                    MeetingHud_RpcClearVote((*MeetingHud__TypeInfo)->static_fields->Instance, net->fields.ClientId, NULL);
                }
}
net->fields.ClientId = oldClientId;

Also I made few features if you would like to add them to the cheat.

for (auto player : GetAllPlayers())
{
        if (!PlayerControl_get_Visible(player, NULL) && data->fields.IsDead)
                    PlayerControl_set_Visible(player, true, NULL);
}
ExtraJuiceMan commented 4 years ago

Crack open the game with Ghidra or IDA, load Il2CppDumper's Ghidra/IDA scripts, and try to figure out what the game actually does when calling that function. Some functions will do funny things even though they are named something obvious.

If you want to contribute code, please submit a pull request after confirming that your code works.