当前位置: 七九推 > IT编程>软件设计>设计模式 > 如何创建一个基本的魔兽全图外挂 HowTo create a basic Maphack by Chaotic 翻译

如何创建一个基本的魔兽全图外挂 HowTo create a basic Maphack by Chaotic 翻译

2022年09月07日 设计模式 我要评论
HowTo create a basic Maphack  by:Chaotic   Requirements: - Ollydbg - A memory sea

HowTo create a basic Maphack

 by:Chaotic

 

Requirements:

- Ollydbg
- A memory searcher (e.g. ArtMoney)
- ASM knowledge
- Warcraft III in window mode
-->Create a shortcut, right click and “Properties“
Then add “ -window“


This is my first tutorial, so I hope it has no mistakes and is understandable for everyone.
The main-idea is NOT to follow it step by step and say “I’ll got it, I’m a uber-1337-Hax0r!” Wink
I just want to show you a little part of Warcraft III hacking. I hope this inspires you to learn more by yourself. To be a good hacker, you’ve to know much more and you’ve to get those offsets alone, that’s one reason why I choose a method to get a detectable offset!
[SO DON’T USE IT IN LADDER!]

PART I Instruction

Well, first we’ve to think about a method how to find a offset which reveals the units..
There are many ways...use your brain and try to think like blizzard did when they made this nice game Wink So we need to know how the game manages it if the unit is visible or not.
*IDEA*
“Enemy unit visible” = TRUE = 1
“Enemy unit hidden in fog of war” = FALSE = 0
This makes any sense?
Yeah, let’s try it!


PART II Main Part

Now start Warcraft III and enter a singleplayer game.
(In singleplayer games you won’t disc if you’re pausing the game too long and you’re able to play alone)
Then start ArtMoney and choose “kernel32.dll” as library for process viewer.
Now you should be able to select Warcraft III as process.
Back to Warcraft III
Just move your unit near a random creep so it’s in your sight range.

Switch to ArtMoney
Now press on Search and search for “1” as Integer.
Wait until it’s finished and you’ll see that
there are many addresses holding the
Value 1…
So we’ve to filter until there are only a
couple addresses left. So...



Switch back to Warcraft III
Now move away so that you can’t see your creep anymore.

Now back to Artmoney and Filter [don't’ search again Wink ]
for “0” as Integer.
After it’s finished, move your unit in the creep’s sight rangeagain and filter for “1” as integer….
After repeating this step ~15 times you should have ~7
addresses left.
Now you’ve to filter by hand:
Move your unit away again, so all rest addresses should be “0”.
Now set the first value to “1” and “Freeze” it
And have a look at Warcraft III if anything changes…

Nothing happened?
So unfreeze the first value, set it to 0 and remove the first value from your table.
Do the same steps until you notice this: (no pictures remember?)
This looks right (in my case it’s 0x12CD337.

So now the interesting part, that’s the time for Ollydbg! Smiley
Attach Warcraft III and move to your address in dump.
Now do a “Memory breakpoint on access” onto the first 8 bytes!
You should reach this address:
6F2A3B91 |. 66:8B3C41 MOV DI,WORD PTR DS:[ECX+EAX*2]
Remove that memory breakpoint again and try to change it like this :
MOV DI,1
And have a look at Warcraft III…
I can see every creep on the mainmap and even buildings on the minimap!
Yeah, it looks like we’re finished!

But wait…!
If you join some custom games you’ll notice that sometimes there’s a bug…
You can’t click any unit, even not your own ones! Sad

So we’ve to look at 0x6F2A3B91 again in Ollydbg and fix this problem.
Now we must understand how Warcraft III works…
MOV DI,WORD PTR DS:[ECX+EAX*2] is a simple part of the draw function which checks which player has the control about the unit.
So we need to change the part so, that it will reveal the unit for all players (1-16).
Well, the number “tells” this part for which players it should check.
MOV DI,

0x1=1. Player
0x2=1-2.Player

0xF=1-16. Player

So what we have to do is change our MOV DI,1 to MOV DI,0xF.
So that it will work every time even if we’re not player 1!



Part III The Coding

Now we have our offset + correct changes, but we don’t want to do this change every time we restart Warcraft III by hand with Ollydbg, do we ?!
So now we’ve to code a program which writes into Warcraft III’s memory
Code in C++:



/************************************************** ***************




  *Made by Chaotic *


  *Shoutouts to: Exzap, Alpha_Hacka & xliqz^ *


  *www.SkillHackerZ.com *


  *Remember: Don't use it in Laddergames because it is not allowed!*


  *Only with friends *


************************************************** ****************/




#include <windows.h>


void EnableDebugPriv();


int main()
{


//We have to set debug privileges for our app to be allowed to OpenProcess (war3.exe)
EnableDebugPriv();
//Get a Handle on Warcraft III window
HWND hwar3 = FindWindow("Warcraft III",NULL);
if (!hwar3) //If we can't find the window...
{
MessageBox(0, "Run Warcarft III First!", "", MB_OK);
return false;
}
DWORD pid;
GetWindowThreadProcessId(hwar3, &pid);
HANDLE hopen = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
if (!hopen) //Can't open Warcarft III's process.. Must be a PID error.
{
MessageBox(0, "Your getting a PID error, use LoaderZ.", "", MB_OK);
return false;
}
//Now we're ready to change the memory!
//We remember: 6F2A3B91 66:BF 0F00 MOV DI,0x0F
BYTE data[] = {0xBF,0x0F,0x00};
bool success = WriteProcessMemory(hopen,(LPVOID)0x6F2A3B92, &data,3, NULL);


if(success)//Everything worked
MessageBox(NULL, "Hack Loaded - Remember to Vist www.SkillHackerZ.com", "", MB_OK);
else//There was an error!
MessageBox(NULL, "Couldn't load hack", "", MB_OK);
// Remember to be clean
CloseHandle(hopen);
//Done!
return true;
}


void EnableDebugPriv()
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken);
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &sedebugnameValue);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, false, &tkp, sizeof tkp, NULL, NULL);
CloseHandle(hToken);
}

(0)
打赏 微信扫一扫 微信扫一扫

相关文章:

  • Kubernetes(二)Pod详解及容器设计模式

    Kubernetes(二)Pod详解及容器设计模式

    题外话:推荐大家学习k8s,看一下张磊的《深入剖析Kubernetes》这本书。 1. 为什么需要 Pod 1.1 容器的基本概念 我们知道 Po... [阅读全文]
  • 参考文献格式生成器(GB/T 7714-2015)

    参考文献格式生成器(GB/T 7714-2015)

    写在前面 这是一个因为懒诞生的小项目,发出来是感觉也花了一些精力就自己用太亏了。 因为懒得对着引用文献标准一个个敲字,文献管理软件的... [阅读全文]
  • 软件开发基础之设计模式概述

    软件开发基础之设计模式概述

    成为一名优秀的软件开发工程师,设计模式的重要性不言而喻,本章节是对设计模式的前置知识概述,涉及概念性较大,读者可在设计模式学习过程中参阅本文档。在第一章节,主要... [阅读全文]
  • 详解Go语言设计模式之单例模式

    详解Go语言设计模式之单例模式

    单例模式的概念单例模式很容易记住。就像名称一样,它只能提供对象的单一实例,保证一个类只有一个实例,并提供一个全局访问该实例的方法。在第一次调用该实例时被创建,然... [阅读全文]
  • pytorch dataset实战案例之读取数据集的代码

    pytorch dataset实战案例之读取数据集的代码

    概述最近在跑一篇图像修复论文的代码,配置好环境之后开始运行,发现数据一直加载不进去。害,还是得看人家代码咋写的,一句一句看逻辑,准能找出问题。通读dataset... [阅读全文]
  • Visitor设计模式及发送pod创建请求实现详解

    Visitor设计模式及发送pod创建请求实现详解

    确立目标理解kubectl的核心实现之一:visitor design pattern访问者模式理解发送pod创建请求的细节visitor design pat... [阅读全文]

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2023  七九推 保留所有权利. 粤ICP备17035492号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com