Results 1 to 7 of 7
  1. #1
    Inferno17's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    2

    LocalPlayer not a valid pointer?

    Hey, I've ran into a new problem.. I initialized my classes and tried to debug the LocalPlayer address to check if it's a valid pointer for my classes to check my position. Well, it's apparently not a valid pointer.. Here is the address I'm using (And for those of you who log in their base, I'll share my pattern to)

    Address
    Code:
    define ADR_LocalPlayer			0x372A7920
    Pattern
    Code:
    #define PATT_LOCALPLAYER "\x8B\x41\x08\x6A\x00\x50\xE8\x00\x00\x00\x00"
    #define MASK_LOCALPLAYER "xxxxxxx????"
    Here is my class for Object since I am using the origin offset to check position
    Code:
    class _Object
    {
    public:
    	char Unknown0[4]; //0x0000 
    	D3DXVECTOR3 origin; //0x0004 
    	D3DXVECTOR3 HeadOrigin; //0x0010
    };
    Here is my PlayerInfo where I'm grabbing Object
    Code:
    class PlayerInfo
    {
    public:
    		__int32 Ping;
    	__int32 index;
    	char unknown0[12];
    	char Name[12];
    	char unknown1[12];
    	_Object *obj;
    	__int32 Kills;
    	__int32 Deaths;
    	__int32 KillsWhileAlive;
    	DWORD pUnknown1;
    	DWORD pUnknown2;
    	DWORD pUnknown3;
    	__int32 pSuicide;
    	__int32 pKillsAfterJoin;
    	__int32 pDoubleKill;
    	__int32 pMultiKill;
    	__int32 pUltraKill;
    	__int32 pFantastic;
    	char unknown3[4];
    	__int32 HeadShots;
    	__int32 pFTMission;
    	char unknown4[8];
    	__int32 Team;
    	char unknown5[4];
    	__int8 IsDead;
    	char unknown6[307];
    	__int32 pRank;
    	char unknown7[80];
    	__int32 pFTScore;
    	BYTE pFTSpawn;
    	char unknown8[3];
    	__int32 pFTLongestLife;
    	__int32 pFTKill;
    	char unknown9[80];
    	PlayerInfo* pNext;
    };

    here is how I'm initializing it

    Code:
    PlayerInfo * pLocal;
    
    GetLocalPlayer = (lpGetLocalPlayer)(ADR_LocalPlayer);
    
    ulThis = (unsigned long)(pGameClientShell->GetClientInfoMgr()); 
    
    pLocal = GetLocalPlayer(ulThis);
    and here is how I'm trying to check my position

    Code:
    			if(ValidPointer(pLocal))
    			{
    
    				if((pLocal->obj->origin.x && pLocal->obj->origin.y && pLocal->obj->origin.z) == 0.0f) 
    			{
    				sprintf(CantFindPos, "Can't Find Position");
    				Menu->DrawTextL(10, 10, WHITE, CantFindPos, pFont);
    			}else{
    				sprintf(FoundPos, "PosX - %d\nPosY - %d\nPosZ - %d", pLocal->obj->origin.x, pLocal->obj->origin.y, pLocal->obj->origin.z);
    				Menu->DrawTextL(10, 10, WHITE, FoundPos, pFont);
    			}
    
    		}
    But it just returns "Can't Find Position" even when I'm spawned and walking around. I know my classes are being initialized, but what could I be doing wrong? Any help would be nice.

    P.S., my gameclientshell class is fine, I even used the address for GetClientInfoMgr straight up and it still didn't work..
    Last edited by Inferno17; 06-11-2013 at 04:47 AM.

  2. #2
    juggalo200's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    174
    Reputation
    10
    Thanks
    369
    My Mood
    Relaxed
    did u update your playerinfo your self or copy some elses mine works fine

  3. #3
    Inferno17's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by juggalo200 View Post
    did u update your playerinfo your self or copy some elses mine works fine
    I updated it while looking at someone else's playerinfo. Does yours differ from mine? Are you doing this any differently?

  4. The Following User Says Thank You to Inferno17 For This Useful Post:

    Pepviovetes (06-11-2013)

  5. #4
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    831
    Reputation
    44
    Thanks
    401
    My Mood
    Twisted
    If I just see this char array name: "char Name[12];"
    I could rage the whole day. It is a fucking STRING.
    But its posted vereyhwere wrong...

    Progress with my game - "Disbanded"
    • Fixed FPS lag on spawning entities due to the ent_preload buffer!
    • Edit the AI code to get some better pathfinding
    • Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
    • Added a new silencer for ALL weapons. Also fixed the rotation bugs
    • Added a ton of new weapons and the choice to choose a silencer for every weapon
    • Created a simple AntiCheat, noobs will cry like hell xD
    • The name will be Disbanded, the alpha starts on the 18th august 2014



    Some new physics fun (Serversided, works on every client)



    My new AI
    https://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    https://www.youtube.com/watch?v=Na2kUdu4d_k

  6. #5
    gibam761's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    100
    Reputation
    10
    Thanks
    49
    My Mood
    Drunk
    not be so?

    # Define PATT_LOCALPLAYER "\ x8B \ x41 \ x08 \ X6A \ x00 \ x50 \ XE8 \ x00 \ x00 \ x00 \ x00"
    # define MASK_LOCALPLAYER "xxxx?xx????"

  7. #6
    diegosarria12's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Location
    Min ser o incrível Hulk
    Posts
    326
    Reputation
    10
    Thanks
    709
    My Mood
    Cheerful
    Quote Originally Posted by gibam761 View Post
    not be so?

    # Define PATT_LOCALPLAYER "\ x8B \ x41 \ x08 \ X6A \ x00 \ x50 \ XE8 \ x00 \ x00 \ x00 \ x00"
    # define MASK_LOCALPLAYER "xxxx?xx????"
    Do not forget the byte
    + 0x2

  8. #7
    arun823's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Los Angeles, California
    Posts
    523
    Reputation
    151
    Thanks
    1,899
    My Mood
    Amused
    There is such an easier way to accomplish this...

    Class/Function required to accomplish this:
    Code:
    class cLTBase
    {
    public:
    	cLTClient* ILTClient;
    	char unknown8[96];
    	bool(WINAPIV *IntersectSegment)(pIntersectQuery& Query, pIntersectInfo *pInfo);
    	char unknown104[28];
    	unsigned int(WINAPIV *GetLocalClientID)(unsigned int *pIDOut);
    	char unknown136[384];
    	unsigned int(WINAPIV *RunConsoleCommand)(const char* szCommand);
    	int*(WINAPIV *GetClientObject)(); 
    	char unknown528[16];
    	unsigned int(WINAPIV *GetObjectScale)(int* pObject, float *scale);
    	unsigned int(WINAPIV *SetObjectScale)(int* pObject, float scale);
    	char unknown552[4];
    	unsigned int(WINAPIV *GetObjectColor)(int* pObject, float *r, float *g, float *b, float *a);
    	unsigned int(WINAPIV *SetObjectColor)(int* pObject, float r, float g, float b, float a);
    };
    
    D3DXVECTOR3 cTools::MyGetObjectMaxPos(int *obj)
    {
    	return *(D3DXVECTOR3*)(obj + 0x4);
    }
    Checking if PlayerPos is active:
    Code:
    if(this->IsValidPointer(Main->Hack->GameClasses->pLTBase))
    {
    	int* MyObj = Main->Hack->GameClasses->pLTBase->GetClientObject();
    
    	if(MyObj)
    	{
    		D3DXVECTOR3 MyPos = this->MyGetObjectMaxPos(MyObj);
    
    		if(MyPos.x == 0.0f || MyPos.y == 0.0f || MyPos.z == 0.0f)
    			return false;
    		else
    			return true;
    	}
    }
    Also why are you taking up 4 lines to declare the class, much more concise:
    Code:
    GetLocalPlayer   = (lpGetLocalPlayer)(this->Addresses->dwLocalPlayer);	
    cPlayerInfo *pLocal = GetLocalPlayer(this->GameClasses->pGameClientShell->GetClientInfoMgr());
    Once declared, just use the pLocal pointer directly instead of creating a DWORD to be used aka ulThis.
    Last edited by arun823; 06-11-2013 at 10:07 PM.
    Reversing is the only way to move forward.

Similar Threads

  1. Erro de Valid pointer
    By redhot789 in forum Combat Arms BR Coding Help
    Replies: 20
    Last Post: 03-14-2012, 11:12 AM
  2. [Solved] This is not a valid image file.
    By [L]uke in forum CrossFire Help
    Replies: 6
    Last Post: 01-04-2012, 02:36 PM
  3. Not a valid win32 application
    By terence in forum General Game Hacking
    Replies: 1
    Last Post: 02-03-2006, 06:52 AM