Results 1 to 3 of 3
  1. #1
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    818
    Reputation
    125
    Thanks
    1,785
    My Mood
    Doh

    Classes Conversion C++ --> Delphi

    Okay so I have decided to start converting some of the C++ classes, As you probably know I dont use any classes except for my own built ones in the Delphi hacks, But I have come to realize these Delphi hacks could be alot more "useful" if I had some of the SDK classes to get easy access to common values for the game. I see some people talk about the classes changing so it's poinless me just converting from F.E.A.R SDK, I instead took a look at the classes in mmob C++ base and attemoted to convert some small classes to start with, But what I need to know are these classes outdated or will these be okay to convert and use?

    C++ Classes
    Code:
    class c_player
    {
    public:
    	char unknown1[4];
    	__int32 ClientID;
    	char unknown2[8];
    	char Name[24];
    	int* Object;
    	__int32 Kills;
    	__int32 Deaths;
    	char unknown3[44];
    	__int32 HeadShots;
    	char unknown4[12];
    	__int32 TeamID;
    	char unknown5[4];
    	bool isDead;
    	char unknown6[507];
    	c_player* Next;
    };
    
    class Something
    {
    public:
    	bool bIsAlive;
    };
    
    class WepInfo
    {
    public:
    	__int32 iBackPackABulletsLeft;
    	__int32 i2ndaryBulletsLeft;
    	__int32 Unknown1;
    	__int32 iGrenadesLeft;
    	__int32 iBackPackBBulletsLeft;
    };
    
    class Info
    {
    public:
    	char unknown1[12];
    	__int32 iHP;
    	__int32 iAP;
    	__int32 iMaxHP;
    	__int32 iMaxAP;  
    	WepInfo* gotoWepInfo;
    	Something* goToSomething;
    	char unknown2[364];
    	float fStamina;
    	__int32 iIsRunning;
    	__int32 iIsJumping;
    	__int32 iWeaponSlotInUse;
    	char unknown3[44];
    	c_player* goToPlayers;	
    };
    
    class LocalInfo
    {
    public:
    	Info* goToInfoClass;
    };

    I have converted to Delphi:
    Code:
    interface
    uses
     Windows;
     
    Const
     ADDR_LOCALPTR = $378314F0;
    
    type
     pSomething = ^Something;
     Something = Record
     iIsAlive: Boolean;
    end;
    
    type
     pC_Player = ^C_Player;
     C_Player = Record
      Unknown1: array[0..3] of Char;
      ClientID: Integer;
      Unknown2: array[0..7] of Char;
      Name: array[0..23] of Char;
      Object1: ^Integer;
      Kills: Integer;
      Deaths: Integer;
      Unknown3: array[0..43] of Char;
      HeadShots: Integer;
      Unknown4: array[0..11] of Char;
      TeamID: Integer;
      Unknown5: array[0..3] of Char;
      isDead: Boolean;
      Next: pC_Player;
    end;
    
    type
     pWepInfo = ^WepInfo;
     WepInfo = Record
      iBackPackABulletsLeft: Integer;
      i2ndaryBulletsLeft: Integer;
      Unknown1: Integer;
      iGrenadesLeft: Integer;
      iBackPackBBulletsLeft: Integer;
    end;
    
    type
      pInfo = ^Info;
      Info = Record
       Unknown1: array[0..11] of Char;
       iHP: Integer;
       iAP: Integer;
       iMaxAP: Integer;
       gotoWepInfo: pWepInfo;
       gotoSomething: pSomething;
       Unknown2: array[0..362] of Char;
       fStamina: Single;
       iIsRunning: Integer;
       iIsJumping: Integer;
       iWeaponSlotInUse: Integer;
       Unknown3: array[0..43] of Char;
       gotoPlayers: pC_player;
    end;
    
    type
     pLocalInfo = ^LocalInfo;
     LocalInfo = Record
     gotoInfo: pInfo;
    end;
    
    Var
     pLocal: pLocalInfo;
     
    implementation
    
    end.
    I am just having a problem at the moment typecasting it pLocalInfo (pointer to LocalInfo)
    I have tried the following without success...
    pLocal:= pLocalInfo(ADDR_LOCALPTR); //TypeCast to pLocalInfo
    iKills:= pLocal.gotoInfo.gotoPlayers.Kills; /Failer...

    Before I continue failing I thought I would just check to make sure that I am using the currently correct classes. Any help is appreciated
    DJector.Lite
    Get the advantages of new injection technology, with 1 click easy to use injector, work for all platforms x86/x64

    Download

    D-Jector
    Get the most advanced and full featured injector around, works for any game and any platform x86/x64, nothing comes even close.
    Download

  2. #2
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Ontario, Canada
    Posts
    15,783
    Reputation
    3334
    Thanks
    11,209
    My Mood
    Happy
    cPlayerInfo:

    Code:
    class cPlayerInfo
    {
    public:
        __int32 Unknown0; //0000
        __int32 Index; //0004
        __int32 Unknown2; //0008
        __int32 Unknown3; //000C
        char pName[12]; //0010
        char unknown5[12];
        int* Object; //0028
        char unknown7[68];
        __int32 pTeam; //0x0070  
        __int32 idk; // xD
        __int8 pIsDead; //0078
    	//__int8 Health; //0x008C
        char unknowna[3];
        char unknown6[424];
        char unknownb[20];
        char unknown8[4];
        char unknown9[36];
        cPlayerInfo* pPrev;
        cPlayerInfo* pNext;
    };
    WepInfo:

    Code:
    class WepInfo
    {
    public:
    	__int32 iBackPackABulletsLeft;  //0000
    	__int32 i2ndaryBulletsLeft;		//0004
    			__int32 Unknown0;	    
    	__int32 iGrenadesLeft;			//000C
    	__int32 iBackPackBBulletsLeft;  //0010
    };
    Info:

    Code:
    class Info
    {
    public:
    			char unknown0[12];		//0x0000
    	__int32 iHP;					//0x000C  
    	__int32 iAP;					//0x0010  
    	__int32 iMaxHP;					//0x0014  
    	__int32 iMaxAP;					//0x0018  
    	WepInfo* gotoWepInfo;			//0x001C  
    	Something* goToSomething;		//0x0020  
    			char unknown36[352];	
    	float fStamina;					//0x0184  
    	__int32 iIsRunning;				//0x0188  
    	__int32 iIsJumping;				//0x018C  
    	__int32 iWeaponSlotInUse;		//0x0190  
    			char unknown404[44];	//0x0194
    	c_player* goToPlayers;			//0x01C0  		
    };
    Latest ones. They're from Matypatty's base. Look in there for the latest for most.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.
     
     
    VM | PM

    Publicist Since 04.04.2015
    Middleman Since Unknown - Unknown
    Global Moderator Since 08.01.2013
    Donator Since 05.29.2013

    Minion+ Since 04.18.2013

    District 187 Minion Since 04.04.2013
    Steam Minion Since 02.26.2013
    WarRock Minion Since 02.19.2013
    A.V.A Minion Since 02.13.2013
    DayZ Minion Since 01.21.2013
    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  3. The Following User Says Thank You to Flengo For This Useful Post:

    Departure (07-30-2012)

  4. #3
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    818
    Reputation
    125
    Thanks
    1,785
    My Mood
    Doh
    Thanks mate, These are slighty different to ones I was converting but is easy to update, Thanks again
    DJector.Lite
    Get the advantages of new injection technology, with 1 click easy to use injector, work for all platforms x86/x64

    Download

    D-Jector
    Get the most advanced and full featured injector around, works for any game and any platform x86/x64, nothing comes even close.
    Download

Similar Threads

  1. [Source Code] Delphi Menu Class
    By Departure in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 25
    Last Post: 06-10-2011, 08:22 PM
  2. Guild Wars New Classes
    By Chronologix in forum General Gaming
    Replies: 24
    Last Post: 07-23-2006, 09:46 AM
  3. Conversation Thread [Just people talking]
    By Kyojiro in forum General
    Replies: 17
    Last Post: 05-19-2006, 07:18 PM
  4. Delphi Coder
    By prchakal in forum Programming
    Replies: 36
    Last Post: 05-14-2006, 12:40 PM
  5. [Tutorial]Change class without respawn
    By vir2000 in forum Game Hacking Tutorials
    Replies: 0
    Last Post: 01-04-2006, 02:47 PM