Merge pull request #434 from BenCat07/master

Multipointing
This commit is contained in:
LightCat 2018-05-12 18:36:15 +02:00 committed by GitHub
commit 4b9958d338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 147 additions and 17 deletions

3
attach
View File

@ -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
sudo killall -18 steam

View File

@ -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

View File

@ -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;

4
include/core/offsets.hpp Executable file → Normal file
View File

@ -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);

View File

@ -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);

View File

@ -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%");

View File

@ -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<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

View File

@ -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();

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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)
{