Skip to content

Commit

Permalink
Update to v3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
g0aty committed Jul 1, 2024
1 parent 184457d commit a6c855c
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 56 deletions.
1 change: 0 additions & 1 deletion appdata/il2cpp-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ DO_APP_FUNC(float, LogicOptions_GetKillDistance, (LogicOptions* __this, MethodIn
//DO_APP_FUNC(TaskBarMode__Enum, LogicOptions_GetTaskBarMode, (LogicOptions* __this, MethodInfo* method), "Assembly-CSharp, TaskbarMode LogicOptions::GetTaskBarMode()");
DO_APP_FUNC(void, KillButton_SetTarget, (KillButton* __this, PlayerControl* target, MethodInfo* method), "Assembly-CSharp, System.Void KillButton::SetTarget(PlayerControl)");
DO_APP_FUNC(PlayerControl*, ImpostorRole_FindClosestTarget, (ImpostorRole* __this, MethodInfo* method), "Assembly-CSharp, PlayerControl ImpostorRole::FindClosestTarget()");
DO_APP_FUNC(void*, AmongUsClient_CoStartGameHost, (AmongUsClient* __this, MethodInfo* method), "Assembly-CSharp, System.Collections.IEnumerator AmongUsClient::CoStartGameHost()");
//DO_APP_FUNC(AsyncOperationHandle_1_UnityEngine_GameObject_, AssetReference_InstantiateAsync_1, (AssetReference* __this, Transform* parent, bool instantiateInWorldSpace, MethodInfo* method), "UnityEngine.CoreModule, UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle UnityEngine.AddressableAssets.AssetReference::InstantiateAsync(UnityEngine.Transform, System.Boolean)");
DO_APP_FUNC(float, Console_1_CanUse, (Console_1* __this, NetworkedPlayerInfo* pc, bool* canUse, bool* couldUse, MethodInfo* method), "Assembly-CSharp, System.Single Console::CanUse(NetworkedPlayerInfo, System.Boolean&, System.Boolean&)");
DO_APP_FUNC(void, Ladder_SetDestinationCooldown, (Ladder* __this, MethodInfo* method), "Assembly-CSharp, System.Void Ladder::SetDestinationCooldown()");
Expand Down
6 changes: 3 additions & 3 deletions appdata/il2cpp-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -4610,8 +4610,8 @@ namespace app
//sicko
struct EOSManager__Fields {
void* _;
struct CallResult_1_EncryptedAppTicketResponse_t_* OnEncryptedAppTicketResponseCallResult;
struct OnLoginCallback* successCallback;
void* OnEncryptedAppTicketResponseCallResult;
void* successCallback;
struct Action* onLoginFailedCallback;
struct String* productName;
struct String* productVersion;
Expand All @@ -4636,7 +4636,7 @@ namespace app
bool announcementsVisible;
bool attemptAuthAgain;
uint32_t numLinkedAccounts;
struct List_1_Epic_OnlineServices_Connect_ExternalAccountInfo_* linkedExternalAccounts;
void* linkedExternalAccounts;
struct EditAccountUsername* editAccountUsername;
struct AskToMergeGuest* askToMergeAccount;
struct String* freeChatKey;
Expand Down
6 changes: 4 additions & 2 deletions gui/tabs/game_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace GameTab {
}


if ((IsInGame() || IsInLobby()) && ImGui::Button("Kill Everyone")) {
if (IsInGame() && ImGui::Button("Kill Everyone")) {
for (auto player : GetAllPlayerControl()) {
if (IsInGame())
State.rpcQueue.push(new RpcMurderPlayer(*Game::pLocalPlayer, player));
Expand Down Expand Up @@ -150,7 +150,7 @@ namespace GameTab {
State.Save();
}

if ((IsInGame() || IsInLobby())) {
if (IsInGame()) {
if (ImGui::Button("Kill All Crewmates")) {
for (auto player : GetAllPlayerControl()) {
if (!PlayerIsImpostor(GetPlayerData(player))) {
Expand Down Expand Up @@ -202,7 +202,9 @@ namespace GameTab {
}
}
}
}

if (IsInGame() || IsInLobby()) {
if (!State.SafeMode && GameOptions().GetBool(BoolOptionNames__Enum::VisualTasks) && ImGui::Button("Scan Everyone")) {
for (auto p : GetAllPlayerControl()) {
if (IsInGame()) State.rpcQueue.push(new RpcForceScanner(p, true));
Expand Down
24 changes: 10 additions & 14 deletions gui/tabs/players_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ namespace PlayersTab {
auto playerData = GetPlayerData(playerCtrl);
if (playerData->fields.Disconnected)
continue;
auto outfit = GetPlayerOutfit(playerData);
app::NetworkedPlayerInfo_PlayerOutfit* outfit = GetPlayerOutfit(playerData);
if (outfit == NULL) continue;
std::string playerName = RemoveHtmlTags(convert_from_string(outfit->fields.PlayerName));
std::string playerName = RemoveHtmlTags(convert_from_string(NetworkedPlayerInfo_get_PlayerName(playerData, nullptr)));
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0) * State.dpiScale);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0) * State.dpiScale);
bool isSelected = std::find(State.selectedPlayers.begin(), State.selectedPlayers.end(), player.get_PlayerId()) != State.selectedPlayers.end();
Expand All @@ -71,7 +71,7 @@ namespace PlayersTab {
else {
State.selectedPlayer = validPlayer;
selectedPlayer = validPlayer;
State.selectedPlayers = {player.get_PlayerId()};
State.selectedPlayers = { player.get_PlayerId() };
}
}
ImGui::SameLine();
Expand Down Expand Up @@ -253,7 +253,7 @@ namespace PlayersTab {
}
}
else {// if (!State.SafeMode)*/
if (ImGui::Button("Kill"))
if (IsInGame() && ImGui::Button("Kill"))
{
for (PlayerSelection p : selectedPlayers) {
auto validPlayer = p.validate();
Expand Down Expand Up @@ -285,7 +285,7 @@ namespace PlayersTab {
framesPassed = 40;
}
}
else {// if (!State.SafeMode)
else if (IsInGame()) {// if (!State.SafeMode)
ImGui::SameLine();
if (ImGui::Button("Telekill"))
{
Expand Down Expand Up @@ -391,7 +391,7 @@ namespace PlayersTab {
{
if (ImGui::Button("Protect")) {
for (auto p : selectedPlayers) {
auto outfit = GetPlayerOutfit(p.validate().get_PlayerData());
app::NetworkedPlayerInfo_PlayerOutfit* outfit = GetPlayerOutfit(p.validate().get_PlayerData());
auto colorId = outfit->fields.ColorId;
if (IsInGame())
State.rpcQueue.push(new RpcProtectPlayer(*Game::pLocalPlayer, p, colorId));
Expand Down Expand Up @@ -505,7 +505,7 @@ namespace PlayersTab {
}

if (!selectedPlayer.is_LocalPlayer() && selectedPlayers.size() == 1) {
auto outfit = GetPlayerOutfit(selectedPlayer.get_PlayerData());
app::NetworkedPlayerInfo_PlayerOutfit* outfit = GetPlayerOutfit(selectedPlayer.get_PlayerData());
if (outfit != NULL) {
auto petId = outfit->fields.PetId;
auto skinId = outfit->fields.SkinId;
Expand Down Expand Up @@ -587,7 +587,7 @@ namespace PlayersTab {
}

if (!State.SafeMode && ImGui::Button("Impersonate Everyone To") && selectedPlayers.size() == 1) {
auto outfit = GetPlayerOutfit(selectedPlayer.get_PlayerData());
app::NetworkedPlayerInfo_PlayerOutfit* outfit = GetPlayerOutfit(selectedPlayer.get_PlayerData());
auto petId = outfit->fields.PetId;
auto skinId = outfit->fields.SkinId;
auto hatId = outfit->fields.HatId;
Expand Down Expand Up @@ -733,7 +733,7 @@ namespace PlayersTab {
else suicideDelay--;
}

if (!State.SafeMode && selectedPlayers.size() == 1) {
if (!State.SafeMode && selectedPlayers.size() == 1 && IsInGame()) {
if (ImGui::Button("Kill Crewmates By")) {
for (auto player : GetAllPlayerControl()) {
if (!PlayerIsImpostor(GetPlayerData(player))) {
Expand All @@ -746,7 +746,7 @@ namespace PlayersTab {
}
}
}
if (ImGui::Button("Kill Impostors By")) {
if (ImGui::Button("Kill Impostors By") && IsInGame()) {
for (auto player : GetAllPlayerControl()) {
if (PlayerIsImpostor(GetPlayerData(player))) {
if (IsInGame())
Expand Down Expand Up @@ -856,14 +856,10 @@ namespace PlayersTab {
if (ImGui::Button("Revive"))
{
if (IsInGame()) {
auto outfit = GetPlayerOutfit(selectedPlayer.get_PlayerData());
State.rpcQueue.push(new RpcRevive(selectedPlayer.get_PlayerControl()));
State.rpcQueue.push(new RpcForceColor(selectedPlayer.get_PlayerControl(), outfit->fields.ColorId));
}
else if (IsInLobby()) {
auto outfit = GetPlayerOutfit(selectedPlayer.get_PlayerData());
State.lobbyRpcQueue.push(new RpcRevive(selectedPlayer.get_PlayerControl()));
State.lobbyRpcQueue.push(new RpcForceColor(selectedPlayer.get_PlayerControl(), outfit->fields.ColorId));
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions gui/tabs/self_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ namespace SelfTab {
if ((IsInGame() || IsInLobby()) && ImGui::Button("Set Fake Role")) {
auto localData = GetPlayerData(*Game::pLocalPlayer);
State.FakeRole = std::clamp(State.FakeRole, 0, 10);
if (State.RealRole != RoleTypes__Enum::Shapeshifter && State.FakeRole == 5)
State.FakeRole = 1;
else if (State.RealRole != RoleTypes__Enum::Phantom && State.FakeRole == 9)
State.FakeRole = 1;

if (IsInGame())
State.rpcQueue.push(new SetRole(RoleTypes__Enum(State.FakeRole)));
else if (IsInLobby())
Expand Down
7 changes: 3 additions & 4 deletions gui/tabs/settings_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace SettingsTab {

ImGui::Text("Keep safe mode on in official servers (NA, Europe, Asia) to prevent anticheat detection!");
}
if (openSpoofing) {/*
if (openSpoofing) {
if (ToggleButton("Spoof Guest Account", &State.SpoofGuestAccount)) {
State.Save();
}
Expand All @@ -199,10 +199,9 @@ namespace SettingsTab {
State.Save();
}
ImGui::Text("Guest friend code should be <= 10 characters long and cannot have a hashtag.");
ImGui::Text("It will only apply after restarting the game. For best results, use version.dll!");
if (ImGui::Button("Force Login as Guest")) {
State.ForceLoginAsGuest = true;
}*/
}
if (ToggleButton("Spoof Level", &State.SpoofLevel)) {
State.Save();
}
Expand All @@ -224,7 +223,7 @@ namespace SettingsTab {
if (CustomListBoxInt("Platform", &State.FakePlatform, PLATFORMS))
State.Save();

if (ToggleButton("Disable Host Anticheat", &State.DisableHostAnticheat)) State.Save();
//if (ToggleButton("Disable Host Anticheat", &State.DisableHostAnticheat)) State.Save();
}

if (openKeybinds) {
Expand Down
4 changes: 2 additions & 2 deletions hooks/Dleks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

int32_t dConstants_1_GetBroadcastVersion(MethodInfo* method) {
int32_t orig_return = Constants_1_GetBroadcastVersion(method);
if (State.DisableHostAnticheat) orig_return += 25;
//if (State.DisableHostAnticheat) orig_return += 25;
return orig_return;
}

bool dConstants_1_IsVersionModded(MethodInfo* method) {
if (State.DisableHostAnticheat) return true; //this helps to bypass anticheat in our hosted lobbies
//if (State.DisableHostAnticheat) return true; //this helps to bypass anticheat in our hosted lobbies
return false;
}
48 changes: 36 additions & 12 deletions hooks/EOSManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ void fakeSuccessfulLogin(EOSManager* eosManager)
}

void dEOSManager_StartInitialLoginFlow(EOSManager* __this, MethodInfo* method) {
//if (!State.SpoofGuestAccount) {
if (!State.SpoofGuestAccount) {
EOSManager_StartInitialLoginFlow(__this, method);
//return;
//}
//EOSManager_StartTempAccountFlow(__this, method);
//EOSManager_CloseStartupWaitScreen(__this, method);
return;
}
EOSManager_StartTempAccountFlow(__this, method);
EOSManager_CloseStartupWaitScreen(__this, method);
}

void dEOSManager_LoginFromAccountTab(EOSManager* __this, MethodInfo* method)
{
EOSManager_LoginFromAccountTab(__this, method);
/*if (State.SpoofGuestAccount) {
if (State.SpoofGuestAccount) {
LOG_DEBUG("Faking login");
fakeSuccessfulLogin(__this);
}*/
}
}

void dEOSManager_InitializePlatformInterface(EOSManager* __this, MethodInfo* method)
Expand Down Expand Up @@ -65,12 +65,12 @@ void dEOSManager_UpdatePermissionKeys(EOSManager* __this, void* callback, Method
}

void dEOSManager_Update(EOSManager* __this, MethodInfo* method) {
//static bool hasDeletedDeviceId = false;
static bool hasDeletedDeviceId = false;
//__this->fields.ageOfConsent = 0; //why tf does amogus have an age of consent lmao
//if (State.SpoofFriendCode && IsHost()) __this->fields.friendCode = convert_to_string(State.FakeFriendCode);
EOSManager_Update(__this, method);
//EOSManager_set_FriendCode(__this, __this->fields.friendCode, NULL);
/*if (State.SpoofGuestAccount) {
if (State.SpoofGuestAccount) {
auto player = app::DataManager_get_Player(nullptr);
static FieldInfo* field = il2cpp_class_get_field_from_name(player->Il2CppClass.klass, "account");
LOG_ASSERT(field != nullptr);
Expand All @@ -81,17 +81,17 @@ void dEOSManager_Update(EOSManager* __this, MethodInfo* method) {
auto loggedOut = EOSManager_AccountLoginStatus__Enum::Offline;
if ((int)il2cpp_field_get_value_object(field1, (Il2CppObject*)account) != (int)loggedOut)
il2cpp_field_set_value((Il2CppObject*)account, field1, &loggedIn);
if (State.UseGuestFriendCode && State.GuestFriendCode != "") {
/*if (State.UseGuestFriendCode && State.GuestFriendCode != "") {
auto username = __this->fields.editAccountUsername;
TMP_Text_set_text((TMP_Text*)username->fields.UsernameText, convert_to_string(State.GuestFriendCode), NULL);
//EditAccountUsername_SaveUsername(username, NULL);
}
}*/
if (__this->fields.hasRunLoginFlow && !hasDeletedDeviceId) {
EOSManager_DeleteDeviceID(__this, NULL, NULL);
LOG_DEBUG("Successfully deleted device ID!");
hasDeletedDeviceId = true;
}
}*/
}

/*if (State.ForceLoginAsGuest) {
EOSManager_PlayOffline(__this, NULL);
Expand Down Expand Up @@ -128,4 +128,28 @@ String* dEOSManager_get_ProductUserId(EOSManager* __this, MethodInfo* method) {
void dPlatformSpecificData_Serialize(PlatformSpecificData* __this, MessageWriter* writer, MethodInfo* method) {
if (State.SpoofPlatform) __this->fields.Platform = Platforms__Enum(State.FakePlatform + 1);
PlatformSpecificData_Serialize(__this, writer, method);
}

void dEditAccountUsername_SaveUsername(EditAccountUsername* __this, MethodInfo* method) {
if (State.UseGuestFriendCode && State.GuestFriendCode != "")
TMP_Text_set_text((TMP_Text*)__this->fields.UsernameText, convert_to_string(State.GuestFriendCode), NULL);
else {
auto textStr = TMP_Text_get_text((TMP_Text*)__this->fields.UsernameText, NULL);
if (textStr != convert_to_string("")) {
std::string newFriendCode = "";
for (auto i : convert_from_string(textStr)) {
newFriendCode += tolower(i);
}
TMP_Text_set_text((TMP_Text*)__this->fields.UsernameText, convert_to_string(newFriendCode), NULL);
}
else {
std::string newFriendCode = "";
std::string randomString = GenerateRandomString();
for (auto i : randomString) {
newFriendCode += tolower(i);
}
TMP_Text_set_text((TMP_Text*)__this->fields.UsernameText, convert_to_string(newFriendCode), NULL);
}
}
EditAccountUsername_SaveUsername(__this, method);
}
50 changes: 39 additions & 11 deletions hooks/HudManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void dHudManager_Update(HudManager* __this, MethodInfo* method) {
playerInfo->fields.Role->fields.CanBeKilled = false;
}
GameObject* KillButton = app::Component_get_gameObject((Component_1*)__this->fields.KillButton, NULL);
if (KillButton != NULL) {
if (KillButton != NULL && IsInGame()) {
if ((!State.PanicMode && State.UnlockKillButton && !localData->fields.IsDead) || PlayerIsImpostor(localData)) {
app::GameObject_SetActive(KillButton, true, nullptr);
playerRole->fields.CanUseKillButton = true;
Expand All @@ -113,8 +113,35 @@ void dHudManager_Update(HudManager* __this, MethodInfo* method) {
playerRole->fields.CanUseKillButton = false;
}
}
else if (KillButton != NULL && IsInLobby()) {
app::GameObject_SetActive(KillButton, false, nullptr);
}
}
}

static bool didSabotage = false;
static int sabotageDelay = 50;
if (IsHost() && IsInGame()) {
if (*Game::pLocalPlayer != NULL && !didSabotage) {
if (sabotageDelay == 50) {
if (State.mapType == Settings::MapType::Ship || State.mapType == Settings::MapType::Hq || State.mapType == Settings::MapType::Fungle)
State.rpcQueue.push(new RpcUpdateSystem(SystemTypes__Enum::Reactor, 128));
else if (State.mapType == Settings::MapType::Pb)
State.rpcQueue.push(new RpcUpdateSystem(SystemTypes__Enum::Laboratory, 128));
else if (State.mapType == Settings::MapType::Airship)
State.rpcQueue.push(new RpcUpdateSystem(SystemTypes__Enum::HeliSabotage, 128));
}
if (sabotageDelay == 0) {
RepairSabotage(*Game::pLocalPlayer);
didSabotage = true;
}
else sabotageDelay--;
}
}
else {
didSabotage = false;
sabotageDelay = 50;
}
}
}
catch (...) {
Expand All @@ -139,26 +166,27 @@ void dPingTracker_Update(PingTracker* __this, MethodInfo* method) {
int fps = GetFps();
std::string fpsText = "";
if (State.ShowFps) {
if (fps <= 20) fpsText = std::format(" FPS: <#f00>{}</color>", fps);
else if (fps <= 40) fpsText = std::format(" <#ff0>FPS: {}</color>", fps);
else fpsText = std::format(" <#0f0>FPS: {}</color>", fps);
if (fps <= 20) fpsText = std::format(" ~ FPS: <#f00>{}</color>", fps);
else if (fps <= 40) fpsText = std::format(" ~ <#ff0>FPS: {}</color>", fps);
else fpsText = std::format(" ~ <#0f0>FPS: {}</color>", fps);
}
std::string autoKill = State.AutoKill ? " <#f00>Autokill</color>" : "";
std::string noClip = State.NoClip ? " NoClip" : "";
std::string freeCam = State.FreeCam ? " Freecam" : "";
std::string autoKill = State.AutoKill ? " ~ <#f00>Autokill</color>" : "";
std::string noClip = State.NoClip ? " ~ NoClip" : "";
std::string freeCam = State.FreeCam ? " ~ Freecam" : "";
std::string spectating = "";
if (State.playerToFollow.has_value()) {
app::NetworkedPlayerInfo_PlayerOutfit* outfit = GetPlayerOutfit(GetPlayerData(GetPlayerControlById(State.playerToFollow.get_PlayerId())));
Color32 playerColor = GetPlayerColor(outfit->fields.ColorId);
std::string colorCode = std::format("<#{:02x}{:02x}{:02x}{:02x}>",
playerColor.r, playerColor.g, playerColor.b, playerColor.a);
spectating = " Now Spectating: " + colorCode + RemoveHtmlTags(convert_from_string(NetworkedPlayerInfo_get_PlayerName(GetPlayerData(GetPlayerControlById(State.playerToFollow.get_PlayerId())), nullptr)));
spectating = " ~ Now Spectating: " + colorCode + RemoveHtmlTags(convert_from_string(NetworkedPlayerInfo_get_PlayerName(GetPlayerData(GetPlayerControlById(State.playerToFollow.get_PlayerId())), nullptr)));
}
else spectating = "";
std::string hostText = State.ShowHost ?
(IsHost() ? " You are Host" : std::format(" Host: {}", GetHostUsername(true))) : "";
std::string hostText = State.ShowHost && IsInGame() ?
(IsHost() ? " ~ You are Host" : std::format(" ~ Host: {}", GetHostUsername(true))) : "";
std::string voteKicksText = (State.ShowVoteKicks && State.VoteKicks > 0) ? std::format(" Vote Kicks: {}", State.VoteKicks) : "";
std::string pingText = std::format("<#0f0>Sicko</color><#f00>Menu</color> <#fb0>{}</color> by <#9ef>goaty</color> ~ {}<size=50%>{}\n{}{}{}{}{}</size>", State.SickoVersion, ping, fpsText, hostText, voteKicksText, autoKill, noClip, freeCam, spectating);
std::string pingText = std::format("<size={}%><#0f0>Sicko</color><#f00>Menu</color> <#fb0>{}</color> by <#9ef>goaty</color> ~ {}{}{}{}{}{}{}</size>{}", spectating == "" ? 100 : 50,
State.SickoVersion, ping, fpsText, hostText, voteKicksText, autoKill, noClip, freeCam, spectating, IsInGame() ? "\n<#0000>0</color>" : "");
app::TMP_Text_set_alignment((app::TMP_Text*)__this->fields.text, app::TextAlignmentOptions__Enum::BaselineGeoAligned, nullptr);
app::TMP_Text_set_text((app::TMP_Text*)__this->fields.text, convert_to_string(pingText), nullptr);
}
Expand Down
Loading

0 comments on commit a6c855c

Please sign in to comment.