Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Commit

Permalink
Merge pull request #130 from gingerchicken/master
Browse files Browse the repository at this point in the history
Update More Patterns
  • Loading branch information
Exlodium authored Dec 17, 2024
2 parents 3f0d475 + c1b4774 commit 1eb9c3f
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,7 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

# Live Update
enc_temp_folder
16 changes: 14 additions & 2 deletions cstrike/core/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ bool H::Setup()
L_PRINT(LOG_INFO) << CS_XOR("\"GetMatrixForView\" hook has been created");

// @ida: #STR: cl: CreateMove clamped invalid attack history index %d in frame history to -1. Was %d, frame history size %d.\n
if (!hkCreateMove.Create(MEM::GetVFunc(I::Input, VTABLE::CLIENT::CREATEMOVE), reinterpret_cast<void*>(&CreateMove)))
// Consider updating I::Input, VTABLE::CLIENT::CREATEMOVE and using that instead.

// For now, we'll use the pattern
// Credit: https://www.unknowncheats.me/forum/4265695-post6331.html
if (!hkCreateMove.Create(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 8B C4 4C 89 40 ? 48 89 48 ? 55 53 56 57 48 8D A8")), reinterpret_cast<void*>(&CreateMove)))
return false;
L_PRINT(LOG_INFO) << CS_XOR("\"CreateMove\" hook has been created");

Expand Down Expand Up @@ -124,7 +128,8 @@ bool H::Setup()

//L_PRINT(LOG_INFO) << CS_XOR("\"OverrideView\" hook has been created");

if (!hkDrawObject.Create(MEM::FindPattern(SCENESYSTEM_DLL, CS_XOR("48 8B C4 53 41 56 48 83 EC 38 4D 8B F0 48 8B DA 48 85 C9 0F 84 99 01 ? ?")), reinterpret_cast<void*>(&DrawObject)))
// Credit: https://www.unknowncheats.me/forum/4253223-post6185.html
if (!hkDrawObject.Create(MEM::FindPattern(SCENESYSTEM_DLL, CS_XOR("48 8B C4 48 89 50 ? 53")), reinterpret_cast<void*>(&DrawObject)))
return false;
L_PRINT(LOG_INFO) << CS_XOR("\"DrawObject\" hook has been created");

Expand Down Expand Up @@ -229,10 +234,17 @@ bool CS_FASTCALL H::CreateMove(CCSGOInput* pInput, int nSlot, CUserCmd* cmd)

F::OnCreateMove(SDK::Cmd, pBaseCmd, SDK::LocalController);

// TODO : We need to fix CRC saving
//
// There seems to be an issue within CBasePB and the classes that derive it.
// So far, you may be unable to press specific keys such as crouch and automatic shooting.
// A dodgy fix would be to comment it out but it still doesn't fix the bhop etc.

CRC::Save(pBaseCmd);
if (CRC::CalculateCRC(pBaseCmd) == true)
CRC::Apply(SDK::Cmd);


return bResult;
}

Expand Down
2 changes: 1 addition & 1 deletion cstrike/core/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace VTABLE
{
enum
{
CREATEMOVE = 21U,
CREATEMOVE = 21U, // Outdated (Using pattern for now)
MOUSEINPUTENABLED = 19U,
FRAMESTAGENOTIFY = 36U,
};
Expand Down
4 changes: 2 additions & 2 deletions cstrike/cstrike.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>false</LinkIncremental>
<LinkIncremental>true</LinkIncremental>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)intermediate\$(ProjectName)\$(Configuration)\</IntDir>
Expand All @@ -65,7 +65,7 @@
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NOMINMAX;_DEBUG;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dependencies;$(SolutionDir)dependencies\freetype\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<SupportJustMyCode>false</SupportJustMyCode>
<MinimalRebuild>false</MinimalRebuild>
Expand Down
2 changes: 1 addition & 1 deletion cstrike/features/visuals/chams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ bool F::VISUALS::CHAMS::OverrideMaterial(void* pAnimatableSceneObjectDesc, void*
const auto oDrawObject = H::hkDrawObject.GetOriginal();
const CustomMaterial_t customMaterial = arrMaterials[C_GET(int, Vars.nVisualChamMaterial)];

if (C_GET(bool, Vars.bVisualChamsIgnoreZ))
if (C_GET(bool, Vars.bVisualChamsIgnoreZ)) // Ignore Invisible
{
arrMeshDraw->pMaterial = customMaterial.pMaterialInvisible;
arrMeshDraw->colValue = C_GET(Color_t, Vars.colVisualChamsIgnoreZ);
Expand Down
3 changes: 2 additions & 1 deletion cstrike/sdk/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ class C_BasePlayerPawn : public C_BaseModelEntity
[[nodiscard]] Vector_t GetEyePosition()
{
Vector_t vecEyePosition = Vector_t(0.0f, 0.0f, 0.0f);
MEM::CallVFunc<void, 166U>(this, &vecEyePosition);
// Credit: https://www.unknowncheats.me/forum/4258133-post6228.html
MEM::CallVFunc<void, 169U>(this, &vecEyePosition);
return vecEyePosition;
}
};
Expand Down
3 changes: 2 additions & 1 deletion cstrike/sdk/interfaces/cgametracemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class CGameTraceManager
bool TraceShape(Ray_t* pRay, Vector_t vecStart, Vector_t vecEnd, TraceFilter_t* pFilter, GameTrace_t* pGameTrace)
{
using fnTraceShape = bool(__fastcall*)(CGameTraceManager*, Ray_t*, Vector_t*, Vector_t*, TraceFilter_t*, GameTrace_t*);
static fnTraceShape oTraceShape = reinterpret_cast<fnTraceShape>(MEM::GetAbsoluteAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("E8 ? ? ? ? 80 7D ? ? 75 ? F3 0F 10 45")), 0x1, 0x0));
// Credit: https://www.unknowncheats.me/forum/4265752-post6333.html
static fnTraceShape oTraceShape = reinterpret_cast<fnTraceShape>(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 20 48 89 4C 24 08 55 56 41")));

#ifdef CS_PARANOID
CS_ASSERT(oTraceShape != nullptr);
Expand Down
11 changes: 7 additions & 4 deletions cstrike/sdk/interfaces/imaterialsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ class CMeshData
oSetMaterialFunction(this, functionVar, nValue, 0x18);
}

// Credit: https://www.unknowncheats.me/forum/4270816-post6392.html

MEM_PAD(0x18); // 0x0
CSceneAnimatableObject* pSceneAnimatableObject; // 0x18
CMaterial2* pMaterial; // 0x20
MEM_PAD(0x18); // 0x28
Color_t colValue; // 0x40
MEM_PAD(0x4); // 0x44
CObjectInfo* pObjectInfo; // 0x48
CMaterial2* pMaterialCpy; // 0x28
MEM_PAD(0x10);
CObjectInfo* pObjectInfo;
MEM_PAD(0x8);
Color_t colValue;
};

class IMaterialSystem2
Expand Down

0 comments on commit 1eb9c3f

Please # to comment.