【源码】LOL 无限视距 防御塔范围
#include <Windows.h>
#include <stdio.h>
#include <TlHelp32.h>
HANDLE hProcess;
//开启视距
BOOL OpenSJ()
{
char buff = 120;//开启视距代码
//向其他进程写数据
WriteProcessMemory(hProcess,//进程句柄
(void*)0x5C005B,//视距基址
&buff,
1,//需要写入的数据大小
NULL);
}
//关闭视距
BOOL CloseSJ()
{
char buff = 119;//关闭视距代码
//向其他进程写数据
WriteProcessMemory(hProcess,//进程句柄
(void*)0x5C005B,//视距基址
&buff,
1,//需要写入的数据大小
NULL);
}
//显示防御塔攻击范围
BOOL ShowFW()
{
char buff = 118;//开启防御塔攻击范围代码
//向其他进程写数据
WriteProcessMemory(hProcess,//进程句柄
(void*)0xC7E31D,//防御塔攻击范围基址
&buff,
1,//需要写入的数据大小
NULL);
}
//显示防御塔攻击范围
BOOL CloseFW()
{
char buff = 117;//关闭防御塔攻击范围代码
//向其他进程写数据
WriteProcessMemory(hProcess,//进程句柄
(void*)0xC7E31D,//防御塔攻击范围基址
&buff,
1,//需要写入的数据大小
NULL);
}
int main()
{
system("mode 40,20");
DWORD PID = 0;
HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32 pe = { sizeof(PROCESSENTRY32) };
Process32First(hProcessSnap, &pe);
do
{
if (!strcmp(pe.szExeFile, "League of Legends.exe"))
{
PID = pe.th32ProcessID;
}
} while (Process32Next(hProcessSnap, &pe));
CloseHandle(hProcessSnap);
if (PID == 0)
{
printf("无法获取LOL的PID,请先进入游戏!\n");
system("pause");
return 0;
}
printf("League of Legends.exe PID为:%d\n", PID);
hProcess = OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_OPERATION, NULL, PID);
if (hProcess == NULL)
{
printf("打开进程失败!请用管理员身份运行!\n");
system("pause");
return 0;
}
printf("打开进程成功!\n");
printf("======================\n");
printf("1.打开无限视距\n");
printf("2.关闭无限视距\n");
printf("3.显示防御塔攻击范围\n");
printf("4.关闭防御塔攻击范围\n");
printf("======================\n");
int i;
while (1)
{
scanf_s("%d", &i);
switch (i)
{
case 1:
OpenSJ();
break;
case 2:
CloseSJ();
break;
case 3:
ShowFW();
break;
case 4:
CloseFW();
break;
default:
CloseHandle(hProcess);
return 0;
}
}
system("pause");
return 0;
}
源码有错误哦~小白不懂哦
--------------------------------------
--------------------Configuration: lol - Win32 Debug--------------------
Compiling...
lol.c
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(58) : error C2275: 'DWORD' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\windef.h(141) : see declaration of 'DWORD'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(58) : error C2146: syntax error : missing ';' before identifier 'PID'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(58) : error C2065: 'PID' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(59) : error C2275: 'HANDLE' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\winnt.h(207) : see declaration of 'HANDLE'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(59) : error C2146: syntax error : missing ';' before identifier 'hProcessSnap'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(59) : error C2065: 'hProcessSnap' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(59) : warning C4047: '=' : 'int ' differs in levels of indirection from 'void *'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(60) : error C2275: 'PROCESSENTRY32' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\tlhelp32.h(175) : see declaration of 'PROCESSENTRY32'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(60) : error C2146: syntax error : missing ';' before identifier 'pe'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(60) : error C2065: 'pe' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(60) : error C2059: syntax error : '{'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(61) : warning C4022: 'Process32First' : pointer mismatch for actual parameter 1
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(61) : warning C4133: 'function' : incompatible types - from 'int *' to 'struct tagPROCESSENTRY32 *'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(64) : error C2224: left of '.szExeFile' must have struct/union type
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(64) : error C2198: 'strcmp' : too few actual parameters
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(66) : error C2224: left of '.th32ProcessID' must have struct/union type
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(68) : warning C4022: 'Process32Next' : pointer mismatch for actual parameter 1
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(68) : warning C4133: 'function' : incompatible types - from 'int *' to 'struct tagPROCESSENTRY32 *'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(69) : warning C4022: 'CloseHandle' : pointer mismatch for actual parameter 1
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(78) : warning C4047: 'function' : 'int ' differs in levels of indirection from 'void *'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(78) : warning C4024: 'OpenProcess' : different types for formal and actual parameter 2
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(92) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(95) : warning C4013: 'scanf_s' undefined; assuming extern returning int
C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\lol\lol.c(95) : error C2065: 'i' : undeclared identifier
执行 cl.exe 时出错.
lol.obj - 1 error(s), 0 warning(s)
忆惘惜 发表于 2017-11-2 16:43
源码有错误哦~小白不懂哦
--------------------------------------
--------------------Configuration ...
有没有正确导入头文件?
windows sdk 版本选好了没? 怎么使用呀,用VC编辑吗 加个 连招 或者 显CD 插眼计时就完美了 不明觉厉~~~ 博爵 发表于 2017-11-2 14:59
怎么使用呀,用VC编辑吗
我用的是Visual Studio 阿呆哥 发表于 2017-11-2 14:59
加个 连招 或者 显CD 插眼计时就完美了
以后有空我研究下 ShadowY 发表于 2017-11-2 15:04
谢谢分享啊!
以后有好东西我都会开源。某些人写点小软件就卖钱,真恶心 小俊 发表于 2017-11-2 15:07
以后有好东西我都会开源。某些人写点小软件就卖钱,真恶心
都是生活所迫呀、一个愿打一个愿挨、圈子不一样 楼主6了,谢谢楼主分享思路 我原来想用Vc搞一下,结果不会。现在有你这个。以后直接更新就可以用了{:301_1004:}