Hooking with D

02/15/2013 18:38 ShittyMod#1
Comes with a homemade DLL injector although there's probably others that will do the job just as good.

If anyone's interested here's the tools I use
D compiler: [Only registered and activated users can see links. Click Here To Register...]
IDE: [Only registered and activated users can see links. Click Here To Register...]
Mono-D (D support for MonoDevelop): [Only registered and activated users can see links. Click Here To Register...]
02/15/2013 22:29 Super Aids#2
Thanks, this looks interesting. Always been interested in learning D, although I've never really looked into, so whenever I do then I got this to look at, if hooking in D ever gets my interest.
02/15/2013 23:12 pro4never#3
This thread gave me the D

It gave me the D hard






















































and I liked it.
02/17/2013 19:56 ShittyMod#4
Sorry, this was done in a hurry, I just noticed some minor things that should be changed.

client.d line 18 -> Change to IHook!((sendMsg_Hooked)) _sendMsgHook;
client.d line 19 -> Change to IHook!((receiveMsg_Hooked)) _receiveMsgHook;

hooking.d line 155 -> Remove the entire toString method since it was used for debugging purposes only
hooking.d line 136 -> Change the uninstall method to:
Code:
	void uninstall()
	{

		if(_installed)
		{

			// Make memory writable
			DWORD oldProtect;
			VirtualProtect(_address, 32, PAGE_EXECUTE_READWRITE, &oldProtect);

			foreach(int i; 0.._length)
			{
				(cast(ubyte*)_address)[i] = _originalBytes[i];
			}

			// Restore memory protection
			VirtualProtect(_address, 32, oldProtect, &oldProtect);

			_installed = false;

		}

	}
There's probably some other minor stuff, but everything works as intended. Sending/receveing packets is easy to do too, and making small bots with this base should be no problem at all.

It's a shame this community is so dead :(
02/18/2013 00:38 ImmuneOne#5
Quote:
Originally Posted by ShittyMod View Post
Sorry, this was done in a hurry, I just noticed some minor things that should be changed.

client.d line 18 -> Change to IHook!((sendMsg_Hooked)) _sendMsgHook;
client.d line 19 -> Change to IHook!((receiveMsg_Hooked)) _receiveMsgHook;

hooking.d line 155 -> Remove the entire toString method since it was used for debugging purposes only
hooking.d line 136 -> Change the uninstall method to:
Code:
	void uninstall()
	{

		if(_installed)
		{

			// Make memory writable
			DWORD oldProtect;
			VirtualProtect(_address, 32, PAGE_EXECUTE_READWRITE, &oldProtect);

			foreach(int i; 0.._length)
			{
				(cast(ubyte*)_address)[i] = _originalBytes[i];
			}

			// Restore memory protection
			VirtualProtect(_address, 32, oldProtect, &oldProtect);

			_installed = false;

		}

	}
There's probably some other minor stuff, but everything works as intended. Sending/receveing packets is easy to do too, and making small bots with this base should be no problem at all.

It's a shame this community is so dead :(
You're going to have a harsh time if you're trying to introduce a new language to this forum.
02/18/2013 15:48 ShittyMod#6
Quote:
Originally Posted by ImmuneOne View Post
You're going to have a harsh time if you're trying to introduce a new language to this forum.
The syntax is like 90% C# though, so most of the baddies on these forums should be able to learn it pretty easily :(
02/20/2013 04:10 Super Aids#7
Quote:
Originally Posted by ShittyMod View Post
The syntax is like 90% C# though, so most of the baddies on these forums should be able to learn it pretty easily :(
Indeed and it got some neat features.