当前位置: 首页 > >

简单游戏外挂,植物大战僵尸外挂,附cpp源代码

发布时间:


#include "stdafx.h"
#include
#include
int ***p = (int ***)0x007794F8;


unsigned char *Pause = (unsigned char *)0x00472B50; ?//指向暂停函数代码头部,内存属性不可写


HANDLE hProcess;


void ModifyCode()
{
DWORD dwOldProtect;
VirtualProtectEx(hProcess, (void *)0x00472B50, 3, PAGE_EXECUTE_READWRITE, &dwOldProtect);
char code[] = "xC2x04x00";
WriteProcessMemory(hProcess, Pause, &code, 3, NULL);
}


int *P3(int ***p, int offset2, int offset3, int value)
{
int tempValue;


ReadProcessMemory(hProcess, p, &tempValue, 4, NULL);//XX
int *lp2 = (int *)(tempValue + offset2);


ReadProcessMemory(hProcess, lp2, &tempValue, 4, NULL);//XX
lp2 = (int *)(tempValue + offset3);


if (value != -1)
{
WriteProcessMemory(hProcess, lp2, &value, 4, NULL);
}


return lp2;


//return (int *)(*(int *)(int(*p) + offset2) + offset3);
}


int *P4(int ***p, int offset2, int offset3, int offset4, int value)
{
int tempValue;


ReadProcessMemory(hProcess, p, &tempValue, 4, NULL);//XX
int *lp2 = (int *)(tempValue + offset2);


ReadProcessMemory(hProcess, lp2, &tempValue, 4, NULL);//XX
lp2 = (int *)(tempValue + offset3);


ReadProcessMemory(hProcess, lp2, &tempValue, 4, NULL);//XX
lp2 = (int *)(tempValue + offset4);


if (value != -1)
{
WriteProcessMemory(hProcess, lp2, &value, 4, NULL);
}


return lp2;


//return (int *)(*(int *)(*(int *)(int(*p) + offset2) + offset3) + offset4);
}





//修改阳光
void ModifySun()
{
int i,b=1;
while (b)
{
printf("请输入您要修改的阳光值:");
scanf("%d", &i);
P3(p, 0x868, 0x5578, i);
printf("输入0返回上一页面,输入其它数字继续修改阳光");
scanf("%d", &b);
}
system("cls");

}


//修改关卡
void ModifyGuanKa()
{
int i, b = 1;
while (b)
{
printf("请输入您要修改的关卡值(例子:35代表4-5关):");
scanf("%d", &i);
P3(p, 0x950, 0x4C,i);
printf("输入0返回上一页面,输入其它数字继续修改关卡");
scanf("%d", &b);
}
system("cls");
}


//修改金钱
void ModifyMoney()
{
int i, b = 1;
while (b)
{
printf("请输入您要修改的金钱值:");
scanf("%d", &i);
P3(p, 0x950, 0x50, i);
printf("输入0返回上一页面,输入其它数字继续修改金钱");
scanf("%d", &b);
}
system("cls");
}


//修改冷却时间
void ModifyColdTime()
{
int b=1;
while (b)
{
int *pCount = P4(p, 0x868, 0x15c, 0x24, -1);
int *pCurrentColdTime = P4(p, 0x868, 0x15c, 0x4C, -1);
int *pTotalColdTime = P4(p, 0x868, 0x15c, 0x50, -1);


int nCount = 0, nTotalColdTime = -1;
ReadProcessMemory(hProcess, pCount, &nCount, 4, NULL);
for (int i = 0; i < nCount; i++)
{
ReadProcessMemory(hProcess, pTotalColdTime, &nTotalColdTime, 4, NULL);
//*pCurrentColdTime = *pTotalColdTime;
WriteProcessMemory(hProcess, pCurrentColdTime, &nTotalColdTime, 4, NULL);
pCurrentColdTime = (int *)((int)pCurrentColdTime + 0x50);
pTotalColdTime = (int *)((int)pTotalColdTime + 0x50);
}
printf("输入0返回上一页面,输入其它数字继续初始化冷却时间");
scanf("%d", &b);
}
system("cls");


}






DWORD WINAPI ThreadProc(
LPVOID lpParameter ? // thread data
)
{
AAA:printf("%6c******************************************************************
",);
printf("%18c植%4c物%4c大%4c战%4c僵%4c尸%4c外%4c挂
",,,,,,,,);
printf("
%30c作者:初次觉醒",);
printf("
%28c1.ModifySun",);
printf("
%28c2.Modifycensorship",);
printf("
%28c3.InitializeColdTime",);
printf("
%28c4.ModifyMoney");
printf("
%6c******************************************************************
",);
int n;
printf("


请输入您要修改的选项:");
scanf("%d", &n);
system("cls");
switch (n)
{
case 1:ModifySun(); goto AAA;
case 2:ModifyGuanKa(); goto AAA;
case 3:ModifyColdTime(); goto AAA;
case 4:ModifyMoney(); goto AAA;
default: system("cls"); goto AAA;

}







return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{

HWND hWnd = FindWindowA(NULL, "Plants vs. Zombies 1.2.0.1073 ");
DWORD PID;
GetWindowThreadProcessId(hWnd, &PID);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, PID);
if (hProcess == NULL)
{
printf("打开进程失败!
");
return 0;
}


//ModifyGuanKa();
CreateThread(0, 0, ThreadProc, 0, 0, 0);
ModifyCode();






while (1)
{
Sleep(1000);
}
return 0;
}



友情链接: 时尚网 总结汇报 幼儿教育 小学教育 初中学习资料网