This commit is contained in:
BenCat07 2018-04-18 20:08:13 +02:00
parent 00ccda80bf
commit c1f92946c8
11 changed files with 1707 additions and 1665 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -28,12 +28,13 @@ bool IsProjectile(CachedEntity *ent)
}
void CreateMove()
{
if (CE_BAD(LOCAL_E))
return;
if (!HasWeapon(LOCAL_E, 59) || CE_INT(LOCAL_E, netvar.m_bFeignDeathReady) == 1)
return;
if (CE_INT(LOCAL_E, netvar.iHealth) < 30)
g_pUserCmd->buttons |= IN_ATTACK2;
if (CE_BAD(LOCAL_E))
return;
if (!HasWeapon(LOCAL_E, 59) ||
CE_INT(LOCAL_E, netvar.m_bFeignDeathReady) == 1)
return;
if (CE_INT(LOCAL_E, netvar.iHealth) < 30)
g_pUserCmd->buttons |= IN_ATTACK2;
for (int i = 0; i < HIGHEST_ENTITY; i++)
{
CachedEntity *ent = ENTITY(i);

View File

@ -503,21 +503,22 @@ void CreateMove()
static int bSwitch = 0;
if ((g_pUserCmd->buttons & IN_ATTACK) && !bSwitch)
{
static int bswitch2 = 0;
if (bswitch2 > 20) {
announcer::playsound("piss.wav");
bswitch2 = 0;
}
bswitch2++;
static int bswitch2 = 0;
if (bswitch2 > 20)
{
announcer::playsound("piss.wav");
bswitch2 = 0;
}
bswitch2++;
bSwitch++;
g_pUserCmd->buttons &= ~IN_ATTACK;
}
else if (bSwitch)
{
amount = 21 * 66;
amount = 21 * 66;
bSwitch++;
if (bSwitch > 20)
bSwitch = 0;
bSwitch = 0;
}
}
}

30
src/hacks/Misc.cpp Executable file → Normal file
View File

@ -488,20 +488,23 @@ void Schema_Reload()
{
logging::Info("Custom schema loading is not supported right now.");
static uintptr_t InitSchema_s = gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC ? 8B 5D ? 8B 7D ? 8B 03 89 1C 24 FF 50 ? C7 04 24 ? ? ? ?");
typedef bool(*InitSchema_t)(void*, CUtlBuffer &, int);
static InitSchema_t InitSchema =
(InitSchema_t)InitSchema_s; static uintptr_t GetItemSchema_s =
gSignatures.GetClientSignature("55 89 E5 83 EC ? E8 ? ? ? ? C9 83 C0 ? C3 55 89 E5 8B 45 ?");
typedef void*(*GetItemSchema_t)(void);
static GetItemSchema_t GetItemSchema = (GetItemSchema_t)GetItemSchema_s; //(*(uintptr_t*)GetItemSchema_s +GetItemSchema_s + 4);
static uintptr_t InitSchema_s = gSignatures.GetClientSignature(
"55 89 E5 57 56 53 83 EC ? 8B 5D ? 8B 7D ? 8B 03 89 1C 24 FF 50 ? C7 "
"04 24 ? ? ? ?");
typedef bool (*InitSchema_t)(void *, CUtlBuffer &, int);
static InitSchema_t InitSchema = (InitSchema_t) InitSchema_s;
static uintptr_t GetItemSchema_s = gSignatures.GetClientSignature(
"55 89 E5 83 EC ? E8 ? ? ? ? C9 83 C0 ? C3 55 89 E5 8B 45 ?");
typedef void *(*GetItemSchema_t)(void);
static GetItemSchema_t GetItemSchema = (GetItemSchema_t)
GetItemSchema_s; //(*(uintptr_t*)GetItemSchema_s +GetItemSchema_s + 4);
logging::Info("0x%08x 0x%08x", InitSchema, GetItemSchema);
void* itemschema = (void*)((unsigned)GetItemSchema() + 4);
void* data;
char* path = strfmt("/opt/cathook/data/items_game.txt");
FILE* file = fopen(path, "r");
delete [] path;
void *itemschema = (void *) ((unsigned) GetItemSchema() + 4);
void *data;
char *path = strfmt("/opt/cathook/data/items_game.txt");
FILE *file = fopen(path, "r");
delete[] path;
fseek(file, 0L, SEEK_END);
char buffer[5 * 1000 * 1000];
size_t len = ftell(file);
@ -510,7 +513,8 @@ void Schema_Reload()
fread(&buffer, sizeof(char), len, file);
fclose(file);
CUtlBuffer buf(&buffer, 5 * 1000 * 1000, 9);
if (ferror(file) != 0) {
if (ferror(file) != 0)
{
logging::Info("Error loading file");
return;
}

53
src/hacks/Walkbot.cpp Executable file → Normal file
View File

@ -1210,35 +1210,36 @@ void Move()
if (ent->m_iTeam == LOCAL_E->m_iTeam)
continue;
const model_t *model = RAW_ENT(ent)->GetModel();
if (model) {
if ((model == lagexploit::point2 ||
model == lagexploit::point3 ||
model == lagexploit::point4 ||
model == lagexploit::point5) &&
ent->m_flDistance < 400.0f &&
IsVectorVisible(g_pLocalPlayer->v_Eye,
ent->m_vecOrigin))
if (model)
{
index_t node = CreateNode(ent->m_vecOrigin);
auto &n = state::nodes[node];
if (g_pUserCmd->buttons & IN_DUCK)
n.flags |= NF_DUCK;
if (g_pUserCmd->buttons & IN_JUMP)
n.flags |= NF_JUMP;
if (state::node_good(state::active_node))
if ((model == lagexploit::point2 ||
model == lagexploit::point3 ||
model == lagexploit::point4 ||
model == lagexploit::point5) &&
ent->m_flDistance < 400.0f &&
IsVectorVisible(g_pLocalPlayer->v_Eye,
ent->m_vecOrigin))
{
auto &c = state::nodes[state::active_node];
n.link(state::active_node);
c.link(node);
logging::Info("[wb] Node %u auto-linked to "
"node %u at (%.2f %.2f %.2f)",
node, state::active_node, c.x,
c.y, c.z);
index_t node = CreateNode(ent->m_vecOrigin);
auto &n = state::nodes[node];
if (g_pUserCmd->buttons & IN_DUCK)
n.flags |= NF_DUCK;
if (g_pUserCmd->buttons & IN_JUMP)
n.flags |= NF_JUMP;
if (state::node_good(state::active_node))
{
auto &c = state::nodes[state::active_node];
n.link(state::active_node);
c.link(node);
logging::Info("[wb] Node %u auto-linked to "
"node %u at (%.2f %.2f %.2f)",
node, state::active_node, c.x,
c.y, c.z);
}
state::last_node_buttons = g_pUserCmd->buttons;
state::active_node = node;
ret = true;
}
state::last_node_buttons = g_pUserCmd->buttons;
state::active_node = node;
ret = true;
}
}
else if (ent->m_flDistance < 500.0f &&
IsVectorVisible(g_pLocalPlayer->v_Eye,

10
src/hacks/ac/aimbot.cpp Executable file → Normal file
View File

@ -47,12 +47,12 @@ void Update(CachedEntity *player)
data.check_timer--;
if (!data.check_timer)
{
auto &angles = angles::data(player);
float deviation = angles.deviation(2);
int widx = CE_INT(player, netvar.hActiveWeapon) & 0xFFF;
CachedEntity* wep = ENTITY(widx);
auto &angles = angles::data(player);
float deviation = angles.deviation(2);
int widx = CE_INT(player, netvar.hActiveWeapon) & 0xFFF;
CachedEntity *wep = ENTITY(widx);
if (!CE_GOOD(wep))
return;
return;
if (deviation > float(detect_angle) &&
wep->m_iClassID != CL_CLASS(CTFFlameThrower))
{

View File

@ -358,7 +358,7 @@ bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd)
hacks::tf2::noisemaker::CreateMove();
}
{
PROF_SECTION(CM_deadringer);
PROF_SECTION(CM_deadringer);
hacks::shared::deadringer::CreateMove();
}
{

View File

@ -1026,7 +1026,10 @@ void LevelInit_hook(void *_this, const char *newmap)
static LoadNamedSkys_Fn LoadNamedSkys = LoadNamedSkys_Fn(addr);
bool succ;
#ifdef __clang__
asm ("movl %1, %%edi; push skynum[(int) skybox_changer]; call %%edi; mov %%eax, %0; add %%esp, 4h" :"=r"(succ) :"r"(LoadNamedSkys));
asm("movl %1, %%edi; push skynum[(int) skybox_changer]; call %%edi; mov "
"%%eax, %0; add %%esp, 4h"
: "=r"(succ)
: "r"(LoadNamedSkys));
#else
succ = LoadNamedSkys(skynum[(int) skybox_changer]);
#endif

8
src/netvars.cpp Executable file → Normal file
View File

@ -28,10 +28,10 @@ void NetVars::Init()
this->movetype = gNetvars.get_offset("DT_BaseEntity", "movetype");
this->m_iAmmo =
gNetvars.get_offset("DT_BasePlayer", "localdata", "m_iAmmo");
this->m_iPrimaryAmmoType =
gNetvars.get_offset("DT_LocalWeaponData", "localdata", "m_iPrimaryAmmoType");
this->m_iSecondaryAmmoType =
gNetvars.get_offset("DT_LocalWeaponData", "localdata", "m_iSecondaryAmmoType");
this->m_iPrimaryAmmoType = gNetvars.get_offset(
"DT_LocalWeaponData", "localdata", "m_iPrimaryAmmoType");
this->m_iSecondaryAmmoType = gNetvars.get_offset(
"DT_LocalWeaponData", "localdata", "m_iSecondaryAmmoType");
this->m_iClip1 = gNetvars.get_offset("DT_BaseCombatWeapon",
"LocalWeaponData", "m_iClip1");
this->m_iClip2 = gNetvars.get_offset("DT_BaseCombatWeapon",