This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MenuX_Function_Fitur.h
357 lines (330 loc) · 8.62 KB
/
MenuX_Function_Fitur.h
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
int GetMyCharaIndex()
{
unsigned long dwBase = *(DWORD*)ResultPlayerBase;
CTeam *MyTeam = (CTeam*) ((dwBase + PTR_TEAM));
return MyTeam->iTeam;
}
bool GetUserBone( D3DXVECTOR3 &Out, int BoneIdx ,int Idx)
{
DWORD dwGameBase = *(DWORD*)ResultBaseESP;
if ( dwGameBase )
{
CGameBase* GameBase = (CGameBase*)( *(DWORD*)(dwGameBase + 0x14 + ( 0x4 * Idx ) ) );
if ( GameBase && GameBase->Bones)
{
Out.x = GameBase->Bones->BoneData[ BoneIdx ].BoneMatrix._41;
Out.y = GameBase->Bones->BoneData[ BoneIdx ].BoneMatrix._42;
Out.z = GameBase->Bones->BoneData[ BoneIdx ].BoneMatrix._43;
return true;
}
}
return false;
}
bool YoWorlToScreenGa( D3DVECTOR Player,D3DVECTOR &PlayerScaled)
{
D3DXVECTOR3 PlayerPos(Player.x,Player.y,Player.z);
D3DXMATRIX identity;
D3DXVECTOR3 vScreen;
i3Device->GetViewport(&NhViewport);
NhViewport.X = NhViewport.Y = 0;
NhViewport.MinZ = 0;
NhViewport.MaxZ = 1;
D3DXVec3Project(
&vScreen,
&PlayerPos,
&NhViewport,
&pRC->pRenderData->ProjMatrix,
&pRC->pRenderData->ViewMatrix,
&pRC->pRenderData->WorldMatrix);
if (vScreen.z < 1.0f && vScreen.x > 0.0f && vScreen.y > 0.0f && vScreen.x < NhViewport.Width && vScreen.y < NhViewport.Height)
{
PlayerScaled.x = vScreen.x;
PlayerScaled.y = vScreen.y ;
PlayerScaled.z = vScreen.z;
return true;
}
return false;
}
void DrawLine ( long Xa, long Ya, long Xb, long Yb, DWORD dwWidth, float Health)
{
DWORD HPcol = Blue;
if (Health < 90)HPcol = Green;
if (Health < 80) HPcol = Yellow;
if (Health < 40) HPcol = Orange;
if (Health < 10) HPcol = Red;
D3DXVECTOR2 vLine[ 2 ]; // 2 Poin
NHLine->SetAntialias( 0 ); // Set Tepi
NHLine->SetWidth( dwWidth ); // Lebar Dari Line
NHLine->Begin();
vLine[ 0 ][ 0 ] = Xa; // Jadikan Point Menjadi Array
vLine[ 0 ][ 1 ] = Ya;
vLine[ 1 ][ 0 ] = Xb;
vLine[ 1 ][ 1 ] = Yb;
NHLine->Draw( vLine, 2, HPcol ); // Draw Garis , Jumlah Garis , Warna Garis
NHLine->End(); // Selesai
}
void HealthBar15(int x, int y, float Health)
{
const D3DCOLOR colours[] = { Red, Red, Red, Red, Orange, Orange, Orange, Orange, Yellow, Yellow, Yellow, Yellow, Green, Green, Green, Green, Green, Green, Blue, Blue }; // this is our order
int boxSizeX = 2;
int boxSizeY = 7;
int boxGap = 1;
for ( int c = 0 ; c < 20; c++ )
{
if ( Health > ( 5 * c ) )
DrawBorder(x-1,y-1,62,9,1,colours[c],i3Device );
}
for ( int i = 0 ; i < 20; i++ )
{
if ( Health > ( 5 * i ) )
FillRGB(x,y, boxSizeX, boxSizeY,colours[i],i3Device);
else
FillRGB(x,y, boxSizeX, boxSizeY,Grey,i3Device);
x = x + boxSizeX+ boxGap;
}
}
void DrawStringESP(int x, int y, DWORD color, const char *fmt, ...)
{
RECT FontPos = { x, y, x + 200, y + 16 };
char buf[1024] = {'\0'};
va_list va_alist;
va_start(va_alist, fmt);
vsprintf_s(buf, fmt, va_alist);
va_end(va_alist);
NHT3XT->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
}
void DrawBoxESP( int x, int y, int w, int h, float Health, IDirect3DDevice9* pDevice )
{
DWORD HPcol = Blue;
if (Health < 90)HPcol = Green;
if (Health < 80) HPcol = Yellow;
if (Health < 40) HPcol = Orange;
if (Health < 10) HPcol = Red;
DrawBorder( x, y, w, h, 1, HPcol, pDevice );
}
struct D3DTLVERTEX
{
float fX;
float fY;
float fZ;
float fRHW;
D3DCOLOR Color;
float fU;
float fV;
};
D3DTLVERTEX CreateD3DTLVERTEX (float X, float Y, float Z, float RHW, D3DCOLOR color, float U, float V)
{
D3DTLVERTEX v;
v.fX = X;
v.fY = Y;
v.fZ = Z;
v.fRHW = RHW;
v.Color = color;
v.fU = U;
v.fV = V;
return v;
}
#define PISSS 3.14159265
void Circle( float x, float y, float rad, bool center, DWORD color ,LPDIRECT3DDEVICE9 pDevice)
{
const int NUMPOINTS = 34;
if(!center)
{
x -= rad;
y -= rad;
}
D3DTLVERTEX Circle[NUMPOINTS + 1];
int i;
float X;
float Y;
float Theta;
float WedgeAngle;
WedgeAngle = (float)( (2*PISSS) / NUMPOINTS );
for( i=0; i<=NUMPOINTS; i++ )
{
Theta = i * WedgeAngle;
X = (float)( x + rad * cos(Theta) );
Y = (float)( y - rad * sin(Theta) );
Circle[i] = CreateD3DTLVERTEX( X, Y, 0.0f, 1.0f, color, 0.0f, 0.0f );
}
pDevice -> SetFVF ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 );
pDevice -> SetTexture ( 0, NULL );
pDevice -> DrawPrimitiveUP ( D3DPT_LINESTRIP, NUMPOINTS, &Circle[0], sizeof(Circle[0]) );
}
DWORD GetPlayerTarget(int myIDX)
{
DWORD BasePlayer_B = *(DWORD*)(ResultBaseESP);
if(IsBadReadPtr((void*)BasePlayer_B,4))return 0;
DWORD PlayerIndexA = *(DWORD*)(BasePlayer_B + 0x14 + (myIDX * 4));
if(IsBadReadPtr((void*)PlayerIndexA,4))return 0;
DWORD PlayerIndexB = *(DWORD*)(PlayerIndexA + 0x550); //560
if(IsBadReadPtr((void*)PlayerIndexB,4))return 0;
DWORD IsTargetingEnemy = *(DWORD*)(PlayerIndexB + 0x94E8);
if(IsBadReadPtr((void*)IsTargetingEnemy,4))return 0;
return IsTargetingEnemy;
}
DWORD BurstPiso, vReload = 0;
DWORD _ReadMEM(DWORD dwPtr,DWORD A1,DWORD B1,DWORD C1,DWORD D1)
{
DWORD C=0;
if (IsBadReadPtr((PDWORD)dwPtr,4)==0)
{
C=*(PDWORD)((DWORD)(dwPtr))+A1;
if (IsBadReadPtr((PDWORD )C,4)==0)
{
C=*(PDWORD)((DWORD)(C ))+ B1;
if (IsBadReadPtr((PDWORD)C,4)==0)
{
C=*(PDWORD)((DWORD)(C ))+ C1;
if (IsBadReadPtr((PDWORD)C,4)==0)
{
C=*(PDWORD)((DWORD)(C ))+ D1;
if (IsBadReadPtr((PDWORD)C,4)==0)
{
return *(PDWORD)C;
}
}
}
}
}
return C;
}
DWORD _ReadMEM(DWORD dwPtr,DWORD A1,DWORD B1,DWORD C1)
{
DWORD C=0;
if (IsBadReadPtr((PDWORD)dwPtr,4)==0)
{
C=*(PDWORD)((DWORD)(dwPtr))+A1;
if (IsBadReadPtr((PDWORD )C,4)==0)
{
C=*(PDWORD)((DWORD)(C ))+ B1;
if (IsBadReadPtr((PDWORD)C,4)==0)
{
C=*(PDWORD)((DWORD)(C ))+ C1;
if (IsBadReadPtr((PDWORD)C,4)==0)
{
return *(PDWORD)C;
}
}
}
}
return C;
}
DWORD BulletFast = 0;
DWORD _ReadMEM(DWORD dwPtr,DWORD A1,DWORD B1)
{
DWORD C=0;
if (IsBadReadPtr((PDWORD)dwPtr,4)==0)
{
C=*(PDWORD)((DWORD)(dwPtr))+A1;
if (IsBadReadPtr((PDWORD )C,4)==0)
{
C=*(PDWORD)((DWORD)(C ))+ B1;
if (IsBadReadPtr((PDWORD)C,4)==0)
{
return *(PDWORD)C;
}
}
}
return C;
}
void _WriteMEM(DWORD Adr, DWORD Ptr1, DWORD Ptr2, DWORD WriteValue)
{
DWORD Temp=0;
if (IsBadReadPtr((PDWORD)Adr, 4) == 0)
{
Temp = *(PDWORD)((DWORD)(Adr)) + Ptr1;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr2;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
*(PDWORD)Temp = WriteValue;
}
}
}
}
WORD WriteVaL1, WriteVaL2, WriteVaL3, WriteVaL4, WriteVaL5;
void __ReadMEM(DWORD Adr, DWORD Ptr1, DWORD Ptr2, DWORD Ptr3, DWORD ReadValue)
{
DWORD Temp=0;
if (IsBadReadPtr((PDWORD)Adr, 4) == 0)
{
Temp = *(PDWORD)((DWORD)(Adr)) + Ptr1;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr2;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr3;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
switch (ReadValue)
{
case 1:
WriteVaL1 = *(PWORD)Temp;
case 2:
WriteVaL2 = *(PWORD)Temp;
case 3:
WriteVaL3 = *(PWORD)Temp;
case 4:
WriteVaL4 = *(PWORD)Temp;
case 5:
WriteVaL5 = *(PWORD)Temp;
}
}
}
}
}
}
void _WriteMEM(DWORD Adr, DWORD Ptr1, DWORD Ptr2, DWORD Ptr3, DWORD WriteValue)
{
DWORD Temp=0;
if (IsBadReadPtr((PDWORD)Adr, 4) == 0)
{
Temp = *(PDWORD)((DWORD)(Adr)) + Ptr1;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr2;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr3;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
*(PDWORD)Temp = WriteValue;
}
}
}
}
}
void _WriteMEM(DWORD Adr, DWORD Ptr1, DWORD Ptr2, DWORD Ptr3, DWORD Ptr4, DWORD WriteValue)
{
DWORD Temp=0;
if (IsBadReadPtr((PDWORD)Adr, 4) == 0)
{
Temp = *(PDWORD)((DWORD)(Adr)) + Ptr1;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr2;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr3;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
Temp = *(PDWORD)((DWORD)(Temp)) + Ptr4;
if (IsBadReadPtr((PDWORD)Temp,4) == 0)
{
*(PDWORD)Temp = WriteValue;
}
}
}
}
}
}
void NHMemFuction (void *adr, void *ptr, int size)
{
DWORD CheckProtection;
VirtualProtect(adr,size,PAGE_EXECUTE_READWRITE, &CheckProtection);
memcpy(adr,ptr,size);
VirtualProtect(adr,size,CheckProtection, &CheckProtection);
}