SRL Archive - Unofficial Development

Memory reading.


jpeg2000

2019-06-01 05:18:15

When you debug, you should cancel the game's low-level mouse hook, or something strange will happen. The other two callback functions were added a long time ago. Acting on thread startup and thread stop, I haven't carefully looked at the two functions and guessed that you will be monitored when you start the thread inside the game. But this can be handled.

titandino

2019-12-28 17:05:47

Is anyone still working on this? As Java support is gone, it would be amazing to be able to have access to the NPC list from memory so I can dump their spawn locations.

alar82

2019-12-29 13:53:13

It still works and it is slow and fragile. Removed it, reason is: my code looks horrible :D

Current working one is uploaded here: https://github.com/pp9999/MemReading/releases/tag/0.1

To run it you put plugin into simba plugins folder and the run the Test script. [ATTACH]28682[/ATTACH]
Where it loads plugins and starts reading through memory. Open console window on simba and check the progress.
It should look something like this:
Where main goal is to find LocalPlayer. Without it nothing works and you have to be logged in.
After that it should finish about in 5 minutes and display debug window.
Decorative object on minimap:
Active objects on minimap:
There are invisible spider eggs at manor farm which are called invisible spider eggs :D
NPCs:

alar82

2020-01-07 02:25:29

When looking trough rs2client.exe hex there is a lot of references to webGL. I wonder why they use webGL for rendering. For a browser game it would be ok but it is installed game.
WebGl doesn't seem to be efficient as well, from looking at wiki: all graphic commands are done by sending string text(javascript?) and compiled in run-time. Wouldn't pre-compiled be much faster?
Why not use normal windows opengl.lib sdk thing :D Meh

It looks like further development of their old html5 client which was also javascript and webGl.

Hoodz

2020-01-08 09:04:59

From: alar82
When looking trough rs2client.exe hex there is a lot of references to webGL. I wonder why they use webGL for rendering. For a browser game it would be ok but it is installed game.
WebGl doesn't seem to be efficient as well, from looking at wiki: all graphic commands are done by sending string text(javascript?) and compiled in run-time. Wouldn't pre-compiled be much faster?
Why not use normal windows opengl.lib sdk thing :D Meh

It looks like further development of their old html5 client which was also javascript and webGl.


because the client is shit.

alar82

2020-01-13 04:17:13

You'l need 64 bit windows Simba. Download it from here: https://github.com/MerlijnWajer/Simba/releases/tag/autobuild-421. Some explation how to use new version of Simba is here:https://villavu.com/forum/showthread.php?t=118470. Unzip it somewhere and then put MemoryError.dll into plugins folder.
Probably breaks again after todays Rs3 update :/

alar82

2020-01-14 10:19:05

It is secret sauce now. For now.

alar82

2020-01-25 16:44:05

Nah this source wouldn't help you as it is shit. If you wanna learn something do it yourself. Post here I wan to see how are you doing.

alar82

2020-01-30 19:28:04

Well it is not total fail. Currently using this for afk event. Those brew hair caldrons give herb xps. Here is the script.

program Test;
{$loadlib MemoryError}
var
Count:Int32;

begin
wait(random(199));
SetupRSReading(True,0);
repeat
wait(340+random(4500));
if (random(100)>90)then begin writeln('P');PlayerIdle(); end;
Count:=Count+1;
begin
if (random(1000)>980)then begin
if FindAobj([114106],1,4,[0,0],[0,0],False,0,'Brew') then
begin
wait(1900+random(5500));
end;
end;
end;
until(Count>10000)
end.

Someone openend and closed github issue to fix BankOpen bool, it would require rewrite interaces logic to get right info. Too much effort.
Well to get character location just use cheat engine.

alar82

2020-01-31 01:28:07

Player coords are those x or y * 512 and search in float.

halfbreed9

2020-01-31 02:04:16

Oh so if I were at x coord 1000 the actual value of that x coord would be 512,000 ?

alar82

2020-01-31 02:51:39

From: halfbreed9
Oh so if I were at x coord 1000 the actual value of that x coord would be 512,000 ?


Yes it would be. Lumby castle in front of top bank booth would be. (Minus half tile 256)
X=3208*512-256=1642752
Y=3220*512-256=1648896
There is also Z but we don't have proper WorldToScreen calculation so it is worthless.
With hex view it looks in memory like this:

00 88 C8 49 00 50 58 45
00 48 C9 49

alar82

2020-02-02 13:27:40

It should. Used this script for pickpocket draynor master farmers.
program Test;
{$loadlib MemoryError}

begin
wait(199);
SetupRSReading(True,0);

repeat
if (random(100)>98)then begin writeln('P');PlayerIdle(); end;
wait(1100+random(1099));
if (FindNPCs1([2234],1,28,[0,0],[0,0],False,0,'Pickpocket')) then
begin
writeln('FF');
wait(1400+random(9500));
end;
wait(1500+random(1099));
until(false)
end.

alar82

2020-02-03 09:30:26

Pointers will never work for rs. There is only 2 ways to get right spot. Dissecting executable somehow as some guy did here, or like me aob scan.

halfbreed9

2020-02-04 17:56:03

Do you happen to have the link to his post ?

alar82

2020-02-05 01:27:03

From: halfbreed9
Do you happen to have the link to his post ?


It is on this thread check few pages back.

titandino

2020-02-05 19:30:40

I really wish this was open sourced so people can learn and contribute to it. Shame the same excitement that drives runelite doesn't drive RS3 developments. I am working on a 2012 remake of RS and there is a ton of information that I would be able to get saving me countless hours. NPC spawns, interface component animations, proj anims, spot anims, etc.

alar82

2020-03-19 09:12:03

Finally some progress. Bank has been found, with slots for all the items.
It is part of interfaces new reading method. Much more powerfull than before now getting all interfaces. Only bad part is finding starting point which is bit shit now. Works only in nxt compability mode and is under test.

go9090go

2020-03-24 09:14:24

I used your code last summer and found that the Components/Widgets/Interfaces are in the same structure as in the java client. Widgets have components and components do have child components. This way i was able to find all interfaces the same way as in the java client.

alar82

2020-03-25 11:58:49

From: go9090go
I used your code last summer and found that the Components/Widgets/Interfaces are in the same structure as in the java client. Widgets have components and components do have child components. This way i was able to find all interfaces the same way as in the java client.


Throw some code here :P I don't know nothing about java.

Main issue is that ReadProcessMemory is horribly slow and if lot is read it goes to snail pace. I wonder how much faster would be read from inside process. Then again I am afraid mess with it, maybe they check loaded stuff.

titandino

2020-03-26 01:15:50

From: alar82
Throw some code here :P I don't know nothing about java.

Main issue is that ReadProcessMemory is horribly slow and if lot is read it goes to snail pace. I wonder how much faster would be read from inside process. Then again I am afraid mess with it, maybe they check loaded stuff.


I can guarantee they have no form of anticheat that checks for hooks.

halfbreed9

2020-03-28 21:59:28

You able to run multiple accounts with this? Or just one ?

Sin

2020-04-02 13:31:08

This is absolutely great work. Do you have Discord or something? Would love to combine this with some sort of ML model.

alar82

2020-04-04 19:15:05

@halfbreed9 It only works for 1 client, haven't bothered to add more as I use it only for my main for boring and simple tasks. Mostly I look how game world is made, that's quite fun.
Added now new interface scraper. Removed old one. New method might be difficult to find with AOB, but with pointer, it goes straight to it.
Now try to fix that BankOpen() bool.

alar82

2020-05-13 16:47:01

Dno… I like to keep it all to myself. Making it perfect and proper would lure lots of people here and it would paint huge red target onto it,… no thank you :)

But about FindAobj it works as FindNPC thing. Use AO debug to find thing to click. Things like portable fletchers are Active Objects.

Use
if (not CheckPAnim(120)) then begin /code/ end;
to check if players is animating. Number there is how many times to check vs 25 milliseconds. Some animations have huge caps between them.

Use
if (InveFull()) then begin /code/ end; 
to check if inventory is full or not.

Use
if (InveItemcount(item1)<3) then begin /code/ end;
to count items in inventory, item1 is ID.

Use
if (InveFreecount()<9) then begin /code/ end;
to check how many spots are free.

Use
 ClickInv(item1,0);
to click item in inventory. Warning there is no check if inventory is actually open. So yea some fail safes should be added.

St Semajian

2020-05-14 02:40:00

From: alar82
Dno… I like to keep it all to myself. Making it perfect and proper would lure lots of people here and it would paint huge red target onto it,… no thank you :)

But about FindAobj it works as FindNPC thing. Use AO debug to find thing to click. Things like portable fletchers are Active Objects.

Use
if (not CheckPAnim(120)) then begin /code/ end;
to check if players is animating. Number there is how many times to check vs 25 milliseconds. Some animations have huge caps between them.

Use
if (InveFull()) then begin /code/ end; 
to check if inventory is full or not.

Use
if (InveItemcount(item1)<3) then begin /code/ end;
to count items in inventory, item1 is ID.

Use
if (InveFreecount()<9) then begin /code/ end;
to check how many spots are free.

Use
 ClickInv(item1,0);
to click item in inventory. Warning there is no check if inventory is actually open. So yea some fail safes should be added.


Yep got it working in the end was use error.
That's a shame but I understand. Would you at least consider exposing a few more functions as getters to have a little more logic? :D

BeatDat

2020-05-14 09:57:14

Can this be used with other programs other than Simba, like AHK or AutoIt?

St Semajian

2020-05-18 09:37:33

Looks like latest game update has broken the sidetext functionality - Is there anything we can provide in the action string parameter that returns immediately? I.E instead of "Mine"? Right now a workaround is to use MouseClick() after the object find - but by the looks of it the FindAObj is trying (3?) times to find the sidetext before closing the statement so it jumps a little before clicking

alar82

2020-05-18 13:30:10

Quick fix applied.
Edit:
It tries few times before giving up, at slightly different pixels to find a match at sidetext.
As for skipping sidetext check, I could add a keyword like " "=space to skip match checking.

alar82

2020-05-30 16:19:48

Anyone know what bot those cursed energy bots use? I tried asking them but nothin, herders didn't wanto spill anything either.

halfbreed9

2020-06-07 03:40:22

It's not just 1 person it's two actually. I know both of them. How did you go about getting the GameObjects ? Trees mining rocks bank stalls etc?

titandino

2020-06-10 15:00:45

From: alar82
Anyone know what bot those cursed energy bots use? I tried asking them but nothin, herders didn't wanto spill anything either.


Hey, I am working on programming Herblore Habitat for my RSPS and I am in need of the actual spawns list of invisible jadinkos within the area. Your tool shows them on the minimap, but doesn't give the ID or location elsewhere or any way of looping over the list.

I would pay you for the simple source code just to retrieve a list of NPCs and their IDs/Positions that are being updated (whether or not they are being rendered or hidden via varbits).

alar82

2020-06-10 23:33:52

From: titandino
Hey, I am working on programming Herblore Habitat for my RSPS and I am in need of the actual spawns list of invisible jadinkos within the area. Your tool shows them on the minimap, but doesn't give the ID or location elsewhere or any way of looping over the list.

I would pay you for the simple source code just to retrieve a list of NPCs and their IDs/Positions that are being updated (whether or not they are being rendered or hidden via varbits).


Had a look, yes there are invisible npcs. Can't add them to 3d world debug, they don't have clickbox. Added some more debug options to npc minimap, NPCInfoMap1 switches between name and id. Nothing is simple :D
Currently using it to watch seren spirit spawn. Clicking npcs is odd, needs rework. Found also booleans for inventory closed and open states.

titandino

2020-06-11 13:04:40

From: alar82
Had a look, yes there are invisible npcs. Can't add them to 3d world debug, they don't have clickbox. Added some more debug options to npc minimap, NPCInfoMap1 switches between name and id. Nothing is simple :D
Currently using it to watch seren spirit spawn. Clicking npcs is odd, needs rework. Found also booleans for inventory closed and open states.


Yeah when I said simple, I meant even a stripped simple CLI program that only reads NPCs and nothing else.

alar82

2020-06-13 09:46:37

At tit nah.
At halfbreed9 all are on tiles. Players are on tiles, npcs are, objects are.

Lucidity

2020-06-13 10:04:06

Very cool stuff, I checked it out. You should definitely expand the include so it could be used for multiple instances, seems primarily based for PvM. Would like to see some interaction options with players, options to click on tiles instead of on the minimap (TileWalk?). Keep it up!

alar82

2020-06-14 13:19:29

Well player interaction would be possible if someone had time to code it.
Added 2 new functions:
CheckInvOpen();
- to check if inventory is open or closed.
OpenInv();
- to check if inventory is open and if not then try to open it with menu icon. Menu icon must be in front and not in slider menus. Slider menus are like labyrinth, I don't have no time and brainpower to dissect them.

program Test;
{$loadlib MemoryError}

begin
wait(199);
SetupRSReading(True,0);
wait(100+random(1099));
repeat
wait(5000+random(1099));
Writeln(CheckInvOpen());
OpenInv();

//Writeln(BankOpen());
//Writeln('Coordinates: ',GetPCoords());
//Writeln('Floor: ',GetPFloorLv());
//Writeln('HP: ',GetHP());
until(false)
end.
Edit: Crash Fixes. Now can open inventory tab if it is on wrong one.
Edit: Added area loot window debug.
Edit: Today investigating camera I has discovered that camera is on tile.
That z goes to small numbers if camera is moved close to ground. That is funny, like it would be psychical camera.
I was looking for viewport stuff. Like osrs has. Trough power of openosrs:
OverlayUtil.renderTextLocation( graphics, new Point(client.getCanvasWidth() / 11, 20), "x " + String.valueOf(client.getCameraX()), Color.WHITE);
Osrs:
Dosent look similar numbers, maybe it would have diffrent values if I could directly read raw values of hooks.
But maybe I am reading wrong spot from rs3

mkmk4

2020-07-03 22:38:43

Would love to be able to use this in a python bot I'm working on… For now I'm just using OpenCV to detect objects (doesn't work too well for npcs tho). I also tried machine learning but it is too resource intensive. Could you share source maybe on junior forums so it's not just out for the public? I would be willing to contribute and we could all learn a lot from it. I did some messing around with cheat engine and was able to get the coordinates and figure out some of the inventory stuff but beyond that I'm lost at how to find the npc objects and their values…

userNote

2020-07-06 12:25:15

Hey, great stuff you have been doing!, already made use of your dll and it seems great!, atm im making my own, but having trouble finding viewMatrix for runescape 3, could u give me a hand or a tip?? thanks!!

alar82

2020-07-14 13:29:04

@mkmk4 Yes putting it all together from cheatengine hex is a difficult.
@userNote If you get that viewmatrix working please loan it :D It would help a lot.

Added
GetAllNPCs;
gets all npc into Simba.
For v1400 of Simba. Older gives access error.
https://github.com/ollydev/Simba/releases

program Test;
{$loadlib MemoryError}

var
i,hi: Integer;
store: Array of AllObjects;
begin
wait(199);
SetupRSReading(True,0);
wait(100+random(1099));
repeat
wait(5000+random(1099));
//Writeln(GetAllNPCs());
store:=GetAllNPCs();
hi := High(store);

for i := 0 to hi do
begin
writeln(
"Name:",store[i].Name,
". Hitpoints:",store[i].Life,
". ID:",store[i].Id,
". X:",store[i].TileX,
". Y:",store[i].TileY,
". Z:",store[i].TileZ
);
end;

until(false)
end.

Little test script for it.
Also discovered that if I move my plugins vector arrays from headers to cpp-s it gets much faster. Probably something to do with CPUs L2/L3 cashe.

userNote

2020-07-14 13:34:38

hey yeah, found the viewmatrix, but i cant send links here :P nor images, so how am i about to send it?

alar82

2020-07-14 13:38:25

From: userNote
hey yeah, found the viewmatrix, but i cant send links here :P nor images, so how am i about to send it?


Paste code here or github. OR https://postimages.org/
Uploaded new plug into github btw.

userNote

2020-07-15 23:59:38

Hey sorry for the late reply, well I didn't write the code yet, been busy with other stuff, as I mentioned earlier, I can't send links here nor write code ( the forum don't allow me to post any links or image and so on, cause I'm new here ) don't u have any contact info like discord or anything similar ( villavu requires me to have 10+ posts )

alar82

2020-07-19 07:05:04

Nah no discord. Found another crash cause.
Edit: Found more and fixed them hopefully.
Edit2: Found out that pixels for AllObjects were wrongfully copy pasted.
@Lucidity I has my doubts. Someday?
Edit3: Made npcs/objects cleanup cleaner.

alar82

2020-08-16 22:39:43

Hey guys i noticed this thread on another forums.>https://guidedhacking.com/threads/how-to-find-the-runescape-viewmatrix.15435/
Has anyone managed get that viewmatrix thing working? I can find it easily and load those 16 floats into that formula. But nothing sensible comes out of it. Tryed many diffrent spots aswell to sorta bruteforce it.
Yea it leads to here.
Tried to use that 0.99 as start and 1.79, read from that point 4 byte size floats in 16 times into array of floats and then unload them onto matrix multi thing.
Entity is raw float of our character location.

float screenW = entity.x * Mx.at(3) + entity.y * Mx.at(7) + entity.z * Mx.at(11) + Mx.at(15);
float screenX = (entity.x * Mx.at(0) + entity.y * Mx.at(4) + entity.z * Mx.at(8) + Mx.at(12)) / screenW;
float screenY = (entity.x * Mx.at(1) + entity.y * Mx.at(5) + entity.z * Mx.at(9) + Mx.at(13)) / screenW;

WPOINT rs = GetRsResolution2();
float camX = rs.x / 2.f;
float camY = rs.y / 2.f;
float screenx = (camX * screenX) + (screenX + camX);
float screeny = -(camY * screenY) + (screenY + camY);

return{ screenx, screeny };

userNote

2020-08-17 22:28:48

You're in luck haha, I'm Rablidad, i said you before i had the viewmatrix, what happens is that runescape is a weird game and they use Row major with OpenGL

alar82

2020-08-18 02:33:47

From: userNote
You're in luck haha, I'm Rablidad, i said you before i had the viewmatrix, what happens is that runescape is a weird game and they use Row major with OpenGL


Thanks for hint, now i can start messing with it again. You can start pm-ing people here if you get higher forum rank. Need like 30 post for that.

alar82

2020-08-19 04:19:44

Hey Rabli
Any idea what floats should I start from :D ? and are those floats in normal order? x y z?

Clarity

2020-09-01 15:46:18

Interesting progress over the years. Do you have plans to re-open the source or are you keeping it closed forever?
Good luck :)

alar82

2020-09-10 23:36:40

Hey thanks Clarity. I am waiting userNote to share is WorldToScreen - ViewMatrix, it would take displaying stuff to another level. Any minute now.
Edit: Answering a question.
Is there capability to right click NPCs to select an option that isnt left clickable? Can only see how to do it crass atm by mousemoving with TPoint of MouseLoc on right click.

Hello. You mean choose option menu and choose option from there? Sadly it is a separate thing from interfaces. So my reader has no idea what is in it. However I have found location in memory that contains all that info but it has to be reconstructed to make use of it. Maybe someday.

But as you said you can use static coordinates to aim for option.
FindNPCs1([66],1,20,[0,0],[0,0],False,0,'Attack');
That 0 between False and Attack is mouse options. 0 left click, 1 right click, 2 move mouse.
So maybe you can use:
Aim for npc menu and if we get lucky it opens it
FindNPCs1([66],1,20,[0,0],[0,0],False,1,'Attack');
Using Simba:
Get current mouse position.
GetMousePos(X,Y);
Add static pixels to the option needed. Mouse is always at top of choose option menu and in middle so + to go down.
MoveMouse(X,Y+40);
ClickMouse(X,Y+40);
Using plugins mouse functions. Proper way to do it:
Pos_xy:Tpoint;
//War Npc in wars retreat, opens up shop option.
if (FindNPCs1([26773],1,20,[0,0],[0,0],False,1,'Talk')) then
begin
Pos_xy:=MousePos();
Pos_xy.Y:=Pos_xy.Y+40;
MouseClick(Pos_xy,TRUE);
wait(5000);
end;
Updated plug again. Hey added new method of interfaces thing stuff something.

willin275

2020-11-07 17:36:46

How do i use your plugin? i have downloaded plugins.7z

alar82

2020-11-07 17:44:46

From: willin275
How do i use your plugin? i have downloaded plugins.7z


Put MemoryError.dll into plugins folder. Then when u use script that uses it, press run and check console window to see if anything is happening. I would use older simba(1.3) because it keeps plugin running even if script is stopped.

willin275

2020-11-07 18:08:51

thanks for the fast reply, now when i run a script i get a warning that the apps are not on the same scaling level?

alar82

2020-11-07 18:20:46

From: willin275
thanks for the fast reply, now when i run a script i get a warning that the apps are not on the same scaling level?


They must be at same size thing. Right click at simba exe and choose properties and from there compatibility. From there change high dpi setting and override dpi. Switch between application and system to see which one works.

forest seed

2020-11-09 00:08:15

From: alar82
They must be at same size thing. Right click at simba exe and choose properties and from there compatibility. From there change high dpi setting and override dpi. Switch between application and system to see which one works.


hi alar82, do you have a discord i can add?, im attempting to develop the sauce into a standalone application.

alar82

2020-11-13 10:00:33

From: forest seed
hi alar82, do you have a discord i can add?, im attempting to develop the sauce into a standalone application.

Try SRL discord.

Lucidity

2020-12-08 12:04:03

The function:
GetPCoords()

is displaying incorrect values, at least on the Y variable in my testings.

Used the latest update and the PlayerInArea function was reading false even though code hasn't changed. Determined cause to GetPCoords()

- Could you release source so we could fix issues like this ourselves?

alar82

2020-12-08 15:50:12

Hmm I tested it at it looks fine.

Writeln(GetPCoords());
It gives out those exact coordinates that are in upper corner of debug(rounded down).
At least it should.
What number are you getting from there?

Edit: updated plugin.
Removed all scripts and added up again.

Lucidity

2020-12-08 22:02:50

From: alar82
Hmm I tested it at it looks fine.

Writeln(GetPCoords());
It gives out those exact coordinates that are in upper corner of debug(rounded down).
At least it should.
What number are you getting from there?

Edit: updated plugin.
Removed all scripts and added up again.


It's showing up as X 0 and Y 0 for me.

alar82

2020-12-09 15:22:38

Yes. FIX it.

Uploaded code onto GitHub as private. Wanto fixit? Ask invite from
https://discord.gg/ywSDHbXmF5


Edit fixes for localplayer finding.

ogustuce

2021-02-20 22:44:34

@alar82 why when i copy paste your functions i get too many parameters error? like i understand i'd have to teak the parameters but they straight up don't work

BeatDat

2021-02-21 13:36:47

Post a snippet of the code so we can see what is going on.

alar82

2021-03-28 14:37:08


Recently trying to make somekind of GUI to it.

alar82

2021-06-18 00:52:58

Works fine.

alar82

2022-07-24 08:07:30

Still working.