Home Forum MultiPlayer Game Hacks & Cheats CrossFire Hacks & Cheats CrossFire Hack Coding / Programming / Source Code Crossfire Coding Help & Discussion Head and Body Position Head and Body PositionPosts 1–7 of 7 · Page 1 of 1
Head and Body Position
Mpgh.
I'm back after great time, thanks for welcome!
Firstly,
Thanks for the space.
My questions are simple for this section programmers,
How get Head and Body position in this crossfire season?
Maybe that the segment below is correctly for purpose...
Code:
MOV ECX,DWORD PTR DS:[11433ACC] // pLTModel(?)
MOV EDX,DWORD PTR DS:[ECX]
MOV EDX,DWORD PTR DS:[EDX+3C]
PUSH 1
LEA EDI,DWORD PTR DS:[ESI+40]
PUSH EDI // what is this "EDI"?
PUSH EAX
MOV EAX,DWORD PTR DS:[ESI+C]
PUSH EAX
CALL EDX
Thanks in advanced,
graciously see you.
Code:
#define ADDR_ILTMODEL 0x01433ACC
unsigned int GetNodeTransform( int *Obj, unsigned int iNodeNumber, CTransform *pTransForm )
{
char *strCShell = "CShell.dll";
__asm
{
PUSH strCShell
CALL DWORD PTR DS:[ GetModuleHandle ]
ADD EAX, ADDR_ILTMODEL
MOV ECX, DWORD PTR DS:[ EAX ]
MOV EDX, DWORD PTR DS:[ ECX ]
MOV EDX, DWORD PTR DS:[ EDX + 0x3C ]
PUSH 1
PUSH pTransForm
PUSH iNodeNumber
PUSH Obj
CALL EDX
}
//PUSH 1
//LEA EDI,DWORD PTR DS:[ESI+40] // Loads the address of pTransform Object on EDI.
//PUSH EDI // EDI = pTransForm reference struct.
//PUSH EAX // EAX = iNodeNumber.
//MOV EAX,DWORD PTR DS:[ESI+C] // EAX = Rewrite the EAX with Entity's Object.
//PUSH EAX // EAX = Entity's Object.
//CALL EDX // Calls GetNodeTransform on ILTModel's class.
}
@luizimloko Thanks so much brother!!!
But, even with this code, or with others, my drawing does not render.
//maybe, my off's not correct? //i've tried others off's also, Me=0x1F4, Size=0xD78, Start=0x1E8.
Code:
//MY OFFSET'S:
dwPlayerSize = 0xD78
dwPlayerStart = 0x1F8
dwMe = 0x204
error at:
Code:
005E5D52 movzx ecx,byte ptr [eax+0ACh]
Originally Posted by
Turbulence_
@luizimloko Thanks so much brother!!!
But, even with this code, or with others, my drawing does not render.
//maybe, my off's not correct? //i've tried others off's also, Me=0x1F4, Size=0xD78, Start=0x1E8.
Code:
//MY OFFSET'S:
dwPlayerSize = 0xD78
dwPlayerStart = 0x1F8
dwMe = 0x204
error at:
Code:
005E5D52 movzx ecx,byte ptr [eax+0ACh]
Code:
#define ADDR_LTCLIENTSHELL 0x014372E0
#define ADDR_ILTMODEL 0x01433ACC
#define OFFSET_PLAYERSIZE 0xD78
#define OFFSET_PLAYERSTART 0x1F8
#define OFFSET_ME 0x204
CPlayer *getPlayerByIndex( DWORD dw_LTClientShell, int i )
{
DWORD dw_CPlayerStart = ( dw_LTClientShell + OFFSET_PLAYERSTART );
if( !dw_CPlayerStart )
return nullptr;
return ( CPlayer * ) ( dw_CPlayerStart + OFFSET_PLAYERSIZE * i );
}
unsigned int getNodeTransform( int *Obj, unsigned int iNodeNumber, CTransform *pTransForm )
{
char *strCShell = "CShell.dll";
__asm
{
PUSH strCShell
CALL DWORD PTR DS:[ GetModuleHandle ]
ADD EAX, ADDR_ILTMODEL
MOV ECX, DWORD PTR DS:[ EAX ]
MOV EDX, DWORD PTR DS:[ ECX ]
MOV EDX, DWORD PTR DS:[ EDX + 0x3C ]
PUSH 1
PUSH pTransForm
PUSH iNodeNumber
PUSH Obj
CALL EDX
}
}
const D3DXVECTOR3 getBoneVector( int *Obj, unsigned int iNodeNumber )
{
CTransform objBoneTransform = CTransform( );
unsigned int iRet = getNodeTransform( Obj, iNodeNumber, &objBoneTransform );
return objBoneTransform.Pos;
}
const bool bIsValidPlayer( CPlayer *p )
{
return ( p != 0 && p->Object != 0 &&
p->CharacterFX != 0 && p->Health > 0 );
}
void playerLoop( void )
{
DWORD dw_ClientFX = ( DWORD ) GetModuleHandle( "ClientFX.fxd" );
if( !dw_ClientFX )
return;
DWORD dw_CShell = ( DWORD ) GetModuleHandle( "CShell.dll" );
if( !dw_CShell )
return;
DWORD dw_LTClientShell = *( DWORD * ) ( dw_CShell + ADDR_LTCLIENTSHELL );
if( !dw_LTClientShell )
return;
CPlayer *pLocal = getPlayerByIndex( dw_LTClientShell, *( int * ) ( dw_LTClientShell + OFFSET_ME ) );
if( !pLocal )
return;
for( int i = 0; i < 16; i++ )
{
CPlayer *pPlayer = getPlayerByIndex( dw_LTClientShell, i );
if( !bIsValidPlayer( pPlayer ) )
continue;
D3DXVECTOR3 vHead = getBoneVector( pPlayer->Object, 8 );
}
}
@
luizimloko
Thank so much brother!
I'll try now, but I want learn instead of have ready codes.
If possible you can share a little cognition about how i can find the exactly class playerinfo on reclass, i have the bypass to use reclass in cf.
I have a imagination about this, maybe add_log("#define pPlayer 0x%X", pPlayer); and with the address generated, let's go to reclass.. (???)
Thanks in advanced!
Originally Posted by
luizimloko
Code:
#define ADDR_LTCLIENTSHELL 0x014372E0
#define ADDR_ILTMODEL 0x01433ACC
#define OFFSET_PLAYERSIZE 0xD78
#define OFFSET_PLAYERSTART 0x1F8
#define OFFSET_ME 0x204
CPlayer *getPlayerByIndex( DWORD dw_LTClientShell, int i )
{
DWORD dw_CPlayerStart = ( dw_LTClientShell + OFFSET_PLAYERSTART );
if( !dw_CPlayerStart )
return nullptr;
return ( CPlayer * ) ( dw_CPlayerStart + OFFSET_PLAYERSIZE * i );
}
unsigned int getNodeTransform( int *Obj, unsigned int iNodeNumber, CTransform *pTransForm )
{
char *strCShell = "CShell.dll";
__asm
{
PUSH strCShell
CALL DWORD PTR DS:[ GetModuleHandle ]
ADD EAX, ADDR_ILTMODEL
MOV ECX, DWORD PTR DS:[ EAX ]
MOV EDX, DWORD PTR DS:[ ECX ]
MOV EDX, DWORD PTR DS:[ EDX + 0x3C ]
PUSH 1
PUSH pTransForm
PUSH iNodeNumber
PUSH Obj
CALL EDX
}
}
const D3DXVECTOR3 getBoneVector( int *Obj, unsigned int iNodeNumber )
{
CTransform objBoneTransform = CTransform( );
unsigned int iRet = getNodeTransform( Obj, iNodeNumber, &objBoneTransform );
return objBoneTransform.Pos;
}
const bool bIsValidPlayer( CPlayer *p )
{
return ( p != 0 && p->Object != 0 &&
p->CharacterFX != 0 && p->Health > 0 );
}
void playerLoop( void )
{
DWORD dw_ClientFX = ( DWORD ) GetModuleHandle( "ClientFX.fxd" );
if( !dw_ClientFX )
return;
DWORD dw_CShell = ( DWORD ) GetModuleHandle( "CShell.dll" );
if( !dw_CShell )
return;
DWORD dw_LTClientShell = *( DWORD * ) ( dw_CShell + ADDR_LTCLIENTSHELL );
if( !dw_LTClientShell )
return;
CPlayer *pLocal = getPlayerByIndex( dw_LTClientShell, *( int * ) ( dw_LTClientShell + OFFSET_ME ) );
if( !pLocal )
return;
for( int i = 0; i < 16; i++ )
{
CPlayer *pPlayer = getPlayerByIndex( dw_LTClientShell, i );
if( !bIsValidPlayer( pPlayer ) )
continue;
D3DXVECTOR3 vHead = getBoneVector( pPlayer->Object, 8 );
}
}
Sweet as always,
Originally Posted by
luizimloko
Code:
#define ADDR_LTCLIENTSHELL 0x014372E0
#define ADDR_ILTMODEL 0x01433ACC
#define OFFSET_PLAYERSIZE 0xD78
#define OFFSET_PLAYERSTART 0x1F8
#define OFFSET_ME 0x204
CPlayer *getPlayerByIndex( DWORD dw_LTClientShell, int i )
{
DWORD dw_CPlayerStart = ( dw_LTClientShell + OFFSET_PLAYERSTART );
if( !dw_CPlayerStart )
return nullptr;
return ( CPlayer * ) ( dw_CPlayerStart + OFFSET_PLAYERSIZE * i );
}
unsigned int getNodeTransform( int *Obj, unsigned int iNodeNumber, CTransform *pTransForm )
{
char *strCShell = "CShell.dll";
__asm
{
PUSH strCShell
CALL DWORD PTR DS:[ GetModuleHandle ]
ADD EAX, ADDR_ILTMODEL
MOV ECX, DWORD PTR DS:[ EAX ]
MOV EDX, DWORD PTR DS:[ ECX ]
MOV EDX, DWORD PTR DS:[ EDX + 0x3C ]
PUSH 1
PUSH pTransForm
PUSH iNodeNumber
PUSH Obj
CALL EDX
}
}
const D3DXVECTOR3 getBoneVector( int *Obj, unsigned int iNodeNumber )
{
CTransform objBoneTransform = CTransform( );
unsigned int iRet = getNodeTransform( Obj, iNodeNumber, &objBoneTransform );
return objBoneTransform.Pos;
}
const bool bIsValidPlayer( CPlayer *p )
{
return ( p != 0 && p->Object != 0 &&
p->CharacterFX != 0 && p->Health > 0 );
}
void playerLoop( void )
{
DWORD dw_ClientFX = ( DWORD ) GetModuleHandle( "ClientFX.fxd" );
if( !dw_ClientFX )
return;
DWORD dw_CShell = ( DWORD ) GetModuleHandle( "CShell.dll" );
if( !dw_CShell )
return;
DWORD dw_LTClientShell = *( DWORD * ) ( dw_CShell + ADDR_LTCLIENTSHELL );
if( !dw_LTClientShell )
return;
CPlayer *pLocal = getPlayerByIndex( dw_LTClientShell, *( int * ) ( dw_LTClientShell + OFFSET_ME ) );
if( !pLocal )
return;
for( int i = 0; i < 16; i++ )
{
CPlayer *pPlayer = getPlayerByIndex( dw_LTClientShell, i );
if( !bIsValidPlayer( pPlayer ) )
continue;
D3DXVECTOR3 vHead = getBoneVector( pPlayer->Object, 8 );
}
}
If you don't want to loop through 16 players everytime (like BattleRoyale that has 50),there's an engine function that returns the max number os players.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.