So, i'm trying to use the offsets in C#, but i can't find anything usefull on the internet.. I just wanna do it like this, Char name: bla bla , and such stuffs. But i can't find an example on how to do it. ( I know how to get the offsets from sro, just need them to add them into C# and let it show up on a GUI)
well now you could create a new class e.g. using the Program.cs
and read the specific memory entries:
(you have to replace the pointers / offsets with them of your sro client)
Code:
using System;
using System.Linq;
using System.Text;
using Game.Memory;
namespace main
{
class Program
{
private static bool exit = false;
static void Main(string[] args)
{
while (!exit)
GetLine(Console.ReadLine());
}
private static void GetLine(string cmd)
{
Memory mem = new Memory("sro_client");
switch (cmd)
{
case "curhp":
int curhp = mem.ReadOffset(0x00A8913C, 0x1D4);
Console.WriteLine("Current HP: {0}", curhp);
break;
case "maxhp":
int maxhp = mem.ReadPointer(0x00AA0740);
Console.WriteLine("Maximum HP: {0}", maxhp);
break;
case "name":
string name = mem.ReadString(0x00A9FB98);
Console.WriteLine("Charname: {0}", name);
break;
case "exit":
exit = true;
break;
}
}
}
}
well you can rewrite them to float or to any other size than 4 byte if needed.
i just wanted to give an example for std. memory reading on sro (most necessary values are 4 byte)
well you can rewrite them to float or to any other size than 4 byte if needed.
i just wanted to give an example for std. memory reading on sro (most necessary values are 4 byte)
By the posts of the requester, I saw he wasn't really experienced.
That's why I tried to tell you to note these things when you release something to less-experienced people.
By the posts of the requester, I saw he wasn't really experienced.
That's why I tried to tell you to note these things when you release something to less-experienced people.
i see
i would propose to Janick to use autoit if it is just simple memory reading.
this works pretty well, too and you don't need to have much knowledge about programming to create a simple program. As i read on your first post you want to create a gui to display the stats of a character.
simple example using autoit:
Ty for everyone's help, and well i don't wanna use autoit because i wanna continue learning C# and make more programs with it^^ and yes im not really experienced yet. Would be great if you can help me a bit with the program i wanna make and maybe make some instructions from what is what and stuff it would be great.
using System;
using System.Linq;
using System.Text;
//include namespace Game.Memory
using Game.Memory;
namespace main
{
class Program
{
//Creating var
private static bool exit = false;
//Main function (runs on program start)
static void Main(string[] args)
{
//As long as exit is not true..
while (!exit)
//Call function GetLine with Console Input
GetLine(Console.ReadLine());
}
//GetLine function
private static void GetLine(string cmd)
{
//Create object of class Memory
Memory mem = new Memory("sro_client");
//Switch Console input
switch (cmd)
{
//If Console input = curhp
case "curhp":
//Call function ReadOffset of the mem object (returns int)
int curhp = mem.ReadOffset(0x00A8913C, 0x1D4);
//Output the result
Console.WriteLine("Current HP: {0}", curhp);
break;
//If Console input = maxhp
case "maxhp":
//Call function ReadOffset of the mem object (returns int)
int maxhp = mem.ReadPointer(0x00AA0740);
//Output the result
Console.WriteLine("Maximum HP: {0}", maxhp);
break;
//If Console input = name
case "name":
//Call function ReadOffset of the mem object (returns string)
string name = mem.ReadString(0x00A9FB98);
//Output the result
Console.WriteLine("Charname: {0}", name);
break;
//If Console input = exit
case "exit":
//Set exit true (program terminates)
exit = true;
break;
}
}
}
}
Memory.cs
Code:
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace Game.Memory
{
class Memory
{
//import kernel32 and create OpenProcess and ReadProcess functions
[DllImport("kernel32.dll")]
static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Boolean bInheritHandle, UInt32 dwProcessId);
[DllImport("kernel32.dll")]
static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress,
byte[] lpBuffer, UIntPtr nSize, uint lpNumberOfBytesWritten);
//Create handle
IntPtr Handle;
//constructor
public Memory(string sprocess)
{
//Get the specific process
Process[] Processes = Process.GetProcessesByName(sprocess);
Process nProcess = Processes[0];
//access to the process
Handle = OpenProcess(0x10, false, (uint)nProcess.Id);
}
//function ReadString (returns string value)
public string ReadString(uint pointer)
{
//Create bytearray
byte[] bytes = new byte[24];
//Read the specific address within the process
ReadProcessMemory(Handle, (IntPtr)pointer, bytes, (UIntPtr)24, 0);
//Return the result as UTF8 String
return Encoding.UTF8.GetString(bytes);
}
//function ReadOffset (returns int value)
public int ReadOffset(uint pointer, uint offset)
{
//Create bytearray
byte[] bytes = new byte[24];
//Creating the address (reading the Base and add the offset)
uint adress = (uint)ReadPointer(pointer) + offset;
//Reading the specific address within the process
ReadProcessMemory(Handle, (IntPtr)adress, bytes, (UIntPtr)sizeof(int), 0);
//Return the result as 4 byte int
return BitConverter.ToInt32(bytes, 0);
}
//function ReadPointer (returns int value)
public int ReadPointer(uint pointer)
{
//Create bytearray
byte[] bytes = new byte[24];
//Reading the specific address within the process
ReadProcessMemory(Handle, (IntPtr)pointer, bytes, (UIntPtr)sizeof(int), 0);
//Return the result as 4 byte int
return BitConverter.ToInt32(bytes, 0);
}
}
}
offsets? 08/06/2010 - Aion - 0 Replies well i've found a thread called offsets with such a long list of weird numbers xD i wonder what's that and how i can use it :P can any1 be nice enoguh 2 explain?=)
Offsets - Help me out! 03/30/2010 - Final Fantasy XI - 4 Replies So, I've looked all over. Every free site, and even worked my way into pay-only sites. Working offsets are not to be found, meaning I can't run ANY of these programs. I've even tried to figure out how to get them myself, but that program is beyond me. I was wondering if anyone had these, this would be a wonderful place to post them! ^.^
CE Offsets WoW 3.3.2 03/10/2010 - WoW PServer Exploits, Hacks & Tools - 7 Replies Hi there.
Any one has them?
They are a bit other than at 3.3.0.
mob offsets 11/14/2008 - Dekaron Private Server - 16 Replies where do the mob offsets for 1000x start?