Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Show Ghosts, End Meeting and Fixed Radar Crash #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Libraries and software used to create this cheat include magic_enum, Dear IMGUI,

## Features:
- Force a meeting
- Force end a meeting
- NoClip
- Mark imposters
- Show Ghosts
- Radar (courtesy of [v0idp](https://github.com/v0idp))
- Reset disconnection ban time
- Spam chat, and force other players to spam
Expand Down
1 change: 1 addition & 0 deletions user/CWState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace CWState

bool NoClip = false;
bool MarkImposters = false;
bool ShowGhosts = false;
bool ShowRadar = false;
float RadarZoom = 8.0F;

Expand Down
1 change: 1 addition & 0 deletions user/CWState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace CWState

extern bool NoClip;
extern bool MarkImposters;
extern bool ShowGhosts;
extern bool ShowRadar;
extern float RadarZoom;

Expand Down
3 changes: 1 addition & 2 deletions user/GameUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ bool CheckColorAvailable(uint8_t color)

bool IsInGame()
{
return (*AmongUsClient__TypeInfo)->static_fields->Instance->fields._.GameState == InnerNetClient_GameStates__Enum_Joined
|| (*AmongUsClient__TypeInfo)->static_fields->Instance->fields._.GameState == InnerNetClient_GameStates__Enum_Started;
return (*AmongUsClient__TypeInfo)->static_fields->Instance->fields._.GameState == InnerNetClient_GameStates__Enum_Started;
}

CorrectedColor32 GetPlayerColor(uint8_t colorId)
Expand Down
23 changes: 18 additions & 5 deletions user/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,16 @@ HRESULT __stdcall D3D_FUNCTION_HOOK(IDXGISwapChain* pThis, UINT SyncInterval, UI
ImGui::Spacing();

if (ImGui::CollapsingHeader("Game"))
{
if (ImGui::Button("Call Meeting"))
{
PlayerControl_CmdReportDeadBody((*PlayerControl__TypeInfo)->static_fields->LocalPlayer, NULL, NULL);
}
{
if (ImGui::Button("Call Meeting"))
PlayerControl_CmdReportDeadBody((*PlayerControl__TypeInfo)->static_fields->LocalPlayer, NULL, NULL);

if (ImGui::Button("End Meeting"))
MeetingHud_ForceSkipAll((*MeetingHud__TypeInfo)->static_fields->Instance, NULL);

ImGui::Checkbox("NoClip", &CWState::NoClip);
ImGui::Checkbox("Mark Imposters", &CWState::MarkImposters);
ImGui::Checkbox("Show Ghosts", &CWState::ShowGhosts);
ImGui::Checkbox("Radar", &CWState::ShowRadar);
ImGui::Text("Radar Zoom");
ImGui::SliderFloat("##RadarZoom", &CWState::RadarZoom, 4.0F, 16.0F, "%.f", 1.0F);
Expand Down Expand Up @@ -626,6 +629,16 @@ void HudHook(MethodInfo* m)
GameObject_set_layer(comp, LayerMask_NameToLayer(CreateNETStringFromANSI("Ghost"), NULL), NULL);
}

if (CWState::ShowGhosts) {

for (auto player : GetAllPlayers())
{
auto data = GetPlayerData(player);
if (!PlayerControl_get_Visible(player, NULL) && data->fields.IsDead)
PlayerControl_set_Visible(player, true, NULL);
}
}

if (CWState::MarkImposters)
for (auto player : GetAllPlayers())
{
Expand Down
5 changes: 3 additions & 2 deletions user/radar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace Radar {
}

void RenderRadar(bool* state, float radarZoom) {
if (IsInGame())
{
ImGui::SetNextWindowSize(ImVec2(256, 256));
ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), SquareConstraint);

Expand All @@ -42,8 +44,7 @@ namespace Radar {
drawList->AddLine(ImVec2(winpos.x, winpos.y + winsize.y * 0.5F),
ImVec2(winpos.x + winsize.x, winpos.y + winsize.y * 0.5F), ImColor(70, 70, 70, 255), 1.0F);

if (IsInGame())
{

PlayerControl* localPlayer = (*PlayerControl__TypeInfo)->static_fields->LocalPlayer;

if (!localPlayer) {
Expand Down