Question[Ajuda] Usando as Address

Posts 1–8 of 8 · Page 1 of 1
[Ajuda] Usando as Address
Pessoal eu baixei um crossfire novo (o xtrap é desatualizado)
eu consegui pegar a address do C4PlantTime e C4DefuseTime
Alguém tem noção de como usar essas funções ??
Queria ativar elas por hotkey ou um auto-on
basta copiar e colar, compilar e injetar no jogo.

Code:
#include <windows.h>

class CBasicPlayerInfo
{
public:
	float BaseInfoPointer;//0x00
	float MovementSpeed;//0x04
	float MovementWalkRate;//0x08
	float MovementDuckWalkRate;//0x0C
	float MovementSideMoveRate;//0x10
	float MovementFBRunAnimRate;//0x14
	float MovementLRRunAnimRate;//0x18
	float MovementFBWalkAnimRate;//0x1C
	float MovementLRWalkAnimRate;//0x20
	float MovementAccelation;//0x24
	float MovementFriction;//0x28
	float JumpTime;//0x2C
	float JumpVelocity;//0x30
	float JumpLandedWaitTime;//0x34
	float JumpLandedNoJumpTimeRate;//0x38
	float JumpRepeatPenaltyMoveRate;//0x3C
	float JumpRepeatPenaltyHeightRate;//0x40
	float JumpLandedMovePenaltyTimeRate;//0x44
	float JumpLandedMovePenaltyMoveRate;//0x48
	float PVPosDefault;//0x4C
	float PVRotationDefault;//0x50
	float PVModelFOV;//0x54
	float PVModelAspect;//0x58
	char _0x0054[8];
	float PVOnlyMoveFlipTime;//0x64
	float PVOnlyMoveGap;//0x68
	float Unknown_00;//0x6C
	float Unknown_01;//0x70
	float DamagePenaltyTime;//0x74
	float DamagePenaltyMoveRate;//0x78
	float C4PlantTime;//0x7C
	float C4DefuseTime;//0x80
	float MaxCanDefuseDistance;//0x84
	float CharacterHiddenAlpha;//0x88
	float CharacterHiddenWalkAlpha;//0x8C
	float CharacterHiddenRunAlpha;//0x90
	float MovementHiddenRate;//0x94
};

DWORD FindPattern( DWORD dwStart, DWORD dwLen, BYTE *pszPatt, char pszMask[] )
{
	unsigned int i = NULL;
	int iLen = strlen( pszMask ) - 1;

	for( DWORD dwRet = dwStart; dwRet < dwStart + dwLen; dwRet++ )
	{
		if( *( BYTE * ) dwRet == pszPatt[ i ] || pszMask[ i ] == '?' )
		{
			if( pszMask[ i + 1 ] == '\0' )
				return( dwRet - iLen );
			i++;
		}
		else i = NULL;
	}

	return NULL;
}

DWORD getPlayerManager( DWORD CShell )
{
	DWORD PlayerManager = FindPattern( CShell, 0x1321000, ( PBYTE ) "\xA3\x00\x00\x00\x00\x0F\x84\x00\x00\x00\x00\x8B\x54\x24\x30", "x????xx????xxxx" );
		
	if( PlayerManager != 0 )
	{
		PlayerManager = *( DWORD * ) ( PlayerManager + 0x01 );
		PlayerManager = *( DWORD * ) ( PlayerManager );

		return PlayerManager;
	}

	return 0;
}

DWORD WINAPI startThread( LPVOID lpParameter )
{
	static int C4DefuseTime, C4PlantTime;

	while( 1 )
	{
		DWORD CShell = ( DWORD ) GetModuleHandle( "CShell.dll" );

		if( CShell != 0 )
		{
			DWORD ClientFX = ( DWORD ) GetModuleHandle( "ClientFX.fxd" );

			if( ClientFX != 0 )
			{
				CBasicPlayerInfo *pBasicPlayerInfo = ( CBasicPlayerInfo * ) getPlayerManager( CShell );

				if( GetAsyncKeyState( VK_F9 ) &1 )
					C4DefuseTime =! C4DefuseTime;

				if( C4DefuseTime )
					pBasicPlayerInfo->C4DefuseTime = 1.0f;
				else
					pBasicPlayerInfo->C4DefuseTime = 7.0f;

				//pBasicPlayerInfo->C4PlantTime  = 1.0f;
			}
		}

		Sleep( 100 );
	}

	return 0;
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch ( ul_reason_for_call )
	{
	case DLL_PROCESS_ATTACH:

		CreateThread( 0, 0, &startThread, 0, 0, 0 );

	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}

	return TRUE;
}
Quote Originally Posted by HeroiSovietico View Post
Tinipic voce tem skype?
não
Então pode me ajudar por aqui mesmo ?
Sou novato com isso..
Eu baixei um crossfire novo, ele é pirata bem desatualizado. (então acho que o xtrap não é problema)

É só eu criar uma DLL (c++)
ai coloco esse código em uma .cpp ou .h ??
Como disse ali em cima só peguei 2 address, aonde coloco elas ?
static int C4DefuseTime, C4PlantTime;

while( 1 )
{
DWORD CShell = ( DWORD ) GetModuleHandle( "CShell.dll" );

if( CShell != 0 )
{
DWORD ClientFX = ( DWORD ) GetModuleHandle( "ClientFX.fxd" );

if( ClientFX != 0 )
{
CBasicPlayerInfo *pBasicPlayerInfo = ( CBasicPlayerInfo * ) getPlayerManager( CShell );

if( GetAsyncKeyState( VK_F9 ) &1 )
C4DefuseTime =! C4DefuseTime;

if( C4DefuseTime )
pBasicPlayerInfo->C4DefuseTime = 1.0f;
else
pBasicPlayerInfo->C4DefuseTime = 7.0f;

//pBasicPlayerInfo->C4PlantTime = 1.0f;
}
Quote Originally Posted by HeroiSovietico View Post
Então pode me ajudar por aqui mesmo ?
Sou novato com isso..
Eu baixei um crossfire novo, ele é pirata bem desatualizado. (então acho que o xtrap não é problema)

É só eu criar uma DLL (c++)
ai coloco esse código em uma .cpp ou .h ??
Como disse ali em cima só peguei 2 address, aonde coloco elas ?
static int C4DefuseTime, C4PlantTime;

while( 1 )
{
DWORD CShell = ( DWORD ) GetModuleHandle( "CShell.dll" );

if( CShell != 0 )
{
DWORD ClientFX = ( DWORD ) GetModuleHandle( "ClientFX.fxd" );

if( ClientFX != 0 )
{
CBasicPlayerInfo *pBasicPlayerInfo = ( CBasicPlayerInfo * ) getPlayerManager( CShell );

if( GetAsyncKeyState( VK_F9 ) &1 )
C4DefuseTime =! C4DefuseTime;

if( C4DefuseTime )
pBasicPlayerInfo->C4DefuseTime = 1.0f;
else
pBasicPlayerInfo->C4DefuseTime = 7.0f;

//pBasicPlayerInfo->C4PlantTime = 1.0f;
}

como eu havia dito, esse código esta pronto pra uso, ele vai pegar o endereço do PlayerManager automaticamente e instanciar no ponteiro pBasicPlayerInfo, logo você pode acessar todos os membros da classe CBasicPlayerInfo, através da instância pBasicPlayerInfo, como pode observar:

Code:
...

CBasicPlayerInfo *pBasicPlayerInfo = ( CBasicPlayerInfo * ) getPlayerManager( CShell );

if( GetAsyncKeyState( VK_F9 ) &1 )
	C4DefuseTime =! C4DefuseTime;

if( C4DefuseTime )
	pBasicPlayerInfo->C4DefuseTime = 1.0f;
else
	pBasicPlayerInfo->C4DefuseTime = 7.0f;

...
você pode ativar e desativar o defusamento rápido da c4 usando a tecla F9.

OBS: esse código deve ser colocando dentro de um source file ( .cpp ).
Agora entendi
fiz a dll
coloquei esse código e na hora do debug recebi esses erros
Severity Code Description Project File Line Suppression State
Error (active) argument of type "const char *" is incompatible with parameter of type "LPCWSTR" HackCF c:\Users\lucas\Documents\Visual Studio 2015\Projects\HackCF\HackCF\Windows.cpp 85
Error C2664 'HMODULE GetModuleHandleW(LPCWSTR)': cannot convert argument 1 from 'const char [11]' to 'LPCWSTR' HackCF c:\users\lucas\documents\visual studio 2015\projects\hackcf\hackcf\windows.cpp 85
Error C2664 'HMODULE GetModuleHandleW(LPCWSTR)': cannot convert argument 1 from 'const char [13]' to 'LPCWSTR' HackCF c:\users\lucas\documents\visual studio 2015\projects\hackcf\hackcf\windows.cpp 89
Error (active) argument of type "const char *" is incompatible with parameter of type "LPCWSTR" HackCF c:\Users\lucas\Documents\Visual Studio 2015\Projects\HackCF\HackCF\Windows.cpp 89

Project->Properties->Configuration Properties->Character Set


Ou você pode adicionar um A, exemplo: GetModuleHandleA
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?