clang
This commit is contained in:
parent
00ccda80bf
commit
c1f92946c8
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
@ -28,12 +28,13 @@ bool IsProjectile(CachedEntity *ent)
|
|||||||
}
|
}
|
||||||
void CreateMove()
|
void CreateMove()
|
||||||
{
|
{
|
||||||
if (CE_BAD(LOCAL_E))
|
if (CE_BAD(LOCAL_E))
|
||||||
return;
|
return;
|
||||||
if (!HasWeapon(LOCAL_E, 59) || CE_INT(LOCAL_E, netvar.m_bFeignDeathReady) == 1)
|
if (!HasWeapon(LOCAL_E, 59) ||
|
||||||
return;
|
CE_INT(LOCAL_E, netvar.m_bFeignDeathReady) == 1)
|
||||||
if (CE_INT(LOCAL_E, netvar.iHealth) < 30)
|
return;
|
||||||
g_pUserCmd->buttons |= IN_ATTACK2;
|
if (CE_INT(LOCAL_E, netvar.iHealth) < 30)
|
||||||
|
g_pUserCmd->buttons |= IN_ATTACK2;
|
||||||
for (int i = 0; i < HIGHEST_ENTITY; i++)
|
for (int i = 0; i < HIGHEST_ENTITY; i++)
|
||||||
{
|
{
|
||||||
CachedEntity *ent = ENTITY(i);
|
CachedEntity *ent = ENTITY(i);
|
||||||
|
@ -503,21 +503,22 @@ void CreateMove()
|
|||||||
static int bSwitch = 0;
|
static int bSwitch = 0;
|
||||||
if ((g_pUserCmd->buttons & IN_ATTACK) && !bSwitch)
|
if ((g_pUserCmd->buttons & IN_ATTACK) && !bSwitch)
|
||||||
{
|
{
|
||||||
static int bswitch2 = 0;
|
static int bswitch2 = 0;
|
||||||
if (bswitch2 > 20) {
|
if (bswitch2 > 20)
|
||||||
announcer::playsound("piss.wav");
|
{
|
||||||
bswitch2 = 0;
|
announcer::playsound("piss.wav");
|
||||||
}
|
bswitch2 = 0;
|
||||||
bswitch2++;
|
}
|
||||||
|
bswitch2++;
|
||||||
bSwitch++;
|
bSwitch++;
|
||||||
g_pUserCmd->buttons &= ~IN_ATTACK;
|
g_pUserCmd->buttons &= ~IN_ATTACK;
|
||||||
}
|
}
|
||||||
else if (bSwitch)
|
else if (bSwitch)
|
||||||
{
|
{
|
||||||
amount = 21 * 66;
|
amount = 21 * 66;
|
||||||
bSwitch++;
|
bSwitch++;
|
||||||
if (bSwitch > 20)
|
if (bSwitch > 20)
|
||||||
bSwitch = 0;
|
bSwitch = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
30
src/hacks/Misc.cpp
Executable file → Normal file
30
src/hacks/Misc.cpp
Executable file → Normal file
@ -488,20 +488,23 @@ void Schema_Reload()
|
|||||||
{
|
{
|
||||||
logging::Info("Custom schema loading is not supported right now.");
|
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 ? ? ? ?");
|
static uintptr_t InitSchema_s = gSignatures.GetClientSignature(
|
||||||
typedef bool(*InitSchema_t)(void*, CUtlBuffer &, int);
|
"55 89 E5 57 56 53 83 EC ? 8B 5D ? 8B 7D ? 8B 03 89 1C 24 FF 50 ? C7 "
|
||||||
static InitSchema_t InitSchema =
|
"04 24 ? ? ? ?");
|
||||||
(InitSchema_t)InitSchema_s; static uintptr_t GetItemSchema_s =
|
typedef bool (*InitSchema_t)(void *, CUtlBuffer &, int);
|
||||||
gSignatures.GetClientSignature("55 89 E5 83 EC ? E8 ? ? ? ? C9 83 C0 ? C3 55 89 E5 8B 45 ?");
|
static InitSchema_t InitSchema = (InitSchema_t) InitSchema_s;
|
||||||
typedef void*(*GetItemSchema_t)(void);
|
static uintptr_t GetItemSchema_s = gSignatures.GetClientSignature(
|
||||||
static GetItemSchema_t GetItemSchema = (GetItemSchema_t)GetItemSchema_s; //(*(uintptr_t*)GetItemSchema_s +GetItemSchema_s + 4);
|
"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);
|
logging::Info("0x%08x 0x%08x", InitSchema, GetItemSchema);
|
||||||
void* itemschema = (void*)((unsigned)GetItemSchema() + 4);
|
void *itemschema = (void *) ((unsigned) GetItemSchema() + 4);
|
||||||
void* data;
|
void *data;
|
||||||
char* path = strfmt("/opt/cathook/data/items_game.txt");
|
char *path = strfmt("/opt/cathook/data/items_game.txt");
|
||||||
FILE* file = fopen(path, "r");
|
FILE *file = fopen(path, "r");
|
||||||
delete [] path;
|
delete[] path;
|
||||||
fseek(file, 0L, SEEK_END);
|
fseek(file, 0L, SEEK_END);
|
||||||
char buffer[5 * 1000 * 1000];
|
char buffer[5 * 1000 * 1000];
|
||||||
size_t len = ftell(file);
|
size_t len = ftell(file);
|
||||||
@ -510,7 +513,8 @@ void Schema_Reload()
|
|||||||
fread(&buffer, sizeof(char), len, file);
|
fread(&buffer, sizeof(char), len, file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
CUtlBuffer buf(&buffer, 5 * 1000 * 1000, 9);
|
CUtlBuffer buf(&buffer, 5 * 1000 * 1000, 9);
|
||||||
if (ferror(file) != 0) {
|
if (ferror(file) != 0)
|
||||||
|
{
|
||||||
logging::Info("Error loading file");
|
logging::Info("Error loading file");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
53
src/hacks/Walkbot.cpp
Executable file → Normal file
53
src/hacks/Walkbot.cpp
Executable file → Normal file
@ -1210,35 +1210,36 @@ void Move()
|
|||||||
if (ent->m_iTeam == LOCAL_E->m_iTeam)
|
if (ent->m_iTeam == LOCAL_E->m_iTeam)
|
||||||
continue;
|
continue;
|
||||||
const model_t *model = RAW_ENT(ent)->GetModel();
|
const model_t *model = RAW_ENT(ent)->GetModel();
|
||||||
if (model) {
|
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))
|
|
||||||
{
|
{
|
||||||
index_t node = CreateNode(ent->m_vecOrigin);
|
if ((model == lagexploit::point2 ||
|
||||||
auto &n = state::nodes[node];
|
model == lagexploit::point3 ||
|
||||||
if (g_pUserCmd->buttons & IN_DUCK)
|
model == lagexploit::point4 ||
|
||||||
n.flags |= NF_DUCK;
|
model == lagexploit::point5) &&
|
||||||
if (g_pUserCmd->buttons & IN_JUMP)
|
ent->m_flDistance < 400.0f &&
|
||||||
n.flags |= NF_JUMP;
|
IsVectorVisible(g_pLocalPlayer->v_Eye,
|
||||||
if (state::node_good(state::active_node))
|
ent->m_vecOrigin))
|
||||||
{
|
{
|
||||||
auto &c = state::nodes[state::active_node];
|
index_t node = CreateNode(ent->m_vecOrigin);
|
||||||
n.link(state::active_node);
|
auto &n = state::nodes[node];
|
||||||
c.link(node);
|
if (g_pUserCmd->buttons & IN_DUCK)
|
||||||
logging::Info("[wb] Node %u auto-linked to "
|
n.flags |= NF_DUCK;
|
||||||
"node %u at (%.2f %.2f %.2f)",
|
if (g_pUserCmd->buttons & IN_JUMP)
|
||||||
node, state::active_node, c.x,
|
n.flags |= NF_JUMP;
|
||||||
c.y, c.z);
|
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 &&
|
else if (ent->m_flDistance < 500.0f &&
|
||||||
IsVectorVisible(g_pLocalPlayer->v_Eye,
|
IsVectorVisible(g_pLocalPlayer->v_Eye,
|
||||||
|
10
src/hacks/ac/aimbot.cpp
Executable file → Normal file
10
src/hacks/ac/aimbot.cpp
Executable file → Normal file
@ -47,12 +47,12 @@ void Update(CachedEntity *player)
|
|||||||
data.check_timer--;
|
data.check_timer--;
|
||||||
if (!data.check_timer)
|
if (!data.check_timer)
|
||||||
{
|
{
|
||||||
auto &angles = angles::data(player);
|
auto &angles = angles::data(player);
|
||||||
float deviation = angles.deviation(2);
|
float deviation = angles.deviation(2);
|
||||||
int widx = CE_INT(player, netvar.hActiveWeapon) & 0xFFF;
|
int widx = CE_INT(player, netvar.hActiveWeapon) & 0xFFF;
|
||||||
CachedEntity* wep = ENTITY(widx);
|
CachedEntity *wep = ENTITY(widx);
|
||||||
if (!CE_GOOD(wep))
|
if (!CE_GOOD(wep))
|
||||||
return;
|
return;
|
||||||
if (deviation > float(detect_angle) &&
|
if (deviation > float(detect_angle) &&
|
||||||
wep->m_iClassID != CL_CLASS(CTFFlameThrower))
|
wep->m_iClassID != CL_CLASS(CTFFlameThrower))
|
||||||
{
|
{
|
||||||
|
@ -358,7 +358,7 @@ bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd)
|
|||||||
hacks::tf2::noisemaker::CreateMove();
|
hacks::tf2::noisemaker::CreateMove();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
PROF_SECTION(CM_deadringer);
|
PROF_SECTION(CM_deadringer);
|
||||||
hacks::shared::deadringer::CreateMove();
|
hacks::shared::deadringer::CreateMove();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -1026,7 +1026,10 @@ void LevelInit_hook(void *_this, const char *newmap)
|
|||||||
static LoadNamedSkys_Fn LoadNamedSkys = LoadNamedSkys_Fn(addr);
|
static LoadNamedSkys_Fn LoadNamedSkys = LoadNamedSkys_Fn(addr);
|
||||||
bool succ;
|
bool succ;
|
||||||
#ifdef __clang__
|
#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
|
#else
|
||||||
succ = LoadNamedSkys(skynum[(int) skybox_changer]);
|
succ = LoadNamedSkys(skynum[(int) skybox_changer]);
|
||||||
#endif
|
#endif
|
||||||
|
8
src/netvars.cpp
Executable file → Normal file
8
src/netvars.cpp
Executable file → Normal file
@ -28,10 +28,10 @@ void NetVars::Init()
|
|||||||
this->movetype = gNetvars.get_offset("DT_BaseEntity", "movetype");
|
this->movetype = gNetvars.get_offset("DT_BaseEntity", "movetype");
|
||||||
this->m_iAmmo =
|
this->m_iAmmo =
|
||||||
gNetvars.get_offset("DT_BasePlayer", "localdata", "m_iAmmo");
|
gNetvars.get_offset("DT_BasePlayer", "localdata", "m_iAmmo");
|
||||||
this->m_iPrimaryAmmoType =
|
this->m_iPrimaryAmmoType = gNetvars.get_offset(
|
||||||
gNetvars.get_offset("DT_LocalWeaponData", "localdata", "m_iPrimaryAmmoType");
|
"DT_LocalWeaponData", "localdata", "m_iPrimaryAmmoType");
|
||||||
this->m_iSecondaryAmmoType =
|
this->m_iSecondaryAmmoType = gNetvars.get_offset(
|
||||||
gNetvars.get_offset("DT_LocalWeaponData", "localdata", "m_iSecondaryAmmoType");
|
"DT_LocalWeaponData", "localdata", "m_iSecondaryAmmoType");
|
||||||
this->m_iClip1 = gNetvars.get_offset("DT_BaseCombatWeapon",
|
this->m_iClip1 = gNetvars.get_offset("DT_BaseCombatWeapon",
|
||||||
"LocalWeaponData", "m_iClip1");
|
"LocalWeaponData", "m_iClip1");
|
||||||
this->m_iClip2 = gNetvars.get_offset("DT_BaseCombatWeapon",
|
this->m_iClip2 = gNetvars.get_offset("DT_BaseCombatWeapon",
|
||||||
|
Reference in New Issue
Block a user