-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderer.cs
124 lines (112 loc) · 4.28 KB
/
Renderer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using System;
using System.Threading;
using CheatApplication;
using Swed64;
namespace CheatApplication
{
class Program
{
static void Main(string[] args)
{
// Start the ImGui renderer in a separate thread
var rendererThread = new Thread(() =>
{
Renderer renderer = new Renderer();
renderer.Start().Wait();
});
rendererThread.Start();
// Initialize SWed64 and get base addresses
Swed swed = new Swed("CombatMaster");
IntPtr moduleBase = swed.GetModuleBase("Project.dll");
IntPtr EngineBase = swed.GetModuleBase("Engine.dll");
IntPtr ammoInstructionAddress = moduleBase + 0x8B6740;
IntPtr grenadeInstructionAddress = moduleBase + 0x8B6646;
IntPtr sprintInstruction = moduleBase + 0x39F4C86;
IntPtr secAmmoInstruction = moduleBase + 0x8B6847;
IntPtr RedScore = moduleBase + 0x8E6829;
IntPtr headbopInstructionAddress = moduleBase + 0x35D522C;
IntPtr Health = moduleBase + 0x8D6170;
IntPtr Jump = moduleBase + 0x35D95A0;
IntPtr separateHealthOffset = moduleBase + 0x8B64CA; // New health offset
// Main loop for applying memory patches based on ImGui state
while (true)
{
if (Renderer.headbop)
{
// NOP the headbop instruction (44 89 77 54 -> 90 90 90 90)
swed.WriteBytes(headbopInstructionAddress, "90 90 90 90");
}
else
{
// Restore the original instruction
swed.WriteBytes(headbopInstructionAddress, "44 89 77 54");
}
if (Renderer.Jump)
{
swed.WriteBytes(Jump, "90 90 90 90 90 90 90");
}
else
{
swed.WriteBytes(Jump, "40 88 BB 8C 00 00 00");
}
if (Renderer.health)
{
swed.WriteBytes(Health, "90 90 90 90 90");
}
else
{
swed.WriteBytes(Health, "42 89 7C C2 20");
}
//
if (Renderer.freezered)
{
swed.WriteBytes(RedScore, "90 90 90 90");
}
else
{
swed.WriteBytes(RedScore, "89 7C C2 20");
}
//
if (Renderer.InfAmmo)
{
swed.WriteBytes(ammoInstructionAddress, "90 90 90 90 90");
}
else
{
swed.WriteBytes(ammoInstructionAddress, "42 89 7C C2 20");
}
//
//
if (Renderer.SecAmmo)
{
swed.WriteBytes(secAmmoInstruction, "90 90 90 90");
}
else
{
swed.WriteBytes(secAmmoInstruction, "89 7C C2 20");
}
//
if (Renderer.SetHealthToZero)
{
swed.WriteBytes(separateHealthOffset, new byte[] { 0x00, 0x00, 0x00, 0x00 }); // Set health to 0
}
else
{
// Write the original instruction back to avoid crashing
swed.WriteBytes(separateHealthOffset, new byte[] { 0x8B, 0x44, 0xC2, 0x20 }); // Default health logic
}
if (Renderer.InfGrenades)
{
swed.WriteBytes(grenadeInstructionAddress, "90 90 90 90");
}
else
{
swed.WriteBytes(grenadeInstructionAddress, "89 7C C2 20");
}
// Optional: Handle FOV adjustment if desired
// swed.WriteFloat(fovInstructionAddress, Renderer.FOV);
Thread.Sleep(20);
}
}
}
}