Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 04:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Bot für crossfire

Discussion on Bot für crossfire within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2010
Posts: 10
Received Thanks: 1
Bot für crossfire

Hallo,

ich habe vor mir einen bot für crossfire zu machen, der die ganze zeit herumläuft. Da crossfire directinput benutzt funktionieren die einfachen bots mit key sends nicht. Ich glaube man sollte sendinput verwenden.

Meine fragen:
Wie bekomme ich genau den focus für crossfire heraus?
Wie functioniert der sendinput befehl ( mit taste drücken und loslassen) ?

Wäre nett wenn mir jemand weiterhelfen könnte.
--BUG-- is offline  
Old 07/26/2010, 10:58   #2


 
Cholik's Avatar
 
elite*gold: 4
Join Date: Aug 2008
Posts: 6,783
Received Thanks: 4,992
#moved
Cholik is offline  
Old 07/26/2010, 13:16   #3
 
elite*gold: LOCKED
Join Date: Aug 2006
Posts: 3,292
Received Thanks: 866






Damit hast du dann schon mal zugriff auf den Process und SendInput() könntest du dann auch ausführen eigentlich.
scenebase is offline  
Thanks
2 Users
Old 07/26/2010, 17:35   #4
 
elite*gold: 0
Join Date: Jul 2010
Posts: 10
Received Thanks: 1
hi Rhilor,
wie kann ich denn bei den Windows funktionen klar machen auf welches programm ich eingreifen möchte ?

zB:
HWND WINAPI FindWindow(
__in_opt LPCTSTR lpClassName,
__in_opt LPCTSTR lpWindowName
);

wie kann ich bestimmen welches fenster gefunden werden soll ?
--BUG-- is offline  
Old 07/26/2010, 20:29   #5
 
elite*gold: 0
Join Date: Jun 2010
Posts: 84
Received Thanks: 12
hi ich habe es mal so versucht aber es geht nicht.
kann mir jemand bitte sagen was ich falsch gemacht habe ?

#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <time.h>


HWND hwnd;
hwnd = FindWindow(NULL,L"CrossFire");
hwnd = SW_MAXIMIZE(NULL,L"CrossFire");
SetForegroundWindow(hwnd);
SetActiveWindow(hwnd);

HANDLE WINAPI OpenProcess(NULL,L"CrossFire"
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwProcessId
);



int main()
{
INPUT InputData;
int iEvents;

InputData.type = INPUT_KEYBOARD;
InputData.ki.wVk = 0x48;
InputData.ki.wScan = 35;
InputData.ki.dwFlags = 0;
InputData.ki.time = time(NULL);
InputData.ki.dwExtraInfo = 0;

iEvents = SendInput(1, &InputData, sizeof(InputData));

return 0;
}
Nektarius is offline  
Old 07/26/2010, 21:04   #6
 
elite*gold: LOCKED
Join Date: Aug 2006
Posts: 3,292
Received Thanks: 866
Quote:
Originally Posted by Nektarius View Post
hi ich habe es mal so versucht aber es geht nicht.
kann mir jemand bitte sagen was ich falsch gemacht habe ?

#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <time.h>


HWND hwnd;
hwnd = FindWindow(NULL,L"CrossFire");
hwnd = SW_MAXIMIZE(NULL,L"CrossFire");
SetForegroundWindow(hwnd);
SetActiveWindow(hwnd);

HANDLE WINAPI OpenProcess(NULL,L"CrossFire"
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwProcessId
);




int main()
{
INPUT InputData;
int iEvents;

InputData.type = INPUT_KEYBOARD;
InputData.ki.wVk = 0x48;
InputData.ki.wScan = 35;
InputData.ki.dwFlags = 0;
InputData.ki.time = time(NULL);
InputData.ki.dwExtraInfo = 0;

iEvents = SendInput(1, &InputData, sizeof(InputData));

return 0;
}
So holst du dir das HWND:
Code:
HWND hwnd = FindWindow(NULL, "ICQ");
So holst du dir die PID(vorher deklariert["DWORD pid"]):
Code:
GetWindowThreadProcessId(hwnd,&pid);
So öffnest du den Process:
Code:
HANDLE phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
scenebase is offline  
Thanks
1 User
Old 07/26/2010, 23:15   #7
 
P-a-i-n's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 1,258
Received Thanks: 396
ich bin mir sicher da wird dir xtrap den arschversohlen ohne bypass
P-a-i-n is offline  
Old 07/27/2010, 11:10   #8
 
elite*gold: LOCKED
Join Date: Aug 2006
Posts: 3,292
Received Thanks: 866
ja um den bypass muss er sich schon selbst kümmern
scenebase is offline  
Old 07/27/2010, 13:35   #9
 
elite*gold: 0
Join Date: Jun 2010
Posts: 84
Received Thanks: 12
was ist überhaupt ein bypass und was bringt der?

Rhior, das was du in meinem code rot gemacht hast soll ich weglassen ?
wie soll ich den pid vorher deklarieren ?
Nektarius is offline  
Old 07/27/2010, 20:58   #10
 
elite*gold: 0
Join Date: Jul 2010
Posts: 10
Received Thanks: 1
hi
wie deklariert man denn die paramteter ?

HANDLE WINAPI OpenProcess(NULL,L"CrossFire"
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwProcessId
);
--BUG-- is offline  
Old 07/27/2010, 21:34   #11
 
elite*gold: LOCKED
Join Date: Aug 2006
Posts: 3,292
Received Thanks: 866
Code:
HANDLE phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
Am besten mal:
lesen dann verstehst du es bestimmt.
scenebase is offline  
Old 07/30/2010, 18:25   #12
 
elite*gold: 0
Join Date: Jun 2010
Posts: 84
Received Thanks: 12
muss ich dann dein speicher von crossfire auslesen und dann verändern oder halt schreiben? Wenn dass so ist muss ich dann das mit directinput da reinschreiben ?
Und wie sag ich dem was es schreiben soll ?
Code:

int main(void)
{
HWND hWnd;
HANDLE hproc;
DWORD procid;
DWORD rw = 0;

unsigned adress = 0x00409040;
int buffer = 0;

hWnd = FindWindow(0,"Opfer");
if(!hWnd)
return 0;

GetWindowThreadProcessId(hWnd, &procid);

hproc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procid);

if(ReadProcessMemory(hproc,(LPCVOID)adress,&buffer ,
sizeof(buffer),&rw))
{
cout << "Lesen erfolgreich\n";
cout << buffer << endl;
}
buffer++;

if(WriteProcessMemory(hproc,(LPVOID)adress,&buffer ,
sizeof(buffer),&rw))
{
cout << "Schreiben erfolgreich\n";
}

CloseHandle(hproc);//<-- Wichtig!
return 0;
}
Nektarius is offline  
Reply




All times are GMT +1. The time now is 04:46.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.