PDA

View Full Version : OpenGL Interception



Ixen
02-19-2014, 12:33 AM
Over the last few months, as a pet project I've occasionally been working on OpenGL interception-based object finding. With the advent of RuneScape 3 (and RuneTek 5), much has changed since silentwolf came out with his first OGL hook (more than four years ago now!). Hence, I thought I'd document here my progress and some notes which may help anyone trying this themselves. I plan to release the source code for learning purposes sometime in the future, after I've ironed out a few remaining bugs.

Most of what I've done should be able to be applied to the Direct3D engine as well: I'm looking into hooking that as well.

So far, I've been able to recognize models, items and interface icons. Not a much higher step up from what Aftermath achieved, but again, much has changed in RuneTek 5.
https://dl.dropboxusercontent.com/u/67341745/test/Scrshot.png

I'm stuck on generating constant checksums for images, however - the image colours vary (see notes below). Hashing a binary array of bytes for each pixel (1 if alpha > 240 otherwise 0) works fine to create static ids for items, but if the items have the same shape (as is often the case: runes; logs; armour) they are detected as the same. I've attempted to factor in different terms such as average colour, but nothing I've tried so far has been able to produce unique ids. Any help on this point would be appreciated.

Notes

Widgets

All widgets have a constant size, are drawn in immediate mode with GL_QUADS (4 vertices) and have a texture coordinate sum of 4 (one texture per item)


Widget
Size


Items
36x32


Tab icons
24x24


Ability icons
30x30


Settings icons
32x32



Their textures are always bound as GL_TEXTURE_2D (no longer GL_TEXTURE_RECTANGLE[_ARB]
All textures I've come across are in ABGR pixel format
A slight pixel colour change is applied periodically over each texture. A much larger pixel colour change is applied between logon sessions

Models

All stored as VBOs, always of type GL_FLOAT
Some groups of entities are drawn with the same stride


Stride
Entities


12
Players


16
NPCs; some trees; beacons


24
misc; fences; roofs


28
misc; roses; roofs


36
ground items; ground; some trees; roofs



Many entities share the same vertex buffer

Kevin
02-19-2014, 01:36 AM
Now I don't mean to dissuade you in any way, but Brandon already has a setup for both OGL and DX
http://villavu.com/forum/showthread.php?t=102735
and
http://villavu.com/forum/showthread.php?t=107256

But that doesn't mean this can't be a learning project for you and the current bugs you have may be improved upon by him (or other experienced members here).

riwu
02-19-2014, 10:34 AM
Brandon's ogl plugin is perfect, but the directX plugin is color only since he hasn't got the time to work on DX interception, perhaps you could help with that?

Also you could get on opengl mode for RS3 atm? For me the client instantly crashes when i switch to ogl mode.