SRL Archive - Bot Information and Spottings

Use your hardware mouse!


alar82

2017-10-31 23:37:30

It shouldn't reach to right console at all if new keyboard hooks are blocked. Its your old code.

LRESULT CALLBACK MyKeyboardHook(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode == HC_ACTION)
{
KBDLLHOOKSTRUCT* keyboardHookPointer = (KBDLLHOOKSTRUCT *)lParam; //Cast.
/*
if ((keyboardHookPointer->flags & LLKHF_LOWER_IL_INJECTED) || (keyboardHookPointer->flags & LLKHF_INJECTED))
{
cout << "kFake \n";
}
else {
cout << "kHardware \n";
}
*/
keyboardHookPointer->dwExtraInfo = 0;
keyboardHookPointer->flags &= ~LLKHF_LOWER_IL_INJECTED; //Remove flag.
keyboardHookPointer->flags &= ~LLKHF_INJECTED; //Remove flag.
}
return CallNextHookEx(_hook, nCode, wParam, lParam); //Give Jagex the modified parameters.
}

void Keyhook()
{

if (!(_hook = SetWindowsHookEx(WH_KEYBOARD_LL, MyKeyboardHook, 0, 0)))
{
MessageBox(NULL, "Failed to install hook!", "Error", MB_ICONERROR);
}
}

LRESULT CALLBACK MyMouseHook(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode == HC_ACTION)
{
MSLLHOOKSTRUCT * mouseHookPointer = (MSLLHOOKSTRUCT *)lParam; //Cast.
/*
if ((mouseHookPointer->flags & LLMHF_INJECTED) || (mouseHookPointer->flags & LLMHF_LOWER_IL_INJECTED))
{
cout << "mFake \n";
}
else {
cout << "mHardware \n";
}
*/

mouseHookPointer->dwExtraInfo =0;
mouseHookPointer->flags &= ~LLMHF_LOWER_IL_INJECTED; //Remove flag.
mouseHookPointer->flags &= ~LLMHF_INJECTED; //Remove flag.
}
return CallNextHookEx(_hook2, nCode, wParam, lParam); //Give Jagex the modified parameters.
}

void Mousehook()
{
if (!(_hook2 = SetWindowsHookEx(WH_MOUSE_LL, MyMouseHook, 0, 0)))
{
MessageBox(NULL, "Failed to install hook!", "Error", MB_ICONERROR);
}
}

int StartHookin(){
HookinActive = TRUE;
Keyhook();
Mousehook();
cout << "Passive hooker started \n";
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)>0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
cout << "Hooking ended \n";
return 0;
}

Thomas

2019-12-29 07:52:50

From: Brandon
@pipilica; If that's actually happening, just inject it into the process you want to work around. That would immediately remedy the issue. I didn't check if the hook works for the entire system, just the process that loaded it because that's how we use SMART and Simba. For NXT, I had it in my own OpenGL32.dll and D3D9.dll.

In any case, for other specific processes you can do:

CreateProcess Suspended, Inject, ResumeProcess.

OR if you want it system-wide (literally for the entire system – I don't see a use for this though), then hook with WH_KEYBOARD/WH_MOUSE first (a per process hook.. Every process that is started on Windows will get an instance of your hook/dll). Then within that hook, load the blocker which does WH_KEYBOARD_LL/WH_MOUSE_LL (a low level hook). This way, each process gets the dll loaded and the hook will apply to that process automatically.


Example:

WH_KEYBOARD (System will load this .dll into EVERY process).
In WH_KEYBOARD callback -> SetWindowsHookEx(WH_KEYBOARD_LL..);


Could you please spoon feed me and explain how to make NXT load the Blocker.dll file?

Sasstraliss

2020-03-08 04:09:30

Do we know if Jagex is now using those hooks to check if input is hardware or not on OSRS. Earlier in this thread (2016) it was there but not used.

Kasi

2020-03-08 08:30:21

From: Sasstraliss
Do we know if Jagex is now using those hooks to check if input is hardware or not on OSRS. Earlier in this thread (2016) it was there but not used.


Doesn't use them in OSRS.

DannyRS

2020-07-18 18:19:16

Sorry for the massive gravedig, been doing lots of research on this lately, finally got somewhere after a few nights of messing about, c# controlled kernel driver mouse / keyboard, no virtual input flags at all that I could find.

"Why, the callback is empty, they don't monitor it, etc"

People will debate this till the end of time, I actually wanted this for other games with anticheat software, but if we remove the possibility of this being an issue, then we don't have to talk about it anymore right, so why not do it??

"Why are you using sockets to control the mouse?"

I'm an idiot and not smart enough to figure out how to wrap a dll with lazarus or c++ into a simba plugin, so I did the quick and dirty socket server to send commands to, and have a c# app run the driver commands, ignore the 100, 100 in console, I assumed I'd have to pass in a x/y on where to hold the mouse but it ended up not needing that as it just clicks where your current mouse is (makes sense now I think about it as it's not a virtual mouse).

I didn't write 90% of the stuff going on here, I just brought a load of github projects together, sadly I'm not that smart :(

[ATTACH=CONFIG]28710[/ATTACH]

If anyone wants to help me turn this into a plugin for simba and has experience loading external dll's in a simba plugin, let me know!

R0b0t1

2021-03-16 23:47:59

@Danny RS which kernel module are you using? I found one that was proprietary and kind of shady.

Recently I found https://github.com/cezanne/usbip-win. It is an update of the USBIP project from the Linux kernel tree version. It requires you to enable testsigning but appears to work. USBIP allows you to, at least on Linux, easily create a fake local USB loopback device.