SRL Archive - OSR Help

Getting Information from memory


ActualNoob

2013-07-24 14:13:55

So i have gotten a working bot for this game, but i would like to try and get useful information like coordinates,hp, sp etc without having to use whats visible on the screen.
Iam using http://villavu.com/forum/showthread.php?t=99380 by CynicRus to try and read from memory, but its giving me unexpected values. Hopefully someone can help.

using a memory editing program i was able to find the values and they agree with the ingame values, but when i try use simba to access these memory addresses it goes bananas.


program new;
{$loadlib bothelper.dll}
var
PID :Integer;
HP,SP : Integer;
HP_MAX, SP_MAX : Integer;
Handle : Integer;

begin
PId:=GetProcessIdByName('App.exe');
Handle:=GetWndHandleByPid(PId);

HP:=ReadMemoryFromPID(PId,$00884070,4);
HP_MAX:=ReadMemoryFromPID(PId,$00884074,4);

SP:=ReadMemoryFromPID(PId,$00884078,4);
SP_MAX:=ReadMemoryFromPID(PId,$0088407C,4);
WriteLn('my hp is ' + tostr(hp) + '/' + tostr(HP_MAX));
WriteLn('my sp is ' + tostr(hp)+ '/' + tostr(SP_MAX));
end.

OUTPUT

Compiled successfully in 16 ms.
my hp is 4246695/4246695
my sp is 4246695/4246695
Successfully executed.

Kevin

2013-07-24 14:19:44

I'm not sure how consistent these values would remain due to how jagex likes to update their games so I am not advocating this…

However, ignoring that comment, I'm curious why you have the '$' in front of the offset memory locations?

ActualNoob

2013-07-24 14:31:52

its not for runescape its for a game called ragnarok.
I will be the first to admit iam a noob at this. so correct me if iam wrong.
i thought '$hex' lets simba know its a hexadecimal value.

Kevin

2013-07-24 14:37:15

Just use a decimal converter like on the calculator that comes with windows:

00884070 in hex becomes 8929392 in decimal and there's no need for simba to possibly get confused (pascalscript is an iffy language for that stuff).

ActualNoob

2013-07-24 19:18:19

Thanks for helping Kevin, but the problem grows… so ive tried to convert it to decimal values, but its still giving me junk values.
What works, however, is if i read memory using C++. There are two problems now:

1)i don't know any C++.
2)can i somehow port this code into simba?

ActualNoob

2013-07-27 07:58:10

I managed it working by editing CynicRus's library adding debug privileges http://msdn.microsoft.com/en-us/library/windows/hardware/ff541528%28v=vs.85%29.aspx, but i still cant get the coordinates.

Here is the problem. There are many(around 40) static addresses for coordinates, but they ALL change when there is a actor (monster, npc or another player) on screen. If there is no-one else on screen i can get my coordinates. There is also a non-static address containing my x and y coordinate, but of course they change when i either close my game down or change map.

I cannot attach a debugger to the game because it can detect it.

Does anyone know a process/how to get my coordinates given the above information?

bgtemp

2013-08-06 18:18:37

Here is the problem. There are many(around 40) static addresses for coordinates, but they ALL change when there is a actor (monster, npc or another player) on screen. If there is no-one else on screen i can get my coordinates. There is also a non-static address containing my x and y coordinate, but of course they change when i either close my game down or change map.


Look on some Cheat Engine tutorials about finding pointers ,but it's not easy stuff and yu need to read ASM code.