optional intersection testing. mindamage is next

This commit is contained in:
explorer 2024-10-08 04:41:25 +03:00
parent 932f00bf0e
commit c068afb171
20 changed files with 409 additions and 22 deletions

View File

@ -0,0 +1,6 @@
#pragma once
namespace Byte_Manager
{
#include "Byte_Manager_Functions.hpp"
};

View File

@ -0,0 +1,22 @@
#pragma once
#ifdef Bits_32
void Copy_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int32 Bytes_Amount, void* Bytes)
#else
void Copy_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int64 Bytes_Amount, void* Bytes)
#endif
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
}
__builtin_memcpy(Starting_Location, Bytes, Bytes_Amount);
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, Previous_Access_Rights, &Previous_Access_Rights);
}
}

View File

@ -0,0 +1,24 @@
#pragma once
#ifdef Bits_32
void* Find_Bytes(void* Starting_Location, void* Bytes, unsigned __int32 Bytes_Amount)
#else
void* Find_Bytes(void* Starting_Location, void* Bytes, unsigned __int64 Bytes_Amount)
#endif
{
Compare_Bytes_Label:
{
if (__builtin_memcmp(Starting_Location, Bytes, Bytes_Amount) == 0)
{
return Starting_Location;
}
#ifdef Bits_32
Starting_Location = (void*)((unsigned __int32)Starting_Location + 1);
#else
Starting_Location = (void*)((unsigned __int64)Starting_Location + 1);
#endif
goto Compare_Bytes_Label;
}
}

View File

@ -0,0 +1,7 @@
#pragma once
#include "Byte_Manager_Find_Bytes.hpp"
#include "Byte_Manager_Set_Bytes.hpp"
#include "Byte_Manager_Copy_Bytes.hpp"

View File

@ -0,0 +1,22 @@
#pragma once
#ifdef Bits_32
void Set_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int32 Bytes_Amount, unsigned __int8 Byte)
#else
void Set_Bytes(__int8 Modify_Access_Rights, void* Starting_Location, unsigned __int64 Bytes_Amount, unsigned __int8 Byte)
#endif
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
}
__builtin_memset(Starting_Location, Byte, Bytes_Amount);
if (Modify_Access_Rights == 1)
{
VirtualProtect(Starting_Location, Bytes_Amount, Previous_Access_Rights, &Previous_Access_Rights);
}
}

View File

@ -59,10 +59,6 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
if (*(__int8*)((unsigned __int32)Local_Player + 327) == 0)
{
using Run_Prediction_Type = void(__cdecl*)();
Run_Prediction_Type((unsigned __int32)Engine_Module + 527776)();
float Move_Angles[3] =
{
Command->Angles[0],
@ -201,9 +197,9 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
{
if ((*(float*)((unsigned __int32)Local_Player + 4604) + 800 * Global_Variables->Interval_Per_Tick >= 560) + (*(__int8*)((unsigned __int32)Local_Player + 8068) + *(__int8*)((unsigned __int32)Local_Player + 9708)) != 0)
{
Sequence_Shift(2);
Command->Buttons &= ~10241;
Run_Prediction_Type((unsigned __int32)Engine_Module + 527776)();
Sequence_Shift(2);
}
else
{

View File

@ -23,6 +23,8 @@ Interface_Structure Interface_Riot_Deprioritize;
Interface_Structure Interface_Penetrate_Teammates;
Interface_Structure Interface_Aim_Intersection;
Interface_Structure Interface_Equipment_Distance;
Interface_Structure Interface_Storm_Rotation_Radius;
@ -60,6 +62,8 @@ void Implement_Extended_Interface()
Create_Console_Interface(Pointer_Name(Interface_Penetrate_Teammates), (char*)"0", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Aim_Intersection), (char*)"1", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Equipment_Distance), (char*)"2048", nullptr);
Create_Console_Interface(Pointer_Name(Interface_Storm_Rotation_Radius), (char*)"24", nullptr);

View File

@ -4,28 +4,13 @@ __int32 Extra_Commands;
void Redirected_Move(float Unknown_Parameter, __int8 Final)
{
using Run_Prediction_Type = void(__cdecl*)();
if (*(void**)((unsigned __int32)Client_Module + 7498712) != nullptr)
{
Redirected_Read_Packets(Final);
using Fire_Events_Type = void(__cdecl*)();
Fire_Events_Type((unsigned __int32)Engine_Module + 521648)();
}
Extra_Commands = -1;
Move_Label:
{
(decltype(&Redirected_Move)(Original_Move_Caller))(Unknown_Parameter, Final);
if (Extra_Commands > 0)
{
Extra_Commands -= 1;
goto Move_Label;
}
}
Run_Prediction_Type((unsigned __int32)Engine_Module + 527776)();
using Update_Animations_Type = void(__cdecl*)();
@ -38,4 +23,25 @@ void Redirected_Move(float Unknown_Parameter, __int8 Final)
Update_Animations_Type((unsigned __int32)Client_Module + 205296)();
Update_Animation_Type = 0;
using Fire_Events_Type = void(__cdecl*)();
Fire_Events_Type((unsigned __int32)Engine_Module + 521648)();
}
Extra_Commands = -1;
Move_Label:
{
(decltype(&Redirected_Move)(Original_Move_Caller))(Unknown_Parameter, Final);
Run_Prediction_Type((unsigned __int32)Engine_Module + 527776)();
if (Extra_Commands > 0)
{
Extra_Commands -= 1;
goto Move_Label;
}
}
}

View File

@ -26,16 +26,24 @@ void __thiscall Perform_Trace(void* Stack)
if (*(__int32*)((unsigned __int32)Entity + 228) == *(__int32*)((unsigned __int32)Local_Player + 228))
{
Perform_Trace_Target = nullptr;
return;
}
}
}
if (Entity == (void*)((unsigned __int32)Perform_Trace_Target ^ 1))
{
if (Interface_Aim_Intersection.Integer == 0)
{
if (*(__int32*)((unsigned __int32)Stack + 304) != 1)
{
return;
}
}
void* Trace_Information = *(void**)((unsigned __int32)Stack + 36);
if ((*(__int32*)((unsigned int)Trace_Information + 36) & 255) + *(__int32*)((unsigned __int32)Entity + 52) == 17)
if ((*(__int32*)((unsigned __int32)Trace_Information + 36) & 255) + *(__int32*)((unsigned __int32)Entity + 52) == 17)
{
float Inflictor_Direction[3];

View File

@ -14,7 +14,7 @@ void __thiscall Redirected_Process_Movement(void* Unknown_Parameter, void* Playe
if (*(__int8*)((unsigned __int32)Player + 4636) == 1)
{
*(__int32*)((unsigned __int32)Move_Data + 36) |= 4u;
*(__int32*)((unsigned __int32)Move_Data + 36) |= 4;
}
*(float*)((unsigned __int32)Move_Data + 44) = 0;

View File

@ -1,4 +1,4 @@
to achieve least interpolation time `cl_updaterate -1;cl_interp_ratio 0;cl_interp 0`
to achieve least interpolation time: `cl_updaterate -1;cl_interp_ratio 0;cl_interp 0`
```
code: https://github.com/qwertyuiop3/Storm

View File

@ -0,0 +1,6 @@
#pragma once
namespace Redirection_Manager
{
#include "Redirection_Manager_Functions.hpp"
};

View File

@ -0,0 +1,30 @@
#pragma once
void* Copy_Table(void* Table_Location)
{
#ifdef Bits_32
unsigned __int32 Functions_Count = 0;
#else
unsigned __int64 Functions_Count = 0;
#endif
Take_Function_Into_Account_Label:
{
#ifdef Bits_32
if (*(void**)((unsigned __int32)Table_Location + Functions_Count) != nullptr)
#else
if (*(void**)((unsigned __int64)Table_Location + Functions_Count) != nullptr)
#endif
{
Functions_Count += sizeof(void*);
goto Take_Function_Into_Account_Label;
}
}
void* Copied_Table_Location = malloc(Functions_Count);
__builtin_memcpy(Copied_Table_Location, Table_Location, Functions_Count);
return Copied_Table_Location;
}

View File

@ -0,0 +1,15 @@
#pragma once
#include "Redirection_Manager_Redirect_Function.hpp"
#include "Redirection_Manager_Restore_Function.hpp"
#include "Redirection_Manager_Restore_Redirection.hpp"
#include "Redirection_Manager_Copy_Table.hpp"
#include "Redirection_Manager_Redirect_Function_In_Table.hpp"
#include "Redirection_Manager_Redirect_Table.hpp"
#include "Redirection_Manager_Restore_Table.hpp"

View File

@ -0,0 +1,125 @@
#pragma once
void Redirect_Function(__int8 Modify_Access_Rights, void* Original_Function_Location, void* Redirected_Function_Location)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(__int8*)Original_Function_Location = 104;
*(void**)((unsigned __int32)Original_Function_Location + 1) = Redirected_Function_Location;
*(unsigned __int8*)((unsigned __int32)Original_Function_Location + 5) = 195;
#else
*(__int8*)Original_Function_Location = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Location + 1) = 47176;
*(void**)((unsigned __int64)Original_Function_Location + 3) = Redirected_Function_Location;
*(__int32*)((unsigned __int64)Original_Function_Location + 11) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Location + 15) = 195;
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
}
#ifdef Bits_32
void Redirect_Function(void*& Original_Function_Caller_Location, unsigned __int32 Original_Function_Caller_Offset, void* Original_Function_Location, __int8 Modify_Access_Rights, void* Redirected_Function_Location)
#else
void Redirect_Function(void*& Original_Function_Caller_Location, unsigned __int64 Original_Function_Caller_Offset, void* Original_Function_Location, __int8 Modify_Access_Rights, void* Redirected_Function_Location)
#endif
{
unsigned long __int32 Previous_Access_Rights;
#ifdef Bits_32
Original_Function_Caller_Location = malloc(12 + Original_Function_Caller_Offset);
*(void**)Original_Function_Caller_Location = *(void**)Original_Function_Location;
*(unsigned __int16*)((unsigned __int32)Original_Function_Caller_Location + 4) = *(unsigned __int16*)((unsigned __int32)Original_Function_Location + 4);
__builtin_memcpy((void*)((unsigned __int32)Original_Function_Caller_Location + 6), (void*)((unsigned __int32)Original_Function_Location + 6), Original_Function_Caller_Offset);
*(__int8*)((unsigned __int32)Original_Function_Caller_Location + 6 + Original_Function_Caller_Offset) = 104;
*(void**)((unsigned __int32)Original_Function_Caller_Location + 7 + Original_Function_Caller_Offset) = (void*)((unsigned __int32)Original_Function_Location + 6 + Original_Function_Caller_Offset);
*(unsigned __int8*)((unsigned __int32)Original_Function_Caller_Location + 11 + Original_Function_Caller_Offset) = 195;
VirtualProtect(Original_Function_Caller_Location, 12 + Original_Function_Caller_Offset, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
Original_Function_Caller_Location = malloc(32 + Original_Function_Caller_Offset);
*(void**)Original_Function_Caller_Location = *(void**)Original_Function_Location;
*(void**)((unsigned __int64)Original_Function_Caller_Location + 8) = *(void**)((unsigned __int64)Original_Function_Location + 8);
__builtin_memcpy((void*)((unsigned __int64)Original_Function_Caller_Location + 16), (void*)((unsigned __int64)Original_Function_Location + 16), Original_Function_Caller_Offset);
*(__int8*)((unsigned __int64)Original_Function_Caller_Location + 16 + Original_Function_Caller_Offset) = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Caller_Location + 17 + Original_Function_Caller_Offset) = 47176;
*(void**)((unsigned __int64)Original_Function_Caller_Location + 19 + Original_Function_Caller_Offset) = (void*)((unsigned __int64)Original_Function_Location + 16 + Original_Function_Caller_Offset);
*(__int32*)((unsigned __int64)Original_Function_Caller_Location + 27 + Original_Function_Caller_Offset) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Caller_Location + 31 + Original_Function_Caller_Offset) = 195;
VirtualProtect(Original_Function_Caller_Location, 32 + Original_Function_Caller_Offset, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(__int8*)Original_Function_Location = 104;
*(void**)((unsigned __int32)Original_Function_Location + 1) = Redirected_Function_Location;
*(unsigned __int8*)((unsigned __int32)Original_Function_Location + 5) = 195;
#else
*(__int8*)Original_Function_Location = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Location + 1) = 47176;
*(void**)((unsigned __int64)Original_Function_Location + 3) = Redirected_Function_Location;
*(__int32*)((unsigned __int64)Original_Function_Location + 11) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Location + 15) = 195;
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
}

View File

@ -0,0 +1,18 @@
#pragma once
void Redirect_Function_In_Table(__int8 Modify_Access_Rights, void* Original_Function_In_Table_Location, void* Redirected_Function_Location)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Original_Function_In_Table_Location, sizeof(void*), PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
}
*(void**)Original_Function_In_Table_Location = Redirected_Function_Location;
if (Modify_Access_Rights == 1)
{
VirtualProtect(Original_Function_In_Table_Location, sizeof(void*), Previous_Access_Rights, &Previous_Access_Rights);
}
}

View File

@ -0,0 +1,6 @@
#pragma once
void Redirect_Table(void* Original_Table_Container_Location, void* Redirected_Table_Location)
{
*(void**)Original_Table_Container_Location = Redirected_Table_Location;
}

View File

@ -0,0 +1,39 @@
#pragma once
void Restore_Function(__int8 Modify_Access_Rights, void* Original_Function_Location, void* Original_Function_Caller_Location, __int8 Delete_Original_Function_Caller)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(void**)Original_Function_Location = *(void**)Original_Function_Caller_Location;
*(unsigned __int16*)((unsigned __int32)Original_Function_Location + 4) = *(unsigned __int16*)((unsigned __int32)Original_Function_Caller_Location + 4);
#else
*(void**)Original_Function_Location = *(void**)Original_Function_Caller_Location;
*(void**)((unsigned __int64)Original_Function_Location + 8) = *(void**)((unsigned __int64)Original_Function_Caller_Location + 8);
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
if (Delete_Original_Function_Caller == 1)
{
free(Original_Function_Caller_Location);
}
}

View File

@ -0,0 +1,42 @@
#pragma once
void Restore_Redirection(__int8 Modify_Access_Rights, void* Original_Function_Location, void* Redirected_Function_Location)
{
unsigned long __int32 Previous_Access_Rights;
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, PAGE_EXECUTE_READWRITE, &Previous_Access_Rights);
#endif
}
#ifdef Bits_32
*(__int8*)Original_Function_Location = 104;
*(void**)((unsigned __int32)Original_Function_Location + 1) = Redirected_Function_Location;
*(unsigned __int8*)((unsigned __int32)Original_Function_Location + 5) = 195;
#else
*(__int8*)Original_Function_Location = 80;
*(unsigned __int16*)((unsigned __int64)Original_Function_Location + 1) = 47176;
*(void**)((unsigned __int64)Original_Function_Location + 3) = Redirected_Function_Location;
*(__int32*)((unsigned __int64)Original_Function_Location + 11) = 604276552;
*(unsigned __int8*)((unsigned __int64)Original_Function_Location + 15) = 195;
#endif
if (Modify_Access_Rights == 1)
{
#ifdef Bits_32
VirtualProtect(Original_Function_Location, 6, Previous_Access_Rights, &Previous_Access_Rights);
#else
VirtualProtect(Original_Function_Location, 16, Previous_Access_Rights, &Previous_Access_Rights);
#endif
}
}

View File

@ -0,0 +1,11 @@
#pragma once
void Restore_Table(void* Original_Table_Container_Location, void* Original_Table_Location, __int8 Delete_Redirected_Table, void* Redirected_Table_Location)
{
*(void**)Original_Table_Container_Location = Original_Table_Location;
if (Delete_Redirected_Table == 1)
{
free(Redirected_Table_Location);
}
}