Difference between revisions of "Memory Addresses (GTA4)"

From GTAMods Wiki
Jump to navigation Jump to search
m (WEAPON)
m (WEAPON)
Line 26: Line 26:
  
 
===WEAPON===
 
===WEAPON===
The following is how the structure containing each weapon's properties looks like.
+
See [[List_of_Weapons_(GTA4)]] for the arrays referred to in the struct.
Info was obtained from GTA:IV v1.0.7.0.
+
 
 
Pointer to the array of weaponinfo's can be found at GTAIV.exe+0x940114. Note that this does not point to the first element in the array (perhaps it does, but the data it points to hasn't been identified yet) - you need to add an offset of 0xC.
 
Pointer to the array of weaponinfo's can be found at GTAIV.exe+0x940114. Note that this does not point to the first element in the array (perhaps it does, but the data it points to hasn't been identified yet) - you need to add an offset of 0xC.
  
 
NOTE: work in progress
 
NOTE: work in progress
  
<source lang="cpp">struct WEAPON // size: 0x110
+
<source lang="cpp">struct WEAPON // size: 0x110 -- 1.0.7.0
 
{
 
{
 
         // weapontype (index of array element)
 
         // weapontype (index of array element)

Revision as of 21:18, 9 March 2011

GTA4 for PC Memory Addresses

Structures

A list of Structures that occur in GTA IV's memory.

VECTOR

struct VECTOR
{
	float	x;	// 0x0 | 0
	float	y;	// 0x4 | 4
	float	z;	// 0x8 | 8
	float	unk;
};

CVector

struct CVector
{
	VECTOR	bodyHeading;		// 0x0 | 0
	VECTOR	visionHeading;		// 0x10 | 16
	VECTOR	unkVector;			// 0x20 | 32
	VECTOR	position;			// 0x30 | 48
};

WEAPON

See List_of_Weapons_(GTA4) for the arrays referred to in the struct.

Pointer to the array of weaponinfo's can be found at GTAIV.exe+0x940114. Note that this does not point to the first element in the array (perhaps it does, but the data it points to hasn't been identified yet) - you need to add an offset of 0xC.

NOTE: work in progress

struct WEAPON // size: 0x110 -- 1.0.7.0
{
        // weapontype (index of array element)
        int weapontype;          // 0x0 | 0

        // slottype (index of array element)
	int slot;                // 0x4 | 4
	
        // firetype (index of array element)     
        int firetype;            // 0x8 | 8

        // damagetype (index of array element)
        int damagetype;          // 0xC | 12

        // group (index of array element
        int group;               // 0x10 | 16

        float targetrange;       // 0x14 | 20
        float weaponrange;       // 0x18 | 24
        float aimaccuracy;       // 0x34 | 52
        float offset_x;          // 0x40 | 64
        float offset_y;          // 0x44 | 68
        float offset_z;          // 0x48 | 72
        float crouchoffset_x;    // 0x50 | 80
        float crouchoffset_y;    // 0x54 | 84
        float crouchoffset_z;    // 0x58 | 88
        float reticule_standing; // 0x64 | 100
        float reticule_ducked;   // 0x68 | 104
        float reticule_scale;    // 0x6C | 108
        int pickup_regentime;    // 0x78 | 120 
        
        // damage:
        int damage;              // 0x82 | 130

        int ammomax;             // 0x88 | 136
        int timebetweenshots;    // 0x8C | 140
        float physicsforce;      // 0x90 | 144
        int reloadtime_normal;   // 0x94 | 150
        int reloadtime_fast;     // 0x98 | 154
        int reloadtime_crouch;   // 0x9C | 160

        // damage, continued:
        float networkplayermod;  // 0xF0 | 240
        float networkpedmod;     // 0xF4 | 244
};

Classes

A list of Classes that occur in GTA IV's memory.

scrThread

class scrThread
{
public:
	virtual ~scrThread();
	virtual int reset(int i1,int i2,int i3);
	virtual int run(int i1);
	virtual int loop(int i1);
	virtual int closeDown();

	DWORD	threadId;
	DWORD	scriptHash;
	DWORD	state;
	DWORD	IP;
	DWORD	currentFrame;
	DWORD	SP;
	DWORD	timerA;
	DWORD	timerB;
	DWORD	timerC;
	float	waitTime;
	BYTE	zPadding1[28];
	DWORD	exIP;
	DWORD	exFrameSP;
	BYTE	zPadding2[4];
	void*	stack;
	BYTE	zPadding3[4];
	void*	XLiveBuffer;
	BYTE	zPadding4[8];
	char*	exitMessage;
	char	programName[54];
	BYTE	zPadding5[14];
	bool	saveScript;
	bool	playerControlOnInMissionCleanup;
	bool	clearHelpInMissionCleanup;
	BYTE	zPadding6[1];
	bool	allowNonMinigameTextMessages;
	BYTE	zPadding7[1];
	bool	errorInScript;
	bool	canBePaused;
	BYTE	zPadding8[3];
	bool	canRemoveBlipsCreatedByAnyScript;
	BYTE	zPadding9[7];
	DWORD	flags;
};

Functions

A list of Functions that occur in GTA IV's memory.

/* 0x4581C0 */ unsigned int __cdecl CRC32(char* text,unsigned int mask); // 1.0.2.0

Variables

A list of Variables that occur in GTA IV's memory.

/* 0xF56BC4 */ BYTE AESEncryptionKey[32]; // 1.0.2.0
/* 0x15AD8B4 */ DWORD* globalVariablesPool; // 1.0.2.0

External Links