SRL Archive - Devs' Corner

function R_HooksOutdated: boolean;


marpis

2011-01-13 14:25:36

Thoughts?

EDIT: Hmm, a few changes coming in a minute
EDIT2: Nope, no changes. MyPos is (8, 8) in the login and in the lobby on every tab.


function R_HooksOutdated: boolean;
var
P: TPoint;
begin
if (not LoggedIn) then
begin
P := GetMyPos;
if P.X <> 8 and P.Y <> 8 then
Result := True;
end else
Result := not R_LoggedIn;
end;

Sir R. M8gic1an

2011-01-13 21:00:26

What if inventory or object hooks are outdated?

Or would this work for all?

~RM

marpis

2011-01-14 00:20:07

From: Sir R. Magician
What if inventory or object hooks are outdated?

Or would this work for all?

~RM


I thought they usually change them all? Some reflection dev please comments!

marpis

2011-01-15 07:13:37

BUMP! Come on guys!

JPHamlett

2011-01-15 11:03:12

Jagex changes all hooks at once, I believe, but why not just do something like this?


function R_HooksOutdated: boolean;
begin
result := LoginIndex = -1
end;


Keep in mind I'm very tired, so this may not work at all.

marpis

2011-01-15 12:38:08

From: J_Pizzle
Jagex changes all hooks at once, I believe, but why not just do something like this?


function R_HooksOutdated: boolean;
begin
result := LoginIndex = -1
end;


Keep in mind I'm very tired, so this may not work at all.


Well, if LoginIndex does return -1 everytime when hooks are out, then yea. I don't know how LoginIndex works.

But I need this very quickly to be in reflection! thanks :)

JPHamlett

2011-01-15 14:18:34

Well, I cant really update seeing as how I never got any permissions to do so.

Sir R. M8gic1an

2011-01-15 19:13:55

From: J_Pizzle
Well, I cant really update seeing as how I never got any permissions to do so.


PM Naike.

Also, what about unstable hooks in the updater?

Could we do a full checker for when hooks break?

Is there a way to check if inventory hooks are broken and have a script returning what hooks are truely broken, no matter what the updater says?

~RM

pyroryan

2011-01-15 19:44:37

From: Sir R. Magician
PM Naike.

Also, what about unstable hooks in the updater?

Could we do a full checker for when hooks break?

Is there a way to check if inventory hooks are broken and have a script returning what hooks are truely broken, no matter what the updater says?

~RM


Almost always hooks change every RS client update. "Almost" because there is still a chance that they don't as its random.
The most reliable way is probably to check the client version. In the class "client", method "main", check for the SIPUSH opcode that carries an index that is between 400 and 1000, and not 768 nor 1024. You can narrow the range if you want, obviously there are some flaws within this system (i.e. version 768), but that can be dealt with later (fix isn't hard). If RS updates the client, its pretty safe to assume that they'll bump the client version and the hooks will change.
As for checking specific hooks, you could make an account just for testing. Hard-code everything about the account and see if reflection can provide accurate information about the character. For location, hard-code location and check by having reflection get the location of the character. Same thing for inventory items. For NPCs and Objects, just leave the character near some rocks and NPCs and see if reflection can get the info. Etc.

Sir R. M8gic1an

2011-01-15 22:10:14

From: pyroryan
Almost always hooks change every RS client update. "Almost" because there is still a chance that they don't as its random.
The most reliable way is probably to check the client version. In the class "client", method "main", check for the SIPUSH opcode that carries an index that is between 400 and 1000, and not 768 nor 1024. You can narrow the range if you want, obviously there are some flaws within this system (i.e. version 768), but that can be dealt with later (fix isn't hard). If RS updates the client, its pretty safe to assume that they'll bump the client version and the hooks will change.
As for checking specific hooks, you could make an account just for testing. Hard-code everything about the account and see if reflection can provide accurate information about the character. For location, hard-code location and check by having reflection get the location of the character. Same thing for inventory items. For NPCs and Objects, just leave the character near some rocks and NPCs and see if reflection can get the info. Etc.


If I were to do that I'd make a hybrid color reflection script that checks if the hooks are broken while it works and then I'd have it report broken hooks and I'd post them here.

But such a system has been in planning for a while ;)

But that sounds great and I guess it does answer both mine and marpis' question.

Your function wouldn't work in the scenario that some hooks broke, but it'd work in most scenarios with the suggested changes ;)

~RM