#паранойя
-
Автор темы
- #1
C++:
// todo - smart swngostab depending by health, lag gocmp, recreate getactwep, swngostab (if this worth it but then this becomes not simple)
#include <Windows.h>
void* Client_Module_Location;
void* Original_Copy_User_Command_Location;
void* Original_Copy_User_Command_Bytes_Backup_Location;
#include "Redirection_Manager.hpp"
struct Structure_User_Command
{
__int8 Add_Bytes[36];
int Buttons_State;
};
#include <future>
void* __fastcall Redirected_Copy_User_Command(void* ECX, void* EDX, Structure_User_Command* User_Command)
{
static void* Copy_User_Command_Create_Move_Return_Address = (void*)((unsigned long int)Client_Module_Location + 1338695);
if (*(void**)_AddressOfReturnAddress() == Copy_User_Command_Create_Move_Return_Address)
{
static void* Controlled_Creature_Container = (void*)((unsigned long int)Client_Module_Location + 5007112);
void* Controlled_Creature = *(void**)Controlled_Creature_Container;
using Get_Active_Weapon_Type = void*(__thiscall*)(void* Creature);
static void* Get_Active_Weapon_Location = (void*)((unsigned long int)Client_Module_Location + 661616);
static void* Knife_Table_Location = (void*)((unsigned long int)Client_Module_Location + 4105468);
void* Active_Weapon = Get_Active_Weapon_Type(Get_Active_Weapon_Location)(Controlled_Creature);
if (Active_Weapon != nullptr)
{
if (*(void**)Active_Weapon == Knife_Table_Location)
{
using Should_Swing_Or_Stab_Type = __int8(__thiscall*)(void* Knife, __int8 Should_Stab);
static void* Swing_Or_Stab_Location = (void*)((unsigned long int)Client_Module_Location + 2174544);
if (Should_Swing_Or_Stab_Type(Swing_Or_Stab_Location)(Active_Weapon, 1) == 1)
{
void* Creature_Table_Location = (void*)((unsigned long int)Client_Module_Location + 3943844);
void* Creature = *(void**)((unsigned long int)Active_Weapon + 2484);
if (*(void**)Creature == Creature_Table_Location)
{
if (*(int*)((unsigned long int)Creature + 156) != *(int*)((unsigned long int)Controlled_Creature + 156))
{
User_Command->Buttons_State |= 2048;
}
}
}
}
}
}
unsigned long int Previous_Access_Rights;
Redirection_Manager::Restore_Function(1, Original_Copy_User_Command_Location, Previous_Access_Rights, Original_Copy_User_Command_Bytes_Backup_Location, 0);
using Copy_User_Command_Type = void*(__thiscall*)(void* ECX, Structure_User_Command* User_Command);
void* Return_Value = Copy_User_Command_Type(Original_Copy_User_Command_Location)(ECX, User_Command);
Redirection_Manager::Restore_Redirection(Original_Copy_User_Command_Location, Redirected_Copy_User_Command, 1, Previous_Access_Rights);
return Return_Value;
}
int __stdcall DllMain(unsigned long int This_Module_Location, unsigned long int Call_Reason, void* Reserved_Parameter)
{
if (Call_Reason == DLL_PROCESS_ATTACH)
{
Client_Module_Location = GetModuleHandleW(L"client.dll");
Original_Copy_User_Command_Location = (void*)((unsigned long int)Client_Module_Location + 1171440);
Redirection_Manager::Redirect_Function(Original_Copy_User_Command_Bytes_Backup_Location, Original_Copy_User_Command_Location, 1, Redirected_Copy_User_Command);
}
return 1;
}
credits @TraitCore
Последнее редактирование: