ok this code is actually leeched, and its my first time doing something like this, so i pretty much took it and modified some things, but what I do not understand is.
1- how did they know that noReload is 0x26A4 and WeaponMgr is 0xAAC3D0
2- why the X-Trap pops up saying abnormal memory access?
#include <Windows.h>
void ShowMessage(char* string, DWORD CShell);//credits to DaRk For Message Box
#include <fstream>
#include <iostream>
#define NoReload 0x26A4
#define WeaponMgr 0xAAC3D0
#define NoRecoil1 0x051C
#define Norecoil2 0x0684
#define Norecoil3 0x1938
#define Norecoil4 0x1B14
#define Norecoil5 0x1FA0
#define Norecoil6 0x2108
void test1(void)
{
int szf = sizeof(float);
int szd = sizeof(DWORD);
bool norecoil = true;
bool noreload = false;
DWORD WeaponClass = NULL;
DWORD pWeaponMgr = NULL;
while(1)
{
DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
ShowMessage("Yatgari Hack V1",CShell);
while(1)
{
DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
DWORD pWeaponMgr = *(DWORD*)(CShell + WeaponMgr);
if(GetAsyncKeyState(VK_F11)&1) {
noreload = !noreload;
}
{
if(norecoil)
{
for(int y = 0; y<10; y++)
{
*(float*)( NoRecoil1 + (0x051C + (szf*y))) = (float)0;
*(float*)( Norecoil2 + (0x0684 + (szf*y))) = (float)0;
*(float*)( Norecoil3 + (0x1938 + (szf*y))) = (float)0;
*(float*)( Norecoil4 + (0x1B14 + (szf*y))) = (float)0;
*(float*)( Norecoil5 + (0x1FA0 + (szf*y))) = (float)0;
*(float*)( Norecoil6 + (0x2108 + (szf*y))) = (float)0;
}
}
}
for(int i=0; i<600; i++)
{
pWeaponMgr = (*(DWORD*)(WeaponClass + (szd*i)));
if(pWeaponMgr != NULL)
{
if(pWeaponMgr){
if(noreload)
{
*(float*)(pWeaponMgr + 0x26A4) = (float)72;
}
}
}
}
}
}
}
DWORD WINAPI Yatagari11 (LPVOID)
{
test1();
return 1;
}
BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
}
if (GetModuleHandleA("CShell.dll") && GetModuleHandleA("ClientFx.Fxd") )
{
DisableThreadLibraryCalls(hDll);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)test1, NULL, NULL, NULL);
}
return TRUE;
}
void ShowMessage(char* string, DWORD CShell)
{
DWORD MsgBoxFunc = CShell + 0x838F0;
__asm
{
push string;
push 0;
push 0x70;
push 0x1C;
call MsgBoxFunc;
add esp, 16;
}
}