diff --git a/attach b/attach index 50bccc76..f75f3be2 100755 --- a/attach +++ b/attach @@ -50,10 +50,11 @@ gdb -n -q -batch \ -ex "call \$dlopen(\"$FILENAME\", 1)" \ -ex "call dlerror()" \ -ex 'print (char *) $2' \ + -ex "catch syscall exit exit_group" \ -ex "detach" \ -ex "quit" rm $FILENAME sudo killall -18 steamwebhelper -sudo killall -18 steam \ No newline at end of file +sudo killall -18 steam diff --git a/attach-backtrace-scramble.sh b/attach-backtrace-scramble.sh index 0c3fac7d..3a586022 100755 --- a/attach-backtrace-scramble.sh +++ b/attach-backtrace-scramble.sh @@ -33,6 +33,9 @@ if grep -q "$FILENAME" /proc/"$proc"/maps; then exit fi +sudo killall -19 steam +sudo killall -19 steamwebhelper + echo loading "$FILENAME" to "$proc" gdb -n -q -batch \ -ex "attach $proc" \ @@ -43,3 +46,6 @@ gdb -n -q -batch \ -ex "catch syscall exit exit_group" \ -ex "continue" \ -ex "backtrace" + +sudo killall -18 steamwebhelper +sudo killall -18 steam diff --git a/include/MiscTemporary.hpp b/include/MiscTemporary.hpp index 8cdd08e5..b45e9380 100644 --- a/include/MiscTemporary.hpp +++ b/include/MiscTemporary.hpp @@ -27,6 +27,7 @@ extern CatVar semiauto; extern CatVar engine_pred; extern Timer DelayTimer; extern CatVar delay; +extern CatVar adjust; #if ENABLE_VISUALS extern int spectator_target; extern CLC_VoiceData *voicecrash; diff --git a/include/core/offsets.hpp b/include/core/offsets.hpp old mode 100755 new mode 100644 index 36d86047..91e7215f --- a/include/core/offsets.hpp +++ b/include/core/offsets.hpp @@ -98,6 +98,10 @@ struct offsets { return PlatformOffset(36, undefined, undefined); } + static constexpr uint32_t WriteUsercmdDeltaToBuffer() + { + return PlatformOffset(22, undefined, 22); + } static constexpr uint32_t CanPacket() { return PlatformOffset(57, undefined, undefined); diff --git a/include/sdk/netmessage.hpp b/include/sdk/netmessage.hpp index fc024df9..44b2245d 100644 --- a/include/sdk/netmessage.hpp +++ b/include/sdk/netmessage.hpp @@ -255,6 +255,28 @@ private: char m_szCvarNameBuffer[256]; }; +class CLC_Move : public CNetMessage +{ + DECLARE_CLC_MESSAGE(Move); + + int GetGroup() const + { + return INetChannelInfo::MOVE; + } + + CLC_Move() + { + m_bReliable = false; + } + +public: + int m_nBackupCommands; + int m_nNewCommands; + int m_nLength; + bf_read m_DataIn; + bf_write m_DataOut; +}; + class CLC_VoiceData : public CNetMessage { DECLARE_CLC_MESSAGE(VoiceData); diff --git a/src/MiscTemporary.cpp b/src/MiscTemporary.cpp index 6218f589..8c948ba7 100644 --- a/src/MiscTemporary.cpp +++ b/src/MiscTemporary.cpp @@ -22,9 +22,10 @@ CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag"); CatVar serverlag_amount( CV_INT, "serverlag", "0", "serverlag", "Lag the server by spamming this many voicecommands per tick"); -CatVar serverlag_string(CV_STRING, "serverlag_string", "voicemenu 0 0", "serverlag string", "String to spam with serverlag"); +CatVar serverlag_string(CV_STRING, "serverlag_string", "voicemenu 0 0", + "serverlag string", "String to spam with serverlag"); CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", - "Crash servers by spamming signon net messages"); + "Crash servers by spamming signon net messages"); CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto"); bool *bSendPackets; @@ -35,4 +36,8 @@ CatVar crypt_chat( int spectator_target; CLC_VoiceData *voicecrash{}; Timer DelayTimer{}; -CatVar delay(CV_INT, "delay", "0", "Delay", "Delay actions like chat spam and serverlag/crash by this many seconds."); +CatVar delay( + CV_INT, "delay", "0", "Delay", + "Delay actions like chat spam and serverlag/crash by this many seconds."); +CatVar adjust(CV_SWITCH, "serverlag_ramp", "0", "Ramp lag", + "increase lag while packet loss is below 80%"); diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index e38316b8..5243519d 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -33,6 +33,8 @@ static CatVar aimkey_mode(aimkey_modes_enum, "aimbot_aimkey_mode", "1", static CatVar autoshoot(CV_SWITCH, "aimbot_autoshoot", "1", "Autoshoot", "Shoot automatically when the target is locked, isn't " "compatible with 'Enable when attacking'"); +static CatVar multipoint(CV_SWITCH, "aimbot_multipoint", "1", "Multipoint", + "Multipoint aimbot"); static CatEnum hitbox_mode_enum({ "AUTO", "AUTO-CLOSEST", "STATIC" }); static CatVar hitbox_mode(hitbox_mode_enum, "aimbot_hitboxmode", "0", "Hitbox Mode", "Defines hitbox selection mode"); @@ -690,6 +692,55 @@ void Aim(CachedEntity *entity) // Get angles Vector tr = (PredictEntity(entity) - g_pLocalPlayer->v_Eye); + + // Multipoint + if (multipoint && !projectile_mode) + { + // Get hitbox num + AimbotCalculatedData_s &cd = calculated_data_array[entity->m_IDX]; + float minx, maxx, miny, maxy, minz, maxz, centerx, centery, centerz; + auto hitbox = entity->hitboxes.GetHitbox(cd.hitbox); + + // get positions + minx = hitbox->min.x; + miny = hitbox->min.y; + maxx = hitbox->max.x; + maxy = hitbox->max.y; + minz = hitbox->min.z; + maxz = hitbox->max.z; + centerx = hitbox->center.x; + centery = hitbox->center.y; + centerz = hitbox->center.z; + + // Shrink positions + std::vector positions; + minx += (maxx - minx) / 6; + maxx -= (maxx - minx) / 6; + maxy -= (maxy - miny) / 6; + miny += (maxy - miny) / 6; + maxz -= (maxz - minz) / 6; + minz += (maxz - minz) / 6; + // Create Vectors + positions.push_back({minx, centery, minz}); + positions.push_back({maxx, centery, minz}); + positions.push_back({minx, centery, maxz}); + positions.push_back({maxx, centery, maxz}); + positions.push_back({centerx, miny, minz}); + positions.push_back({centerx, maxy, minz}); + positions.push_back({centerx, miny, maxz}); + positions.push_back({centerx, maxy, maxz}); + positions.push_back({minx, miny, centerz}); + positions.push_back({maxx, maxy, centerz}); + positions.push_back({minx, miny, centerz}); + positions.push_back({maxx, maxy, centerz}); + positions.push_back(hitbox->center); + for (auto pos : positions) + if (IsVectorVisible(g_pLocalPlayer->v_Eye, pos)) + { + tr = (pos - g_pLocalPlayer->v_Eye); + break; + } + } Vector angles; VectorAngles(tr, angles); // Clamping is important diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index bd67342b..49627abe 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -92,8 +92,8 @@ void WorldTick() player_info_s info; g_IEngine->GetPlayerInfo(entity->m_IDX, &info); unsigned int xd = info.friendsID; - int xdd = xd; - if ((int)follow_steam != xdd) // steamid check + int xdd = xd; + if ((int) follow_steam != xdd) // steamid check continue; if (!entity->m_bAlivePlayer) // Dont follow dead players continue; @@ -157,10 +157,10 @@ void WorldTick() CachedEntity *followtar = ENTITY(follow_target); // wtf is this needed if (CE_BAD(followtar)) - return; - auto tar_orig = followtar->m_vecOrigin; - auto loc_orig = LOCAL_E->m_vecOrigin; - auto dist_to_target = loc_orig.DistTo(tar_orig); + return; + auto tar_orig = followtar->m_vecOrigin; + auto loc_orig = LOCAL_E->m_vecOrigin; + auto dist_to_target = loc_orig.DistTo(tar_orig); if (dist_to_target < 30) breadcrumbs.clear(); diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index f387d5ef..8749a51c 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -270,8 +270,8 @@ bool FormatSpamMessage(std::string &message) void CreateMove() { - if (!DelayTimer.check((int)delay * 1000)) - return; + if (!DelayTimer.check((int) delay * 1000)) + return; IF_GAME(IsTF2()) { // Spam changes the tournament name in casual and compeditive gamemodes diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index ed00b1cc..b4b48089 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -481,22 +481,29 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); senddata.SetNetChannel(ch); senddata.SetReliable(false); - if (servercrash && DelayTimer.check((int)delay * 1000)) { - for (int i = 0; i < 7800; i+= sizeof(serverlag_string.GetString())) + if (servercrash && DelayTimer.check((int) delay * 1000)) + { + for (int i = 0; i < 7800; i += sizeof(serverlag_string.GetString())) ch->SendNetMsg(senddata); ch->Transmit(); } if (serverlag_amount || votelogger::antikick_ticks) { + float latency = + g_IEngine->GetNetChannelInfo()->GetAvgPackets(FLOW_INCOMING); + logging::Info("%f", latency); + if (latency > 200 && adjust) + serverlag_amount = (int) serverlag_amount + 1; if (votelogger::antikick_ticks) votelogger::antikick_ticks--; if (votelogger::antikick_ticks) { - for (int i = 0; i < 7800; i+= sizeof(serverlag_string.GetString())) + for (int i = 0; i < 7800; i += sizeof(serverlag_string.GetString())) ch->SendNetMsg(senddata, false); ch->Transmit(); } - else if (!votelogger::antikick_ticks && DelayTimer.check((int)delay * 1000)) + else if (!votelogger::antikick_ticks && + DelayTimer.check((int) delay * 1000)) { for (int i = 0; i < (int) serverlag_amount; i++) ch->SendNetMsg(senddata, false); diff --git a/src/hooks/LevelInit.cpp b/src/hooks/LevelInit.cpp index d5bd6f73..8104d245 100644 --- a/src/hooks/LevelInit.cpp +++ b/src/hooks/LevelInit.cpp @@ -81,7 +81,7 @@ namespace hooked_methods DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) { - DelayTimer.update(); + DelayTimer.update(); playerlist::Save(); votelogger::antikick_ticks = 0; hacks::shared::lagexploit::bcalled = false; diff --git a/src/sdk/netmessage.cpp b/src/sdk/netmessage.cpp index fd93d96f..aa3e1640 100644 --- a/src/sdk/netmessage.cpp +++ b/src/sdk/netmessage.cpp @@ -435,6 +435,39 @@ bool CLC_VoiceData::ReadFromBuffer(bf_read &buffer) return buffer.SeekRelative(m_nLength); } +#define NUM_NEW_COMMAND_BITS 4 +#define MAX_NEW_COMMANDS ((1 << NUM_NEW_COMMAND_BITS) - 1) +#define Bits2Bytes(b) ((b + 7) >> 3) +#define NUM_BACKUP_COMMAND_BITS 3 +#define MAX_BACKUP_COMMANDS ((1 << NUM_BACKUP_COMMAND_BITS) - 1) +const char *CLC_Move::ToString(void) const +{ + return strfmt("%s: backup %i, new %i, bytes %i", GetName(), m_nNewCommands, + m_nBackupCommands, Bits2Bytes(m_nLength)); +} + +bool CLC_Move::WriteToBuffer(bf_write &buffer) +{ + buffer.WriteUBitLong(GetType(), NETMSG_TYPE_BITS); + m_nLength = m_DataOut.GetNumBitsWritten(); + + buffer.WriteUBitLong(m_nNewCommands, NUM_NEW_COMMAND_BITS); + buffer.WriteUBitLong(m_nBackupCommands, NUM_BACKUP_COMMAND_BITS); + + buffer.WriteWord(m_nLength); + + return buffer.WriteBits(m_DataOut.GetData(), m_nLength); +} + +bool CLC_Move::ReadFromBuffer(bf_read &buffer) +{ + + m_nNewCommands = buffer.ReadUBitLong(NUM_NEW_COMMAND_BITS); + m_nBackupCommands = buffer.ReadUBitLong(NUM_BACKUP_COMMAND_BITS); + m_nLength = buffer.ReadWord(); + m_DataIn = buffer; + return buffer.SeekRelative(m_nLength); +} bool NET_SetConVar::WriteToBuffer(bf_write &buffer) {