After glider went down, I thought I would give it a go at creating my own bot, for my own personal use, if it worked well enough perhaps even release it here.
However im having some trouble reading the memory and thought i would come here and see if anyone has any pointers, any help would be most gratefully received.
Here is my code thus far, yes i appreciate its a little messy and may seem illogical but its the start of a bigger picture and the way i see it working at the moment
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Magic;
using System.Diagnostics;
using System.Threading;
namespace Icherus
{
public partial class MainForm : Form
{
static public BlackMagic Memory;
private List<int> dwProcesses;
private int dwProcessId;
//Offsets
uint PlayerBase = 0;
uint UnitField = 0;
uint XMemValue = 0x7D0;
uint YMemValue = 0x7D4;
uint ZMemValue = 0x7D8;
float XValue = 0;
float YValue = 0;
float ZValue = 0;
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
LogBox.Items.Add("Icherus Loaded...");
}
private void button1_Click(object sender, EventArgs e)
{
LogBox.Items.Add("Now looking for the wow process");
dwProcessId = getProcesses()[0];
LogBox.Items.Add("Attempting to hook into wow");
attachToProcess();
}
private List<int> getProcesses()
{
dwProcesses = new List<int>();
int num = 0;
// cmbProcess.Items.Clear();
foreach (Process process in Process.GetProcessesByName("Wow"))
{
dwProcesses.Add(process.Id);
LogBox.Items.Add("WOW Found: Process ID: " + process.Id + " Window Title: " + process.MainWindowTitle);
num++;
}
if (dwProcesses.Count == 0)
{
dwProcesses.Add(0);
LogBox.Items.Add("Now WoW process found, make sure WOW is running");
}
return dwProcesses;
}
private void attachToProcess()
{
if (dwProcessId != 0)
{
Memory = new BlackMagic();
Memory.OpenProcessAndThread(dwProcessId);
LogBox.Items.Add("Hooked into wow...");
LogBox.Items.Add("Getting character information...");
getcharinfo();
}
else
{
LogBox.Items.Add("Could not hook into wow, has the process been closed?");
}
}
private void getcharinfo()
{
getxyz();
}
private void getxyz()
{
PlayerBase = Memory.ReadUInt(Memory.ReadUInt(Memory.ReadUInt(0x010B65F4) + 0x30) + 0x28);
XValue = Memory.ReadFloat(PlayerBase + XMemValue);
LogBox.Items.Add("XPos: " + XValue);
YValue = Memory.ReadFloat(PlayerBase + YMemValue);
LogBox.Items.Add("YPos: " + YValue);
ZValue = Memory.ReadFloat(PlayerBase + ZMemValue);
LogBox.Items.Add("ZPos: " + ZValue);
}
}
}
However, its throwing an error up at
[code]PlayerBase = Memory.ReadUInt(Memory.ReadUInt(Memory.ReadUInt(0x010B65F4) + 0x30) + 0x2
;[/quote]
saying it cant read the Uint.
Any help would be greatly appreciated....