HelpClasses Conversion C++ --> Delphi

Posts 13 of 3 · Page 1 of 1
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
 iIsA****** 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
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.
Thanks mate, These are slighty different to ones I was converting but is easy to update, Thanks again
Posts 13 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?