吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 6115|回复: 21
收起左侧

[C&C++ 转载] 【源码】LOL 无限视距 防御塔范围

  [复制链接]
小俊 发表于 2017-11-2 14:56
[C] 纯文本查看 复制代码
#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;
}

免费评分

参与人数 3吾爱币 +2 热心值 +3 收起 理由
羽小时 + 1 + 1 希望设置下权限,要不然会泛滥
博爵 + 1 + 1 很强大,无限火力必备
情的愫 + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

忆惘惜 发表于 2017-11-2 16:43
源码有错误哦~  小白不懂哦
--------------------------------------
--------------------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 17:00
忆惘惜 发表于 2017-11-2 16:43
源码有错误哦~  小白不懂哦
--------------------------------------
--------------------Configuration ...

有没有正确导入头文件?
windows sdk 版本选好了没?
博爵 发表于 2017-11-2 14:59
阿呆哥 发表于 2017-11-2 14:59
加个 连招 或者 显CD 插眼计时就完美了
不二 发表于 2017-11-2 14:59
不明觉厉~~~
 楼主| 小俊 发表于 2017-11-2 15:00
博爵 发表于 2017-11-2 14:59
怎么使用呀,用VC编辑吗

我用的是Visual Studio
 楼主| 小俊 发表于 2017-11-2 15:01
阿呆哥 发表于 2017-11-2 14:59
加个 连招 或者 显CD 插眼计时就完美了

以后有空我研究下
 楼主| 小俊 发表于 2017-11-2 15:07

以后有好东西我都会开源。某些人写点小软件就卖钱,真恶心
ShadowY 发表于 2017-11-2 15:08
小俊 发表于 2017-11-2 15:07
以后有好东西我都会开源。某些人写点小软件就卖钱,真恶心

都是生活所迫呀、一个愿打一个愿挨、圈子不一样
netCheney 发表于 2017-11-2 15:13
楼主6了,谢谢楼主分享思路
博爵 发表于 2017-11-2 15:39
我原来想用Vc搞一下,结果不会。现在有你这个。以后直接更新就可以用了
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-28 07:59

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表