C++ X spammer

07/23/2009 16:47 Smurfie2#1
PHP Code:
// Test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <tchar.h>

#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <iostream>

using namespace std;

void main()
{

char end;
HWND windowHandle = FindWindow(0, _T("Dragonica (0.0.1.19)"));
INPUT *key;
if(
windowHandle == NULL) {

 
cout << "not found";
exit;
}
SetForegroundWindow(windowHandle);
Sleep(1000);

key = new INPUT;
key->type = INPUT_KEYBOARD;
key->ki.wVk = 120;
key->ki.dwFlags = 0;
key->ki.time = 0;
key->ki.wScan = 0;
key->ki.dwExtraInfo = 0;
while(
1) {
    if(
GetAsyncKeyState(VK_NUMPAD7)) {
        exit(
0);
    }
SendInput(1,key,sizeof(INPUT)); //keydown
key->ki.dwExtraInfo = KEYEVENTF_KEYUP;
SendInput(1,key,sizeof(INPUT));//keyup
Sleep(100); 
}
exit(
0);

} 
I'll just leave this her in case someone finds it useful :)
07/23/2009 18:19 Chaosbelow#2
I could just build this into a application right? I only know the basics of c++ =/
07/23/2009 18:33 grimmyz#3
If anyone is interested here's my DLL. It has included in it the farrel teleport locations, but I had also incorporated the ability to spam X after frognik released his trainer. Didn't really think it was anything special but I thought I would contribute to the thread.

numpad 1-6 is for farrel (make sure you have num-lock on)
numpad 9 activates x spam
numpad 8 deactivates x spam

num-lock must be on for all to work. after you deactivate it shoots 2 or 3 times more so don't get worried.
07/23/2009 18:56 Chaosbelow#4
Quote:
Originally Posted by grimmyz View Post
If anyone is interested here's my DLL. It has included in it the farrel teleport locations, but I had also incorporated the ability to spam X after frognik released his trainer. Didn't really think it was anything special but I thought I would contribute to the thread.

numpad 1-6 is for farrel (make sure you have num-lock on)
numpad 9 activates x spam
numpad 8 deactivates x spam

num-lock must be on for all to work. after you deactivate it shoots 2 or 3 times more so don't get worried.
Sorry to say but this dosent work, i tried injecting it and it didnt work.
07/23/2009 18:57 -Ice-#5
isit the X spam fast ...or still like normal press X?
07/23/2009 19:01 Smurfie2#6
Its like normal but you don't have to press it yourself, good for afk leveling
07/23/2009 19:04 Chaosbelow#7
Quote:
Originally Posted by Smurfie2 View Post
Its like normal but you don't have to press it yourself, good for afk leveling
We just have to compile it right?
07/23/2009 19:10 Smurfie2#8
Compile and run, to stop hit numpad key 7.

not really that useful but its a good learning point for people who want to learn how to use sendinput.
07/23/2009 19:12 grimmyz#9
It works, I use it. What do you mean you injected it and it doesn't work? Unsuccessfully injected or nothing happens when you press the keys? Was num lock on?
07/23/2009 19:16 Chaosbelow#10
Num lock was on and the dll successfully injected but nothing happend when i pressed 9 and 8.
07/23/2009 19:20 grimmyz#11
That's weird. A similar problem happened when I tried to have my friend use my DLL as well. I'm not sure what could be restricting someone elses computer from using the same DLL that works on mine.

Code:
// Farrel Porta.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <windows.h>
#define XP 0x012D07A4
#define XP1 0x3B8
#define XP2 0x3C
#define YP 0x012D07A4
#define YP1 0x3B8
#define YP2 0x44
#define ZP 0x012D07A4
#define ZP1 0x3B8
#define ZP2 0x4c
#include <stdarg.h> 
bool Shop = true;
bool att = false;

#define OFFSETS_END 0xDEADBEEF 

/*__checkReturn BOOL _ReadPointer(__out PULONG_PTR pulValue, __in LPCVOID lpcvBase, ...) 
{ 
  ULONG_PTR ulTemp; 
  va_list   pArguments; 
  BOOL      bRET; 
  int       iOffset; 

  __try { 
    ulTemp = (ULONG_PTR)lpcvBase; 
    va_start(pArguments, lpcvBase); 
    while ((iOffset = va_arg(pArguments, int)) != OFFSETS_END) 
      ulTemp = *(ULONG_PTR*)((*(ULONG_PTR*)ulTemp) + iOffset); 
    va_end(pArguments); 
    *pulValue = ulTemp == (ULONG_PTR)lpcvBase ? *(ULONG_PTR*)ulTemp : ulTemp; 
    bRET = TRUE; 
  } 
  __except(EXCEPTION_EXECUTE_HANDLER) { 
    bRET = FALSE; 
  } 

  return bRET; 
} 
*/
#define ReadPointer(x, y, ...) _ReadPointer(x, y, __VA_ARGS__, OFFSETS_END)


/*void attack()
{
 while(1)
 {
  if(bHealth == true)
  {
   *(DWORD*)(*(DWORD*)BasePointer + HealthOffset) = 3000;
   Sleep(100);
  }
  else
  {
   Sleep(100);
  }
 }
}*/

void attack()
{	
	while (att==true)
	{
		 if(GetAsyncKeyState(VK_NUMPAD8))
	   {
		   att=false;}
	//PostMessage(hDll,WM_KEYDOWN,0x58,0);
	//PostMessage(hDll,WM_KEYUP,0x58,0);
	Sleep (300);	
	keybd_event( 'X', 0, 0, 0 );
	keybd_event( 'X', 0, KEYEVENTF_KEYUP, 0 );
	}
}


void FarrelTPKeys()
{
while(1)
 {
  
  if(GetAsyncKeyState(VK_NUMPAD1))
  {
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 5.8496413230896;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = -5.44686651229858;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = -5.19682216644287;
  }
  if(GetAsyncKeyState(VK_NUMPAD2))
  {
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 5.85522603988647;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = -4.99659633636475;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = 5.44353246688843;
  }
  if(GetAsyncKeyState(VK_NUMPAD3))
  {
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 5.85413074493408;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = -5.4339337348938;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = -3.96045613288879;
  }
  if(GetAsyncKeyState(VK_NUMPAD4))
  {
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 5.8496413230896;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = -4.96435308456421;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = -3.76918935775757;
  }
  if(GetAsyncKeyState(VK_NUMPAD5))
  {
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 5.86291027069092;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = -5.0773138999939;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = -5.28184461593628;
  }
   if(GetAsyncKeyState(VK_NUMPAD6))
  {
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 5.53205823898315;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = -5.16178560256958;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = 5.06665706634521;
  }
      if(GetAsyncKeyState(VK_NUMPAD0))
	  {
			//if (ReadPointer((ULONG_PTR*)dwGame, dwNoBreathOffset) != 0)
			//if (ReadPointer(&ulValue, (LPCVOID)YP, YP1, YP2) = -4.83895301818848)
			//{

//farrel
	  if (Shop){
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 3.34374094009399;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = 4.73040628433228;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = -5.10347986221313;
	Shop = false;
			}
	  else if (!Shop){
//shop
	*(float*)(*(DWORD*)(*(DWORD*)ZP + ZP1) + ZP2 ) = 3.66287851333618;
	*(float*)(*(DWORD*)(*(DWORD*)YP + YP1) + YP2 ) = -4.83895301818848;
	*(float*)(*(DWORD*)(*(DWORD*)XP + XP1) + XP2 ) = 3.91743898391724;
	Shop = true;
			}
  }

	   if(GetAsyncKeyState(VK_NUMPAD9))
	   {
		   if (!att){
		att=true;
		attack();}
		   if (att){
		att=false;
		attack();}
	   }

}

}
BOOL APIENTRY DllMain(HINSTANCE hDll, DWORD callReason, LPVOID lpReserved) {
     if(callReason == DLL_PROCESS_ATTACH) {
       CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&FarrelTPKeys, 0, 0, 0);
	   CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&attack, 0, 0, 0);
                   //CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&setHealth, 0, 0, 0);
     }
    
     return 1;
}
Smurfie, can you look at my source and see if there's anything there that wouldn't let someone else's computer be able to utilize my DLL? My friend had trouble using it also, when he pressed the keys designated nothing happened.

Try pressing numpad 1 and see if you teleport. You don't press both 9 and 8 just press 9 and you should start spamming X.
07/23/2009 19:28 Smurfie2#12
Code:
	keybd_event( 'X', 0, 0, 0 );
	keybd_event( 'X', 0, KEYEVENTF_KEYUP, 0 );
Use sendinput instead.
07/23/2009 19:37 Chaosbelow#13
Grimmyz, can you update you're dll now that Smurfie helped you? =D. I would really like to use it
07/24/2009 04:17 exp150#14
Can you guys create multi client ?
07/24/2009 15:50 chowtek#15
Ermm.. where do i actually put the at?