begin process at 2012 05 28 15:00:51
  Trouver un code source :
 
dans
 
Accueil > Forum > 

C

 > 

Divers

 > 

Débutant(e)

 > 

bypass punkbuster hook cheat pour le jeux battlefield 2


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

bypass punkbuster hook cheat pour le jeux battlefield 2

samedi 25 juillet 2009 à 23:38:43 | bypass punkbuster hook cheat pour le jeux battlefield 2

toto6311

Code C/C++ :
#include <windows.h>

#include <tlhelp32.h>
#include "resource.h"

#pragma comment(linker,"/FILEALIGN:512 /MERGE:.rdata=.text /MERGE:.data=.text /SECTION:.text,EWR /IGNORE:4078")
BOOL GameRunning;

/** Start of Declarations here **/
BOOL GetProcessList( );
DWORD GetModuleBaseAddress(DWORD iProcId, char* DLLName); //prototype

char *about =
"BF2 1.41 - By: toto \n"
/////////////////////////////////////////////////////////////////////

char *gameWindow = "BF2.exe";
DWORD pid; HWND hwndWindow; DWORD bytes; HANDLE hand = NULL;
DWORD RendDx9Base;


HANDLE pFile;

BOOL IsHack1On, IsHack2On, IsHack3On, IsHack4On, IsHack5On, IsHack6On, IsHack7On, IsHack8On, IsHack9On, IsHack10On, FirstTime1;


BYTE nofog[3] = {0xDB,0x46,0x38}; // No Fog
BYTE viewdistance[6] = {0xD9,0x05,0x2C,0x8D,0x59,0x04}; // Unlimted View Distance
BYTE viewdistance1[2] = {0x00,0x00}; // Unlimted View Distance PT 1
BYTE viewdistance2[4] = {0x80,0x40,0xCC,0xCC}; // Unlimted View Distance PT2
BYTE NameTags[6] = {0xE9,0x19,0x01,0x00,0x00,0x90}; // Name Tags
BYTE Healthbars[6] = {0x90,0x90,0x90,0x90,0x90,0x90}; // Health Bars
BYTE Distancetoplayer[2] = {0x90,0x90}; // Distance To Player
BYTE Shellshockremoveal[2] = {0x90,0x90}; // Shell Shock Removal
BYTE Mines[2] = {0x90,0x90}; // Enenmy Mines
BYTE MKiticons[2] = {0x90,0x90}; // Medic Kit Icons
BYTE EKiticons[2] = {0x90,0x90}; // Enginer Kit Icons
BYTE Asseticons[2] = {0x90,0x90}; // Shows Bridge Icons Arty and UAV
BYTE LockCrosshair[3] = {0xD8,0x4E,0x08}; // Locks Crosshair



BYTE original_code1[3] = {0}; // No Fog

BYTE original_code2[6] = {0}; // Unlimted View Distance
BYTE original_code3[2] = {0}; // Unlimted View Distance PT 1
BYTE original_code4[4] = {0}; // Unlimted View Distance PT 2


BYTE original_code5[6] = {0}; //Name Tags

BYTE original_code6[6] = {0}; //Health Bars
BYTE original_code7[6] = {0}; //Health Bars PT 1
BYTE original_code8[6] = {0}; //Health Bars PT 2

float tagincrease = 90000.0f; // Nametag Distance Increase
float tagdecrease = 120.0f; // Nametag Distance decrease

BYTE original_code9[2] = {0}; // Distance To Player

BYTE original_code10[2] = {0}; // Shell Shock Removal

BYTE original_code11[2] = {0}; // Mines

BYTE original_code12[2] = {0}; // Medic Kit Icons
BYTE original_code13[2] = {0}; // Enginer Kit Icons

BYTE original_code14[2] = {0}; // Asset Icons

///////////////////////////////////////////////////////

void aboutButton(HWND hwnd)
{
MessageBox(hwnd,about,"About",MB_ICONINFORMATION);
}

void Initialize(HWND hwnd,WPARAM wParam, LPARAM lParam) {
GetProcessList();

FirstTime1=TRUE;
IsHack1On=FALSE;
IsHack2On=FALSE;
IsHack3On=FALSE;
IsHack4On=FALSE;
IsHack5On=FALSE;
IsHack6On=FALSE;
IsHack7On=FALSE;
IsHack8On=FALSE;
IsHack9On=FALSE;
IsHack10On=FALSE;
if(GameRunning==TRUE)
{
GetWindowThreadProcessId(hwndWindow, &pid);
hand = OpenProcess(PROCESS_ALL_ACCESS,0,pid);
SetTimer(hwnd, 1, 500, NULL);

}
else
{
MessageBox(NULL, "BF2 Is not running. Be sure to make sure that the game is fully loaded and you are in a map", "Start BF2 First", MB_OK + MB_ICONWARNING);
}
}

void HookExe()
{

CloseHandle(hand);
GetProcessList( );
GetWindowThreadProcessId(hwndWindow, &pid);
hand = OpenProcess(PROCESS_ALL_ACCESS,0,pid);

}


void timerCall()
{
HookExe();


if(FirstTime1==TRUE)
{

RendDx9Base = GetModuleBaseAddress(pid, "RendDX9.dll");
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x4FA29) , &original_code1, sizeof(&original_code1), &bytes); // No Fog

ReadProcessMemory(hand, (void*) (RendDx9Base + 0x11200) , &original_code2, sizeof(&original_code2), &bytes); // View Distance
ReadProcessMemory(hand, (void*) (0x04598D2C) , &original_code3, sizeof(&original_code3), &bytes); // View Distance PT 1
ReadProcessMemory(hand, (void*) (0x04598D2E) , &original_code4, sizeof(&original_code4), &bytes); // View Distance PT 2

ReadProcessMemory(hand, (void*) (RendDx9Base + 0x12D85D) , &original_code5, sizeof(&original_code5), &bytes); // Nametags

ReadProcessMemory(hand, (void*) (RendDx9Base + 0x1B21CD) , &original_code6, sizeof(&original_code6), &bytes); // Health Bars 1
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x1B22FE) , &original_code7, sizeof(&original_code7), &bytes); // Health Bars 2
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x1B234C) , &original_code8, sizeof(&original_code8), &bytes); // Health Bars 3

ReadProcessMemory(hand, (void*) (RendDx9Base + 0x12EDF3) , &original_code9, sizeof(&original_code9), &bytes); // Distance To Player
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x4EC65) , &original_code10, sizeof(&original_code10), &bytes); // Shell Shock Removal
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x12D521) , &original_code11, sizeof(&original_code11), &bytes); // Mines
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x12CD1A) , &original_code12, sizeof(&original_code12), &bytes); // Medic Kit Icons
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x12CD1A) , &original_code13, sizeof(&original_code13), &bytes); // Enginer Kit Icons
ReadProcessMemory(hand, (void*) (RendDx9Base + 0x12F489) , &original_code14, sizeof(&original_code14), &bytes); // Asset Icons
FirstTime1=FALSE;
}

if(GetAsyncKeyState(VK_F1)) // No Fog
{

if(IsHack1On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x4FA29), &nofog,sizeof(&nofog), &bytes);
IsHack1On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x4FA29), &original_code1,sizeof(&original_code1), &bytes);
IsHack1On=FALSE; //Sets our "Is On" flag to "off"
}


}
if(GetAsyncKeyState(VK_F2)) // View Distance
{

if(IsHack2On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x11200), &viewdistance,sizeof(&viewdistance), &bytes);
WriteProcessMemory(hand, (void*)(0x04598D2C), &viewdistance1,sizeof(&viewdistance1), &bytes);
WriteProcessMemory(hand, (void*)(0x04598D2E), &viewdistance2,sizeof(&viewdistance2), &bytes);
IsHack2On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x11200), &original_code2,sizeof(&original_code2), &bytes);
WriteProcessMemory(hand, (void*)(0x04598D2C), &original_code3,sizeof(&original_code3), &bytes);
WriteProcessMemory(hand, (void*)(0x04598D2E), &original_code4,sizeof(&original_code4), &bytes);
IsHack2On=FALSE;
}

}
if(GetAsyncKeyState(VK_F3)) // Show Nametags
{

if(IsHack3On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12D85D), &NameTags,sizeof(&NameTags), &bytes);// Write the modified code into memory. Code to
IsHack3On=TRUE;
}
else //
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12D85D), &original_code5,sizeof(&original_code5), &bytes);
IsHack3On=FALSE;
}


}
if(GetAsyncKeyState(VK_F4)) // Nametag Distance Increase
{

if(IsHack4On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x237A3C), &tagincrease,sizeof(&tagincrease), &bytes);
IsHack4On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x237A3C), &tagdecrease,sizeof(&tagdecrease), &bytes);
IsHack4On=FALSE;
}


}

if(GetAsyncKeyState(VK_F5)) // Show Health Bars
{

if(IsHack5On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x1B21CD), &Healthbars,sizeof(&Healthbars), &bytes);
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x1B22FE), &Healthbars,sizeof(&Healthbars), &bytes);
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x1B234C), &Healthbars,sizeof(&Healthbars), &bytes);
IsHack5On=TRUE;
}
else //
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x1B21CD), &original_code6,sizeof(&original_code6), &bytes);
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x1B22FE), &original_code7,sizeof(&original_code7), &bytes);
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x1B234C), &original_code8,sizeof(&original_code8), &bytes);
IsHack5On=FALSE;
}


}

if(GetAsyncKeyState(VK_F6)) // Distance To Players
{

if(IsHack6On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12EDF3), &Distancetoplayer,sizeof(&Distancetoplayer), &bytes);
IsHack6On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12EDF3), &original_code9,sizeof(&original_code9), &bytes);
IsHack6On=FALSE;
}


}

if(GetAsyncKeyState(VK_F7))
{

if(IsHack7On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x4EC65), &Shellshockremoveal,sizeof(&Shellshockremoveal), &bytes);
IsHack7On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x4EC65), &original_code10,sizeof(&original_code10), &bytes);
IsHack7On=FALSE;
}


}

if(GetAsyncKeyState(VK_F8)) // Mines
{

if(IsHack8On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12D521), &Mines,sizeof(&Mines), &bytes);
IsHack8On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12D521), &original_code11,sizeof(&original_code11), &bytes);
IsHack8On=FALSE;
}


}
if(GetAsyncKeyState(VK_F9)) // Kit Icons
{

if(IsHack9On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12CD1A), &MKiticons,sizeof(&MKiticons), &bytes);
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12CD61), &EKiticons,sizeof(&EKiticons), &bytes);
IsHack9On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12CD1A), &original_code12,sizeof(&original_code12), &bytes);
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12CD61), &original_code13,sizeof(&original_code13), &bytes);
IsHack9On=FALSE;
}


}


if(GetAsyncKeyState(VK_F10)) // Asset Icons - Bridges arty UAV etc
{

if(IsHack10On==FALSE)
{
WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12F489), &Asseticons,sizeof(&Asseticons), &bytes);
IsHack10On=TRUE;
}
else
{

WriteProcessMemory(hand, (void*)(RendDx9Base + 0x12F489), &original_code14,sizeof(&original_code14), &bytes);
IsHack10On=FALSE;
}


}
}

DWORD GetModuleBaseAddress(DWORD iProcId, char* DLLName)
{
HANDLE hSnap;
MODULEENTRY32 xModule;
hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, iProcId);
xModule.dwSize = sizeof(MODULEENTRY32);
if (Module32First(hSnap, &xModule))
{
while (Module32Next(hSnap, &xModule))
{
if (strcmp(xModule.szModule, DLLName) == 0)
{
CloseHandle(hSnap);
return (DWORD)xModule.modBaseAddr;
}
}
}
CloseHandle(hSnap);
return 0;
}


BOOL GetProcessList( )
{
HANDLE hProcessSnap;
HANDLE hProcess;
PROCESSENTRY32 pe32;
DWORD dwPriorityClass;
int PidTest;
GameRunning=FALSE;

hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( hProcessSnap == INVALID_HANDLE_VALUE ) return( FALSE );


pe32.dwSize = sizeof( PROCESSENTRY32 );

if( !Process32First( hProcessSnap, &pe32 ) )
{
CloseHandle( hProcessSnap );
return( FALSE );
}


do
{
dwPriorityClass = 0;
hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID );
if( hProcess != NULL )
{
dwPriorityClass = GetPriorityClass( hProcess );
if( !dwPriorityClass )

CloseHandle( hProcess );
}

PidTest=strcmp(gameWindow, pe32.szExeFile);
if(PidTest==0){ pid=pe32.th32ProcessID; GameRunning=TRUE;}

} while( Process32Next( hProcessSnap, &pe32 ) );

CloseHandle( hProcessSnap );
return( TRUE );
}

BOOL CALLBACK DialogProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

switch (message)
{
case WM_INITDIALOG:
Initialize(hwnd,wParam,lParam);
return TRUE;

case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_ABOUT:
aboutButton(hwnd);
return TRUE;

case IDC_EXIT:
EndDialog (hwnd, 0);
return TRUE;
}
return TRUE;

case WM_DESTROY:
CloseHandle(pFile);
PostQuitMessage(0);
return TRUE;

case WM_CLOSE:
PostQuitMessage(0);
return TRUE;
case WM_TIMER:
timerCall();
return TRUE;
}
return FALSE;
}


int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{


DialogBox(hInstance,MAKEINTRESOURCE(IDD_MAINDLG), NULL,DialogProc);
return 0;
}

j ai


J'espere que j 'aide quel qun bon partage et bonne prog a tous
devile-la_beu



Cette discussion est classée dans : void, bytes, sizeof, hand, original


Répondre à ce message

Sujets en rapport avec ce message

bonjour tout le monde trainer bf2 Besoin d aide [ par toto6311 ] #include #include #include "resource.h"#pragma comment(linker,"/FILEALIGN:512 /MERGE:.rdata=.text /MERGE:.data=.text /SECTION:.text,EWR /IGNORE:4078") sizeof( void* ) / sizeof( int ) sur processeur 64 bit [ par KeniiyK ] Bonsoir,Si quelqu'un a un processeur 64 bit, peut il me dire si l'adressage est sur 32 bits ou sur 64 bits ?Que valent les renvoies de sizeof( int ) e Gros Probleme En C [ par Infern0 ] Bon, voila 3 fonction de mon programme. Avec celle d'affichage, quand j'affiche la 1ere, y a aucun probleme, si j'affiche la deuxieme, g des chiffre LPDIRECT3DVERTEXBUFFER9 :: LOCK [ par Adeon ] bonjour a tous, je debute en directx et pour apprendre le fonctionnement je regarde les tortuo ki sont fournis avec le sdk. L'un d'entre eux, (le 2eme intégrer une page web dans un dialog box [ par magic_Nono ] le but du jeux est d'afficher une page web dans une zone de dialog box je pensais pour cela intégrer un controle activeX gérant le html néanmoins, j fmod [ par _Jonathan ] j'ai devc++ 4.9.9.2, et j'ai telechargé l'api fmod 3.74. Mais je n'arrive pas a compiler le projet cddarip : 163 Main.cpp invalid conversion from `voi initialisation tableau dans un constructeur [ par tontonzip ] salut à tous,J'ai un petit souci..J'aimerai initialiser un tableau à 1 dimensions de type GLfloat dans un contructeur d'une classe contenant plusieurs Commande >>> Buffer [ par Stormy ] Salut à tous,Je cherche une solution afin de charger dans un Tampon une suite de commande ASM ou l'ensemble d'un code appartenant à une fonction C (co


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,139 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales