最近閒來無事發現周圍的朋友都在玩《植物大戰僵屍》的游戲!於是動了制作這游戲工具的念頭!雖然在網上同類工具很多 但是用C#寫的我幾乎看不到!所以我想用C#寫一個!
首先用CE或者OD或者其他反匯編工具找出游戲的內存基址!
游戲內存基址:base = 0x006A9EC0
游戲陽光地址:[base+0x768]+0x5560
游戲金錢地址:[base+0x82C]+0x28
游戲關卡地址:[base+0x82C]+0x24 //關卡如:A-B 實際值為:(A-1)×10+B
至於如何獲取這些地址不在我們這論壇研究的范圍中!
對了我是用工具vs2008編寫的!
新建窗體:
using System; using System.Drawing; using System.Text; using System.Windows.Forms; namespace PlantsVsZombiesTool { /// <summary> /// /// </summary> public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } //啟動無線陽光 private void btnGet_Click(object sender, EventArgs e) { if (Helper.GetPidByProcessName(processName) == 0) { MessageBox.Show("哥們啟用之前游戲總該運行吧!"); return; } if (btnGet.Text == "啟用-陽光無限") { timer1.Enabled = true; btnGet.Text = "關閉-陽光無限"; } else { timer1.Enabled = false; btnGet.Text = "啟用-陽光無限"; } } private void timer1_Tick(object sender, EventArgs e) { if (Helper.GetPidByProcessName(processName) == 0) { timer1.Enabled = false; btnGet.Text = "啟用-陽光無限"; } int address = ReadMemoryValue(baseAddress); //讀取基址(該地址不會改變) address = address + 0x768; //獲取2級地址 address = ReadMemoryValue(address); address = address + 0x5560; //獲取存放陽光數值的地址 WriteMemory(address, 0x1869F); //寫入數據到地址(0x1869F表示99999) timer1.Interval = 1000; } //啟動無線金錢 private void btnMoney_Click(