Quantcast

Jump to content

» «
Photo

Documenting GTA-SA memory adresses

1,342 replies to this topic
_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1291

Posted 03 February 2013 - 08:50 PM Edited by DK22Pac, 07 February 2013 - 11:24 PM.

Nope. RwObject is a 'parent' object for both RpClump and RpAtomic.

0x735360 void __cdecl RpClumpGetBonePositions(RpClump *clump, RwV3d *positions)
0x4CF190 void __thiscall gtaHAnimForAllBones(gtaHAnim *this, void (__cdecl *callback)(CBone *, void *), void *data)
0x4D62A0 CBone * __cdecl RpClumpFindBoneByName(RpClump *clump, char *name)
0x4D6370 CBone *__cdecl RpClumpFindBoneByHash(RpClump *clump, int key)
0x4D6400 CBone *__cdecl RpClumpFindBoneByID(RpClump *clump, int ID)

CBone

gtaHAnim + 0x08 => DWORD m_dwNumBones
gtaHAnim + 0x10 => CBone *m_pBones

struct CBone
0x00 BYTE m_bFlags
0x04 RwV3d m_vOffset
0x10 gtaHAnimIFrame *m_pIFrame
0x14 DWORD m_dwNodeId

struct gtaHAnimIFrame // interpolated key-frame
0x00 RtQuat m_qRotation
0x10 RwV3d m_vTranslation

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#1292

Posted 08 February 2013 - 01:49 PM Edited by Wesser, 13 April 2013 - 05:30 PM.

Here are some information about helicopter's rotors figured out just for fun:

CAutomobile + 0x0678 - RwFrame *m_pstTopRotor
CAutomobile + 0x067C - RwFrame *m_pstTopRotorBlur
CAutomobile + 0x0680 - RwFrame *m_pstRearRotor
CAutomobile + 0x0684 - RwFrame *m_pstRearRotorBlur
CAutomobile + 0x084C - float fRotorSpeed

0x006C4400 - void __thiscall CHeli__render()

It updates the visibility of rotors frames.

0x006C4E60 - void __thiscall CHeli__processRotors()

It does rotate the helicopter rotors and process collision (when rotating).

0x006C4F00 - float *pfMaxRotorSpeed

It is the pointer to the constant value regarding the maximum rotors speed.

0x006C5420 - void __thiscall CHeli__preRender()

It updates the rotors matrix. Matrix transformations regarding each rotors frame begin at 0x006C56E9.

Information about planes will come soon. smile.gif

Other unrelated stuff:

CPhysical + 0x0044 - RwV3d m_stVelocity (multiply by 50.0)
CPhysical + 0x00FC - CEntity *m_pclAttachedEntity
CPhysical + 0x0100 - RwV3d m_stAttachedOffset
CPhysical + 0x010C - RwV3d m_stAttachedRotation

CVehicle + 0x0384 - CHandlingData *m_pclHandlingData
CVehicle + 0x03D0 - float m_fCruiseSpeed

CHandlingData + 0x88 - float m_fMaxSpeed (multiply by 60.0)

0x004082C0 - float __cdecl getMagnitude(RwV3d *pstVector)

The current vehicle speed is given by computing the magnitude of m_stVelocity vector through getMagnitude function.

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1293

Posted 09 March 2013 - 11:35 PM Edited by DK22Pac, 28 September 2013 - 02:08 PM.

Final touches...
class CColData
{
public:
    WORD               m_wNumSpheres;
    WORD               m_wNumBoxes;
    WORD               m_wNumTriangles;
    BYTE               m_bNumLines;
    BYTE               m_bFlags;
    CColSphere        *m_pSpheres;
    CColBox           *m_pBoxes
    CColLine          *m_pLines;
    CCompressedVector *m_pVertices;
    CColTriangle      *m_pTriangles;
    CColTrianglePlane  m_pTrianglePlanes;
    DWORD              m_dwNumShadowTriangles;
    DWORD              m_dwNumShadowVertices;
    CCompressedVector *m_pShadowVertices;
    CColTriangle      *m_pShadowTriangles;
};

Pritchard
  • Pritchard

    Player Hater

  • Members
  • Joined: 31 Mar 2013

#1294

Posted 31 March 2013 - 06:59 PM

Hey, I've looked through most of these addresses, however I couldn't find one I'd really want to get.

I think everybody knows that if the weather's dark enough or you hide in a shadow the blip color changes from white to a greyish-brownish color. I'm looking for a method to check if this change occured, either by a memory address which detects if a player's hidden or if the blip color changes.

Thank you in advance.

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1295

Posted 08 April 2013 - 07:15 PM Edited by DK22Pac, 08 April 2013 - 08:12 PM.

CODE
struct RwRaster
{
   struct RwRaster *parent;
   unsigned char   *cpPixels;
   unsigned char   *palette;
   int              width, height, depth;
   int              stride;
   short            nOffsetX, nOffsetY;
   unsigned char    cType;
   unsigned char    cFlags;
   unsigned char    privateFlags;
   unsigned char    cFormat;
   unsigned char   *originalPixels;
   int              originalWidth;
   int              originalHeight;
   int              originalStride;
   struct{
       union{
           IDirect3DTexture9 *pTexture;
           IDirect3DSurface9 *pSurface;
       };
       unsigned char       *pPalette;
       unsigned char        cAlpha;
       unsigned char        cCubeTextureFlags; /* 0x01 IS_CUBEMAP_TEX */
       unsigned char        cTextureFlags;     /* 0x01 HAS_MIP_MAPS
                                                  0x10 IS_COMPRESSED */
       unsigned char        cLockFlags;
       IDirect3DSurface9   *pLockedSurface;
       D3DLOCKED_RECT       lockedRect;
       D3DFORMAT            eFormat;
       IDirect3DSwapChain9 *pSwapChain;
       HWND                *pHWnd;
   } RwD3D9Raster;
};

Not finished... Yet...

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1296

Posted 17 April 2013 - 08:27 PM Edited by DK22Pac, 19 April 2013 - 09:08 AM.

Some info about RpMaterial plugins.
Let's start with default structure.
CODE
struct RpMaterial
{
   RwTexture           *texture;
   RwRGBA               color;
   RxPipeline          *pipeline;
   RwSurfaceProperties  surfaceProps;
   short                refCount;
   short                pad;
};

CODE
struct RwSurfaceProperties
{
   float ambient;
   union
   {
       float specular;
       eMaterialEffectFlags flags;
   };
   float diffuse;
};

Look at the second field here. Since 'specular' member is not used in RW, Rockstar used it to hold some information tounge.gif :
CODE
enum eMaterialEffectFlags
{
   HAS_ENV_MAP   = 0x00000001,
   HAS_ENV_MAP_X = 0x00000002, // xvehicleenvmap128
   HAS_SPECULAR  = 0x00000004
};

Additional part of structure
CODE
struct SMaterial : public RpMaterial
{
   SFXMaterial         *pMatFx;
   SUVAnimMaterial      sUVAnim;
   SReflectionMaterial *pReflection;
   SSpecularMaterial   *pSpecular;
};

Material FX plugin can hold some default RW effect.
CODE
enum RpMatFXMaterialFlags
{
   rpMATFXEFFECTBUMPMAP         = 1,
   rpMATFXEFFECTENVMAP          = 2,
   rpMATFXEFFECTBUMPENVMAP      = 3,
   rpMATFXEFFECTDUAL            = 4,
   rpMATFXEFFECTUVTRANSFORM     = 5,
   rpMATFXEFFECTDUALUVTRANSFORM = 6
};

Some of these effecs, like bump+env, are represented as 2 separated effects. So we have such structure here:
CODE
struct SFXMaterial
{
   SFXEnvMapMaterial sEffect[2];
   unsigned int      uiFlags; // were shown before ^
};

Each effect has different structure, I've looked only to EnvMap, which is used by game (This section is used to hold texture for vehicle reflection).
CODE
struct SFXEnvMapMaterial
{
   RwFrame      *pFrame;
   RwTexture    *pTexture;
   float         fCoefficient;
   unsigned int  uiFrameBufferAlpha;
   float         fSize;
   unsigned int  uiEffectType; // separated type (based on 'flags')
};

Other things:
CODE
struct SUVAnimMaterial
{
   RwMatrix           *pMatrix[2];
   RtAnimInterpolator *pInterpolator[8];
};

CODE
struct SReflectionMaterial
{
   unsigned char   ucTransformParams[4];
   unsigned char   ucIntensity;
private:
   char            __pad;
public:
   unsigned short  usRenderFrame;
   STexture       *pTexture; // as I said before, we get this texture from FX plugin.
};

CODE
struct SSpecularMaterial
{
   float     fLevel;
   STexture *pTexture;
};

RwTexture
CODE
struct RwTexture
{
   RwRaster        *raster;
   RwTexDictionary *dict;
   RwLLLink        lInDictionary;
   char            name[32];
   char            mask[32];
   unsigned int    filterAddressing;
   int             refCount;
   // RenderWare plugin
   unsigned char   maxAnisotropy;
   char            pad[3];
};

RwFrame
CODE
struct RwFrame
{
   RwObject    object;
   RwLLLink    inDirtyListLink;
   RwMatrix    modelling;
   RwMatrix    ltm;
   RwLinkList  objectList;
   RwFrame    *child;
   RwFrame    *next;
   RwFrame    *root;
   // RenderWare plugin
   RpHAnimFrameExtension hAnimFrame;
   // GTA Plugins
   char nodeName[24];
   int  hierId;
};

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1297

Posted 21 April 2013 - 12:13 AM Edited by _DK, 06 December 2013 - 05:15 PM.

0x7C7190 bool __cdecl SkinCreateSkinData(RpSkin *skin, unsigned int numBones, unsigned int numBoneIds, unsigned int numGeometryVertices, const void *boneIds, const void *vertexBoneWeights, const void *vertexBoneIndices, RwMatrix *skinToBoneMatrices)
Will post RpSkin structure later...

Skin
struct RpSkin
{
    unsigned int     numBones;
    unsigned int     numBoneIds;
    unsigned char   *boneIds;
    RwMatrix        *skinToBoneMatrices;
    unsigned int     maxNumWeightsForVertex;
    unsigned int    *vertexBoneIndices;
    RwMatrixWeights *vertexBoneWeights;
    char             field_1C[8];
    unsigned int     boneLimit;
    unsigned int     numMeshes;
    unsigned int     numRLE;
    unsigned char   *meshBoneRemapIndices;
    unsigned int     meshBoneRLECount;
    void            *meshBoneRLE;
    void            *field_3C;
};

juarez
  • juarez

    Memory Hacking

  • Members
  • Joined: 11 Jun 2011
  • Poland

#1298

Posted 19 May 2013 - 01:06 PM

Found a CPhone functions:

CODE
0x454220     CPhones__Init
0x454340     CPhones__Process


Not all, but I think they are must be re-enable.

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1299

Posted 19 May 2013 - 10:51 PM Edited by DK22Pac, 19 May 2013 - 11:04 PM.

CODE
PhonePickUpCB(CAnimBlendAssociation *,void *)                                               0x453E40
PhonePutDownCB(CAnimBlendAssociation *,void *)                                              0x453F40
CPhone::CPhone(void)                                                                        0x453FA0
CPhone::~CPhone()                                                                           0x453FB0
CPhoneInfo::Shutdown(void)                                                                  0x453FC0
CPhoneInfo::PhoneAtThisPosition(CVector)                                                    0x453FD0
CPhoneInfo::GrabPhone(float,float)                                                          0x454010
CPhoneInfo::SetPhoneMessage_Repeatedly(int,uchar *,uchar *,uchar *,uchar *,uchar *,uchar *) 0x4540D0
CPhoneInfo::SetPhoneMessage_JustOnce(int,uchar *,uchar *,uchar *,uchar *,uchar *,uchar *)   0x454130
CPhoneInfo::HasMessageBeenDisplayed(int)                                                    0x454190
CPhoneInfo::IsMessageBeingDisplayed(int)                                                    0x4541C0
CPhoneInfo::CPhoneInfo(void)                                                                0x4541E0
CPhoneInfo::~CPhoneInfo()                                                                   0x454200
CPhoneInfo::Initialise(void)                                                                0x454220
CPhoneInfo::FindNearestFreePhone(CVector *)                                                 0x4542D0
CPhoneInfo::Update(void)                                                                    0x454340
CPhoneInfo gPhoneInfo                                                                       0x977BE8

sxlxll
  • sxlxll

    SxL

  • Members
  • Joined: 06 Sep 2012

#1300

Posted 06 July 2013 - 04:28 PM

i have problems to edit some Memory_Addresses_(SA) value
example 0xB793D4 - [float] Fat stat i want to be fully fat so i put 100 nothing happen
0x969134 - Increase Wanted Level 2 Stars (byte 1 or 0 ) so i put 1 nothing happen
any help ?

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1301

Posted 09 September 2013 - 05:40 PM Edited by DK22Pac, 09 September 2013 - 05:42 PM.

Some particles stuff.

Data types
CParticleManager +0x34 CParticleFrustum m_Frustum
CParticleFrustum +0x14 RwPlane m_Plane[4]
CParticle +0x62 BYTE m_nFlags
0x01 - HAS_ITS_OWN_MATRIX - if we want to have our own transformation matrix, we create it.
CParticle +0x74 CParticleBounding* m_pBounding

CParticleBounding (sizeof=0x14)
  +0x00 RwSphere m_Sphere
  +0x10 DWORD    m_dwNumPlanesPassed
CParticle +0x7C CParticleAudio m_Audio
CParticleAudio +0x8 CSound m_Sound
CParticleAudio +0x84 CParticle* m_pParticle

Functions
0x4AA260 CParticle::~CParticle()
0x4AA2F0 void CParticle::StartPlaying()
0x4AA390 void CParticle::StopPlaying()
0x4AA3F0 void CParticle::DestroyWithFade()
0x4AA400 void CParticle::AttachToBone(CParticle *this, CPed *ped, DWORD bone)
0x4AA630 void CParticle::SetTransformMatrix(RwMatrixTag *matrix)
0x4AA660 void CParticle::UpdatePos(RwV3D *pos)
0x4AA6C0 void CParticle::SetDarkness(char unk0, float amount)
0x4AA6F0 void CParticle::SetFrequency(float frq)
0x4AA710 void CParticle::SetSpeed(float speed)
0x4AA730 void CParticle::SetDirection(RwV3D *dir)
0x4AA750 bool CParticle::InitialiseAtPoint(CFxSystem *fxSystem, RwMatrixTag *base, RwMatrixTag *transform)
0x4AA840 void CParticle::Delete()
0x4AA890 void CParticle::CreateTransformMatrix()
0x4AA8C0 void CParticle::GetWorldMatrix(RwMatrixTag *out)
0x4AA900 BYTE CParticle::GetStatus()
0x4AAAD0 bool CParticle::GetTronsformatedBounding(CParticleBounding *out)
0x4AAB50 bool CParticle::GetBounding(CParticleBounding *out)
0x4AAB80 void CParticle::SetBounding(CParticleBounding *bounding)
0x4AABF0 void CParticle::SetupBounding()
0x4AAC90 void CParticle::AddAudio(CVector posn)
0x4AAEE0 CParticleAudio::CParticleAudio()
0x4AAF00 CParticle::CParticle(CParticle *this)
0x4AAF30 bool CParticle::IsInsideFrustum()
0x4AAF70 bool CParticle::Update(RwCamera *camera, float timeDelta)
0x4AA030 bool CParticeFrustum::TestBounding(CParticleBounding *bounding)
0x4DCF20 void CParticleAudio::Init(CParticle *particle)
0x4DCF60 void ParticleAudio::Update(CSound *sound, WORD state)
0x4DD3C0 void CParticleAudio::AddAudioEvent(eAudioEvent event, CVector *posn)

Jack
  • Jack

    wanted level modifications

  • Feroci Racing
  • Joined: 06 Dec 2011
  • Serbia

#1302

Posted 12 September 2013 - 09:30 AM Edited by JACK JONES, 12 September 2013 - 09:31 AM.

Roadblock vehicle IDs for San Andreas (tested):

0x461BB1 - Barracks OL
0x461BCC - FBI rancher
0x461BE7 - Enforcer van

I'm still searching for the rest of them...

Did anyone ever succeed in replacing SA wanted level vehicles? DexX found something on the page 16 and I noticed that those addresses have similar arrays as the ones in VC and III where it's possible to replace vehicles. But here in SA nothing happens. Anyone knows why? Here's one of them from the page 16:

#define barracks1 0x40b7D9 //barracks?
#define barracks2 0x40b7F4 //barracks?

Similar array as in III or Vice but no matter which vehicle value I put the vehicle is either the same or it's replaced into the police car. Why? And I did load the models via CLEO.


_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1303

Posted 14 September 2013 - 02:31 PM

0x460DF0 void CRoadBlocks::RegisterScriptRoadBlock(CVector cornerA, CVector cornerB, BYTE type)
0x460EC0 void CRoadBlocks::ClearScriptRoadBlocks()
0x461100 void CRoadBlocks::Init(void)
0x461170 bool CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle * car, int unk, BYTE type)
0x4619C0 void CRoadBlocks::CreateRoadBlockBetween2Points(CVector a, CVector b, BYTE type)
0x4629E0 void CRoadBlocks::GenerateRoadBlocks(void)
Also, here I've documented roadblox.dat info:
http://gtamodding.ru/wiki/Roadblox.dat


Jack
  • Jack

    wanted level modifications

  • Feroci Racing
  • Joined: 06 Dec 2011
  • Serbia

#1304

Posted 19 September 2013 - 05:08 PM Edited by JACK JONES, 19 September 2013 - 05:26 PM.

0x460DF0 void CRoadBlocks::RegisterScriptRoadBlock(CVector cornerA, CVector cornerB, BYTE type)
0x460EC0 void CRoadBlocks::ClearScriptRoadBlocks()
0x461100 void CRoadBlocks::Init(void)
0x461170 bool CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle * car, int unk, BYTE type)
0x4619C0 void CRoadBlocks::CreateRoadBlockBetween2Points(CVector a, CVector b, BYTE type)
0x4629E0 void CRoadBlocks::GenerateRoadBlocks(void)
Also, here I've documented roadblox.dat info:
http://gtamodding.ru/wiki/Roadblox.dat

Great. But what about the model change of the moving police cars? I've searched the whole region from 00400000 to 00600000 for the executable addresses (like in III and VC) and I haven't found a thing. And those with the most similar arrays as in III or VC cause the game crash. Does SA have more then 1 address for a police car model change? The roadblocks have only 1 for each car - so why would moving cars have 2? Btw here's the array I was searching (same in both gta3 and VC - only different number):

B1 01 00 00

Barracks truck.


_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1305

Posted 19 September 2013 - 11:24 PM Edited by DK22Pac, 20 September 2013 - 11:21 AM.

You need to check functions code for this.

You must understand you searching it inside text segment (not data).

For example, here is a part of CRoadBlocks::CreateRoadBlockBetween2Points:

z968.png

And how it looks at low level:

p8su.png

 

Weapon switching - related stuff.

0x60D850 void CPlayerPed::ProcessWeaponSwitch(CPad *pad)

0x5F0250 void CPed::RemoveWeaponAnims(int nSlot, float fBllendDelta)

0x60DC3A void CPlayerPed::MakeChangesForNewWeapon(eWeaponType weaponType)


Midnightz
  • Midnightz

    Populus vult decipi.

  • Members
  • Joined: 05 Feb 2007
  • United-States

#1306

Posted 20 September 2013 - 06:49 PM Edited by Midnightz, 20 September 2013 - 07:01 PM.

(Apologies, can't figure out how to search this post on the new layout, lol.)

 

Is there anything in here to disable prostitutes? (besides remove from pedgrp.dat file)


_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1307

Posted 21 September 2013 - 11:59 AM Edited by DK22Pac, 21 September 2013 - 12:00 PM.

CPed

  +0x394 CWeaponAudio m_WeaponAudio

  +0x59C CPedStat *m_pStats

 

 

Simply, we got this from ped.dat   

CPedStat (sizeof = 0x34)
+0x00 DWORD m_dwId
+0x04 char m_acName[24]
+0x1C float m_fFleeDistance
+0x20 float m_fHeadingChangeRate
+0x24 BYTE m_nFear
+0x25 BYTE m_nTemper
+0x26 BYTE m_nLawfullness
+0x27 BYTE m_nSexiness
+0x28 float m_fAttackStrength
+0x2C float m_fDefendWeakness
+0x30 WORD m_wShootingRate
+0x32 BYTE m_nDefaultDecisionMaker
+0x33 char _pad

0xC0BBEC CPedStat *CPedStats::ms_apPedStats

 

 

CCopPed (derived from CPed)

  +0x7A0 eCopType m_CopType

  +0x7A8 CCopPed *m_pCopPartner (possibly)

  +0x7AC CPed *m_pWantedPed[5]


Rapper_skull
  • Rapper_skull

    Player Hater

  • Members
  • Joined: 09 Nov 2012

#1308

Posted 09 October 2013 - 07:42 PM

Hello, I have a problem with region addresses: how can I decrypt player rotation? It is easy to convert XYZ coordinates into numers, but how do I convert the rotation matrix to something readeable like sexagesimal degrees?


_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1309

Posted 13 October 2013 - 12:29 AM

Random find.

0x56E610 void CPlayerInfo::ProcessEating()

 

CPed +0x138 CPedCollisionAudio m_PedCollisionAudio // derived from CDummyAudio

 

Do anyone have some info about audio structures?

class cDMAudio // (sizeof=0x1FD8)
{
    WORD  field_0;
    BYTE  m_nCurrentRadiostationId;
    BYTE  field_3;
    DWORD field_4;
    BYTE  field_8[152];
    BYTE field_A0;
    BYTE field_A1[15];
    BYTE field_B0;
    BYTE field_B1[3];
    CFrontendAudio m_FrontendAudio;
    BYTE field_282[30]
    CAudioManager m_AudioManager;
    CDummyAudio m_TempAudio;
    BYTE field_538[6400];
    SomeVoice someVoice; // derived from CPedVoice
    BYTE field_1F38[24];
    CGarageAudio m_GarageAudio;
};

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#1310

Posted 14 October 2013 - 06:00 PM

 

Random find.

0x56E610 void CPlayerInfo::ProcessEating()

 

CPed +0x138 CPedCollisionAudio m_PedCollisionAudio // derived from CDummyAudio

 

Do anyone have some info about audio structures?

***

 

Unfortunately I still don't have access to the IDB where I'd followed the 'Say' task routines. There was lots of odd code over choosing audio in categories. Had info on scripted conversations too, but not the random ones peds initiate in the street.


_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1311

Posted 26 October 2013 - 11:44 PM Edited by DK22Pac, 26 October 2013 - 11:44 PM.

Some info on vehicles.

CVehicle +0x4CC CPed *m_pWhoInstalledBombOnMe

CVehicle +0x4DE unsigned __int16 m_wBombTimer // goes down with each frame

CVehicle +0x4E0 CPed *m_pWhoDetonatedMe // game use this to send into BlowUpCar function

CVehicle +0x508 signed __int8 m_nLastWeaponDamage // last weapon used to damage vehicle, -1 if vehicle hadn't any weapon damage

CVehicle +0x50C CEntity *m_pLastDamageEntity // last entity who did weapon damage for vehicle

CAutoPilot (or CCarCtrl?) +0x27 __int8 m_nCurrentLane // current lane on road vehicle drive on

CAutoPilot +0x28 __int8 m_nNextLane // a lane on road vehicle will drive on


juarez
  • juarez

    Memory Hacking

  • Members
  • Joined: 11 Jun 2011
  • Poland

#1312

Posted 20 December 2013 - 05:17 PM

Some random finds:

http://pastebin.com/ZyX1RAHM


LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci Racing
  • Joined: 30 Jan 2011
  • Brazil

#1313

Posted 20 December 2013 - 11:03 PM

SA Mobile class, functions and variables list (similar format to that gta3 class list file)

https://dl.dropboxus...asslist.txt.zip

Could not paste it on pastebin because it's too big, anyone with PRO account should do it :p


_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1314

Posted 20 December 2013 - 11:58 PM Edited by _DK, 21 December 2013 - 02:48 PM.

WHY DID THEY NEED THIS?
{$CLEO}
0A8D: 0@ = read_memory 0xB7CD98 size 4 virtual_protect 0
0@ += 0x58C
while 1@ == 0
    wait 0
    0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0
end
0AA6: call_method 0x6E2900 struct 1@ num_params 1 pop 0 true
0A93:
Some classes...
CSound >> CAESound
CVehicleAudio >> CAEVehicleAudioEntity
CQuad >> CQuadBike
CMTruck >> CMonsterTruck
VehicleAudioProperties >> tVehicleAudioSettings
CAudioPlayer >> CAEAudioHardware
CSoundManager >> CAESoundManager
cDMAudio >> CAEAudioEngine
CSimpleCoors, Placement >> CSimpleTransform
CCoors >> CMatrixLink
CPlayerData >> CPlayerPedData
CSurfaceData >> SurfaceInfos_c
CClothes >> CPedClothesDesc
CNaviPoint >> CCoverPoint // !!!
CShadowManager >> CRealTimeShadowManager
CShadowData >> CRealTimeShadow
CRoadSignFont >> CCustomRoadsignMgr
CGrass >> CPlantMgr
CBox >> CBoundingBox
CColData >> CCollisionData
CEnEx >> CEntryExit
CFx >> Fx_c
CParticleData >> FxManager_c
CParticle >> FxSystem_c
CParticleFrustum >> FxFrustumInfo_c
CParticleBounding >> FxSphere_c
CObjs2c, CCarModModelInfo >> CDamageAtomicModelInfo
CPedSound >> CAEPedSpeechAudioEntity

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1315

Posted 28 December 2013 - 09:17 AM Edited by _DK, 28 December 2013 - 09:59 PM.

Oh, I found that MTA had already these names for audio classes...
But anyway
http://code.google.c...e_sa/CAESound.h
0x4F4D10 CAEVehicleAudioEntity::RequestBankSlot(short)                                                   
0x4F4DF0 CAEVehicleAudioEntity::StoppedUsingBankSlot(short)                                              
0x4F4E30 CAEVehicleAudioEntity::DoesBankSlotContainThisBank(short,short)                                 
0x4F4E60 CAEVehicleAudioEntity::DemandBankSlot(short)                                                    
0x4F4EC0 CAEVehicleAudioEntity::StaticService(void)                                                      
0x4F4ED0 CAEVehicleAudioEntity::StaticGetPlayerVehicleAudioSettingsForRadio(void)                        
0x4F4EE0 CAEVehicleAudioEntity::EnableHelicoptors(void)                                                  
0x4F4EF0 CAEVehicleAudioEntity::DisableHelicoptors(void)                                                 
0x4F4F00 CAEVehicleAudioEntity::GetVehicleTypeForAudio(void)                                             
0x4F4F70 CAEVehicleAudioEntity::IsAccInhibited(cVehicleParams &)                                         
0x4F4FC0 CAEVehicleAudioEntity::IsAccInhibitedBackwards(cVehicleParams &)                                
0x4F4FF0 CAEVehicleAudioEntity::IsAccInhibitedForLowSpeed(cVehicleParams &)                              
0x4F5020 CAEVehicleAudioEntity::IsAccInhibitedForTime(void)                                              
0x4F5030 CAEVehicleAudioEntity::InhibitAccForTime(uint)                                                  
0x4F5050 CAEVehicleAudioEntity::IsCrzInhibitedForTime(void)                                              
0x4F5060 CAEVehicleAudioEntity::InhibitCrzForTime(uint)                                                  
0x4F5080 CAEVehicleAudioEntity::GetAccelAndBrake(cVehicleParams &)                                       
0x4F51F0 CAEVehicleAudioEntity::GetVolumeForDummyIdle(float,float)                                       
0x4F5310 CAEVehicleAudioEntity::GetFrequencyForDummyIdle(float,float)                                    
0x4F53D0 CAEVehicleAudioEntity::GetVolumeForDummyRev(float,float)                                        
0x4F54F0 CAEVehicleAudioEntity::GetFrequencyForDummyRev(float,float)                                     
0x4F55C0 CAEVehicleAudioEntity::CancelVehicleEngineSound(short)                                          
0x4F56D0 CAEVehicleAudioEntity::UpdateVehicleEngineSound(short,float,float)                              
0x4F5700 CAEVehicleAudioEntity::JustGotInVehicleAsDriver(void)                                           
0x4F5B20 CAEVehicleAudioEntity::TurnOnRadioForVehicle(void)                                              
0x4F5B60 CAEVehicleAudioEntity::TurnOffRadioForVehicle(void)                                             
0x4F5BA0 CAEVehicleAudioEntity::PlayerAboutToExitVehicleAsDriver(void)                                   
0x4F5BF0 CAEVehicleAudioEntity::DisableHelicoptor(void)                                                  
0x4F5C00 CAEVehicleAudioEntity::EnableHelicoptor(void)                                                   
0x4F5C10 CAEVehicleAudioEntity::GetVehicleAudioSettings(short)                                           
0x4F5C40 CAEVehicleAudioEntity::CopHeli(void)                                                            
0x4F5C60 CAEVehicleAudioEntity::GetFreqForIdle(float)                                                    
0x4F5D00 CAEVehicleAudioEntity::GetVolForPlayerEngineSound(cVehicleParams &,short)                       
0x4F5E50 CAEVehicleAudioEntity::JustFinishedAccelerationLoop(void)                                       
0x4F5EB0 CAEVehicleAudioEntity::UpdateGasPedalAudio(CVehicle *,int)                                      
0x4F5F30 CAEVehicleAudioEntity::GetVehicleDriveWheelSkidValue(CVehicle *,int,float,cTransmission *,float)
0x4F6000 CAEVehicleAudioEntity::GetVehicleNonDriveWheelSkidValue(CVehicle *,int,cTransmission *,float)   
0x4F60B0 CAEVehicleAudioEntity::GetBaseVolumeForBicycleTyre(float)                                       
0x4F6150 CAEVehicleAudioEntity::GetFlyingMetalVolume(CPhysical *)                                        
0x4F61E0 CAEVehicleAudioEntity::GetHornState(uchar *,cVehicleParams &)                                   
0x4F62A0 CAEVehicleAudioEntity::GetSirenState(uchar *,uchar *,cVehicleParams &)                          
0x4F6320 CAEVehicleAudioEntity::StopGenericEngineSound(short)                                            
0x4F63E0 CAEVehicleAudioEntity::CAEVehicleAudioEntity(void)                                              
0x4F6420 CAEVehicleAudioEntity::AddAudioEvent(int,float)                                                 
0x4F7580 CAEVehicleAudioEntity::AddAudioEvent(int,CEntity *)                                             
0x4F7670 CAEVehicleAudioEntity::Initialise(CEntity *)                                                    
0x4F7A50 CAEVehicleAudioEntity::RequestNewPlayerCarEngineSound(short,float,float)                        
0x4F7F20 CAEVehicleAudioEntity::StartVehicleEngineSound(short,float,float)                               
0x4F8070 CAEVehicleAudioEntity::GetFreqForPlayerEngineSound(cVehicleParams &,short)                      
0x4F8360 CAEVehicleAudioEntity::PlaySkidSound(short,float,float)                                         
0x4F84D0 CAEVehicleAudioEntity::PlayRoadNoiseSound(short,float,float)                                    
0x4F8650 CAEVehicleAudioEntity::PlayFlatTyreSound(short,float,float)                                     
0x4F87D0 CAEVehicleAudioEntity::PlayReverseSound(short,float,float)                                      
0x4F8940 CAEVehicleAudioEntity::ProcessVehicleFlatTyre(cVehicleParams &)                                 
0x4F8B00 CAEVehicleAudioEntity::ProcessVehicleRoadNoise(cVehicleParams &)                                
0x4F8DF0 CAEVehicleAudioEntity::ProcessReverseGear(cVehicleParams &)                                     
0x4F8F10 CAEVehicleAudioEntity::ProcessVehicleSkidding(cVehicleParams &)                                 
0x4F92C0 CAEVehicleAudioEntity::ProcessRainOnVehicle(cVehicleParams &)                                   
0x4F93C0 CAEVehicleAudioEntity::PlayAircraftSound(short,short,short,float,float)                         
0x4F96A0 CAEVehicleAudioEntity::GetAircraftNearPosition(void)                                            
0x4F9710 CAEVehicleAudioEntity::PlayBicycleSound(short,short,short,float,float)                          
0x4F99D0 CAEVehicleAudioEntity::PlayHornOrSiren(uchar,uchar,uchar,cVehicleParams &)                      
0x4F9E90 CAEVehicleAudioEntity::UpdateBoatSound(short,short,short,float,float)                           
0x4FA0C0 CAEVehicleAudioEntity::ProcessBoatMovingOverWater(cVehicleParams &)                             
0x4FA1C0 CAEVehicleAudioEntity::UpdateTrainSound(short,short,short,float,float)                          
0x4FA3F0 CAEVehicleAudioEntity::ProcessTrainTrackSound(cVehicleParams &)                                 
0x4FA630 CAEVehicleAudioEntity::PlayTrainBrakeSound(short,float,float)                                   
0x4FA7C0 CAEVehicleAudioEntity::ProcessDummyRCPlane(cVehicleParams &)                                    
0x4FAA80 CAEVehicleAudioEntity::ProcessDummyRCHeli(cVehicleParams &)                                     
0x4FAD40 CAEVehicleAudioEntity::UpdateGenericVehicleSound(short,short,short,short,float,float,float)     
0x4FAE20 CAEVehicleAudioEntity::ProcessEngineDamage(cVehicleParams &)                                    
0x4FB070 CAEVehicleAudioEntity::ProcessNitro(cVehicleParams &)                                           
0x4FB260 CAEVehicleAudioEntity::ProcessMovingParts(cVehicleParams &)                                     
0x4FB6C0 CAEVehicleAudioEntity::UpdateParameters(CAESound *,short)                                       
0x4FB8C0 CAEVehicleAudioEntity::Terminate(void)                                                          
0x4FBB10 CAEVehicleAudioEntity::ProcessPlayerVehicleEngine(cVehicleParams &)                             
0x4FCA10 CAEVehicleAudioEntity::ProcessDummyStateTransition(short,float,cVehicleParams &)                
0x4FCF40 CAEVehicleAudioEntity::JustGotOutOfVehicleAsDriver(void)                                        
0x4FD0B0 CAEVehicleAudioEntity::JustWreckedVehicle(void)                                                 
0x4FD290 CAEVehicleAudioEntity::ProcessPlayerProp(cVehicleParams &)                                      
0x4FD8F0 CAEVehicleAudioEntity::ProcessDummyProp(cVehicleParams &)                                       
0x4FDFD0 CAEVehicleAudioEntity::ProcessAIProp(cVehicleParams &)                                          
0x4FE420 CAEVehicleAudioEntity::ProcessPlayerHeli(cVehicleParams &)                                      
0x4FE940 CAEVehicleAudioEntity::ProcessDummyHeli(cVehicleParams &)                                       
0x4FEE20 CAEVehicleAudioEntity::ProcessAIHeli(cVehicleParams &)                                          
0x4FF320 CAEVehicleAudioEntity::ProcessPlayerSeaPlane(cVehicleParams &)                                  
0x4FF7C0 CAEVehicleAudioEntity::ProcessDummySeaPlane(cVehicleParams &)                                   
0x4FF900 CAEVehicleAudioEntity::ProcessGenericJet(uchar,cVehicleParams &,float,float,float,float,float)  
0x4FFDC0 CAEVehicleAudioEntity::ProcessDummyBicycle(cVehicleParams &)                                    
0x500040 CAEVehicleAudioEntity::ProcessPlayerBicycle(cVehicleParams &)                                   
0x5002C0 CAEVehicleAudioEntity::ProcessVehicleSirenAlarmHorn(cVehicleParams &)                           
0x5003A0 CAEVehicleAudioEntity::ProcessBoatEngine(cVehicleParams &)                                      
0x500710 CAEVehicleAudioEntity::ProcessDummyTrainEngine(cVehicleParams &)                                
0x500AB0 CAEVehicleAudioEntity::ProcessPlayerTrainBrakes(cVehicleParams &)                               
0x500CE0 CAEVehicleAudioEntity::ProcessPlayerCombine(cVehicleParams &)                                   
0x500DC0 CAEVehicleAudioEntity::ProcessDummyRCCar(cVehicleParams &)                                      
0x500F50 CAEVehicleAudioEntity::ProcessDummyHovercraft(cVehicleParams &)                                 
0x501270 CAEVehicleAudioEntity::ProcessDummyGolfCart(cVehicleParams &)                                   
0x501480 CAEVehicleAudioEntity::ProcessDummyVehicleEngine(cVehicleParams &)                              
0x501650 CAEVehicleAudioEntity::ProcessPlayerJet(cVehicleParams &)                                       
0x501960 CAEVehicleAudioEntity::ProcessDummyJet(cVehicleParams &)                                        
0x501AB0 CAEVehicleAudioEntity::ProcessSpecialVehicle(cVehicleParams &)                                  
0x501C50 CAEVehicleAudioEntity::ProcessAircraft(cVehicleParams &)                                        
0x501E10 CAEVehicleAudioEntity::ProcessVehicle(CPhysical *)                                              
0x502280 CAEVehicleAudioEntity::Service(void)

_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1316

Posted 02 January 2014 - 03:44 AM Edited by _DK, 02 January 2014 - 03:53 AM.

CVehicleModelInfo completed.
#pragma once
#include "plugin\plugin.h"
#include "CClumpModelInfo.h"
#include "RenderWare.h"
#include "CVector.h"
#include "CQuaternion.h"
#include "RwObjectNameIdAssocation.h"
#include "CRGBA.h"

enum VehicleUpgradePosn
{
	UPGRADE_BONNET,
	UPGRADE_BONNET_LEFT,
	UPGRADE_BONNET_RIGHT,
	UPGRADE_BONNET_DAM,
	UPGRADE_BONNET_LEFT_DAM,
	UPGRADE_BONNET_RIGHT_DAM,
	UPGRADE_SPOILER,
	UPGRADE_SPOILER_DAM,
	UPGRADE_WING_LEFT,
	UPGRADE_WING_RIGHT,
	UPGRADE_FRONTBULLBAR,
	UPGRADE_BACKBULLBAR,
	UPGRADE_LIGHTS,
	UPGRADE_LIGHTS_DAM,
	UPGRADE_ROOF,
	UPGRADE_NITRO,
};

#pragma pack(push, 4)
struct PLUGIN_API UpgradePosnDesc
{
	CVector m_vPosition;
	CQuaternion m_qRotation;
	int m_dwParentComponentId;
	UpgradePosnDesc();
	~UpgradePosnDesc();
};
#pragma pack(pop)

#pragma pack(push, 1)
class PLUGIN_API CVehicleModelInfo : public CClumpModelInfo
{
public:
	RpMaterial *m_pPlateMaterial;
	char m_plateText[8];
	__int8 field_30;
	unsigned __int8 m_nPlateType;
	char m_nGameName[8];
	__int16 pad0;
	unsigned __int32 m_dwType;
	float m_fWheelSizeFront;
	float m_fWheelSizeRear;
	unsigned __int16 m_wWheelModelId;
	unsigned __int16 m_wHandlingIndex;
	unsigned __int8 m_nNumDoors;
	unsigned __int8 m_nClass;
	unsigned __int8 m_nFlags;
	unsigned __int8 m_nWheelUpgradeClass;
	unsigned __int16 m_wTimesUsed;
	unsigned __int16 m_wFrq;
	union{
		unsigned __int32 m_dwCompRules;
		struct{
			unsigned __int32 m_nExtraA_comp1 : 4;
			unsigned __int32 m_nExtraA_comp2 : 4;
			unsigned __int32 m_nExtraA_comp3 : 4;
			unsigned __int32 m_nExtraA_rule : 4;
			unsigned __int32 m_nExtraB_comp1 : 4;
			unsigned __int32 m_nExtraB_comp2 : 4;
			unsigned __int32 m_nExtraB_comp3 : 4;
			unsigned __int32 m_nExtraB_rule : 4;
		};
	};
	float m_fBikeSteerAngle;

	class CVehicleStructure{
	public:
		CVector m_avDummyPosn[15];
		UpgradePosnDesc m_aUpgrades[18];
		RpAtomic *m_apExtras[6];
		unsigned char m_nNumExtras;
		unsigned int m_dwMaskComponentsDamagable;
		CVehicleStructure();
		~CVehicleStructure();
		static class CPool *m_pInfoPool;
	} *m_pVehicleStruct;

	__int8 field_60[464];
	RpMaterial *m_apDirtMaterials[16];
	__int8 field_270[64];
	unsigned __int8 m_anPrimaryColors[8];
	unsigned __int8 m_anSecondaryColors[8];
	unsigned __int8 m_anTertiaryColors[8];
	unsigned __int8 m_anQuaternaryColors[8];
	unsigned __int8 m_nNumColorVariations;
	unsigned __int8 m_nLastColorVariation;
	unsigned __int8 m_nPrimaryColor;
	unsigned __int8 m_nSecondaryColor;
	unsigned __int8 m_nTertiaryColor;
	unsigned __int8 m_nQuaternaryColor;
	__int16 m_awUpgrades[18];
	__int16 m_awRemapTxds[5];
	class CAnimBlock *m_pAnimBlock;

	static class CLinkedUpgradeList{
	public:
		__int16 m_wUpgrade1[30];
		__int16 m_wUpgrade2[30];
		unsigned __int32 m_dwLinksCount;
		// add upgrade with components upgrade1 and upgrade2
		void AddUpgradeLink(short upgrade1, short upgrade2);
		// find linked upgrade for this upgrade. In this case upgrade param could be upgrade1 or 
		// upgrade2
		short FindOtherUpgrade(short upgrade);
	} &ms_linkedUpgrades;

	// vehicle components description tables
	// static RwObjectNameIdAssocation ms_vehicleDescs[12];
	static RwObjectNameIdAssocation *ms_vehicleDescs;

	// vehiclelights128 texture
	static RwTexture *ms_pLightsTexture;
	// vehiclelightson128 texture
	static RwTexture *ms_pLightsOnTexture;
	
	// color of currently rendered car
	// static unsigned __int8 ms_currentCol[4];
	static unsigned __int8 *ms_currentCol;

	// number of wheel upgrades available
	// tatic __int16 ms_numWheelUpgrades[4];
	static __int16 *ms_numWheelUpgrades;

	// wheels upgrades data
	// static __int16 ms_upgradeWheels[15][4];
	static __int16 *ms_upgradeWheels;

	// lights states for currently rendered car
	// static __int8 *ms_lightsOn[4];
	static __int8 *ms_lightsOn;

	// extras ids for next-spawned car
	// static __int8 ms_compsUsed[2];
	static __int8 *ms_compsUsed;

	// vehicle colours from carcols.dat
	// static CRGBA ms_vehicleColourTable[128];
	static CRGBA *ms_vehicleColourTable;

	CVehicleModelInfo();
	~CVehicleModelInfo();

	// destroying vehiclelights textures
	static void ShutdownLightTexture();
	// find remap texture with name
	static RwTexture *FindTextureCB(char  const* name);
	// start using special finding callback
	static void UseCommonVehicleTexDicationary();
	// stop using special finding callback
	static void StopUsingCommonVehicleTexDicationary();
	// set new parent frame for object. Data is actually RwFrame *
	static RpAtomic *MoveObjectsCB(RwObject *object, void *data);
	// this is used to disable _dam atomic and "enable" _ok atomic at vehicle model setup. Data is 
	// unused
	static RpAtomic *HideDamagedAtomicCB(RpAtomic *atomic, void *data);
	// hide all atomics with state data (data is actually unsigned char)
	static RpAtomic *HideAllComponentsAtomicCB(RpAtomic *atomic, void *data);
	// check if material has alpha. Boolean result is stored to data (data is actually bool *)
	static RpMaterial *HasAlphaMaterialCB(RpMaterial *material, void *data);
	// setup atomic renderer. Data is unused
	static RpAtomic *SetAtomicRendererCB(RpAtomic *atomic, void *data);
	// setup heli renderer. Data is unused
	static RpAtomic *SetAtomicRendererCB_RealHeli(RpAtomic *atomic, void *data);
	// setup plane renderer. Data is unused
	static RpAtomic *SetAtomicRendererCB_Plane(RpAtomic *atomic, void *data);
	// setup boat renderer. Data is unused
	static RpAtomic *SetAtomicRendererCB_Boat(RpAtomic *atomic, void *data);
	// setup heli renderer. Data is unused
	static RpAtomic *SetAtomicRendererCB_Heli(RpAtomic *atomic, void *data);
	// setup train renderer. Data is unused
	static RpAtomic *SetAtomicRendererCB_Train(RpAtomic *atomic, void *data);
	// setup model render callbacks
	void SetAtomicRenderCallbacks();
	// setup objects flag. Data is actually flag (unsigned short)
	static RwObject *SetAtomicFlagCB(RwObject *object, void *data);
	// clear all atomic flag. Data is actually flag (unsigned short)
	static RwObject *ClearAtomicFlagCB(RwObject *object, void *data);
	// set component flags
	void SetVehicleComponentFlags(RwFrame *component, unsigned int flags);
	// get wheel position. Wheel is wheel id [0-3]. Local - get local offset (if false it will get 
	// world position)
	void GetWheelPosn(int wheel, CVector &outVec, bool local);
	// get component local offset. Component is a frame hierarchy id. Returns true if component present
	bool GetOriginalCompPosition(CVector &outVec, int component);
	// get vehicle extra with rules. Returns extra id.
	int ChooseComponent();
	// get vehicle second extra with rules. Returns extra id.
	int ChooseSecondComponent();
	// check if upgrade is available
	bool IsUpgradeAvailable(VehicleUpgradePosn upgrade);
	// change colors and settings of material according to vehicle color and lights states.  Data 
	// contains pointer to restore entries
	RpMaterial *SetEditableMaterialsCB(RpMaterial *material, void *data);
	// execute SetEditableMaterialsCB(RpMaterial *, void *) for atomic materials and also remove
	// vehicle window if needed. Data contains pointer to restore entries
	RpAtomic *SetEditableMaterialsCB(RpAtomic *atomic, void *data);
	// execute SetEditableMaterialsCB(RpAtomic *, void *) for atomics in clump. This one is called
	// before vehicle rendering
	void SetEditableMaterials(RpClump *clump);
	// reset materials settings. This one is called after vehicle rendering
	void ResetEditableMaterials(RpClump *clump);
	// set current vehicle colour for model
	void SetVehicleColour(unsigned char prim, unsigned char sec, unsigned char tert, 
		unsigned char quat);
	// get color for car. variationShift determines how many color variations to skip. 
	// For example, 1 will simply give you next color variation.
	void ChooseVehicleColour(unsigned char &prim, unsigned char &sec, unsigned char &tert, 
		unsigned char &quat, int variationShift);
	// get num remaps in this model
	int GetNumRemaps();
	// add remap to model. Txd is id of tex dictionary.
	void AddRemap(int txd);
	// adds wheel upgrade. This one is called from LoadVehicleUpgrades()
	static void AddWheelUpgrade(int wheelSetNumber, int modelId);
	// gets num upgrades for this set
	static int GetNumWheelUpgrades(int wheelSetNumber);
	// gets whell upgrade
	static void GetWheelUpgrade(int wheelSetNumber, int wheelUpgradeNumber);
	// do nothing
	static void DeleteVehicleColourTextures();
	// loads 'white' texture
	static void LoadEnvironmentMaps();
	// unloads 'white' texture
	static void ShutdownEnvironmentMaps();
	// gets mat effect of this material. Data is actually int *
	static RpMaterial *GetMatFXEffectMaterialCB(RpMaterial *material, void *data);
	// sets mat effect for this meterial. Data is actually int
	static RpMaterial *SetEnvironmentMapCB(RpMaterial *material, void *data);
	// sets environment map intensity. Data is acually unsigned int
	static RpMaterial *SetEnvMapCoeffCB(RpMaterial *material, void *data);
	// do nothing
	static RpAtomic *SetRenderPipelinesCB(RpAtomic *atomic, void *data);
	// setups rendering pipelines for atomics in model (CCustomCarEnvMapPipeline::CustomPipeAtomicSetup)
	void SetRenderPipelines();
	// gets car plate text
	// return m_plateText[0] != '\0' ? m_plateText : NULL;
	char *GetCustomCarPlateText();
	// sets plate text
	void SetCustomCarPlateText(char *text);
	// gets max number of passengers for model
	static int GetMaximumNumberOfPassengersFromNumberOfDoors(int modelId);
	// remove some unused materials in model?
	void ReduceMaterialsInVehicle();
	// setup lights states for currenly rendered vehicle
	void SetupLightFlags(CVehicle *vehicle);
	// move all objects from data (it is actually RwFrame *) to frame
	static RwFrame *CollapseFramesCB(RwFrame *frame, void *data);
	// setup vehicle model components
	void PreprocessHierarchy();
	// setup environment map for atomic's materials. Data is actually int and it represents effect id
	static RpAtomic *SetEnvironmentMapAtomicCB(RpAtomic *atomic, void *data);
	// setup environment map intensity for atomic with data (unsigned int)
	static RpAtomic *SetEnvMapCoeffAtomicCB(RpAtomic *atomic, void *data);
	// setup custom plate
	void SetCarCustomPlate();
	// disable environment map effect on model
	void DisableEnvMap();
	// setup environment map intensity for model
	void SetEnvMapCoeff(float coeff);
};
#pragma pack(pop)

VALIDATE_SIZE(CVehicleModelInfo, 0x308);
There are too many unsued fields. Possibly left from III/VC painting system (arrays of poiners for editable materials), and also looks like field_270 is an additional buffer for dirt materials. I DON'T KNOW WHY, but Steam & Mobile versions use 32 dirt layers while PC 1.0 uses 16.
And field_30 is possibly a null-terminator (?)

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#1317

Posted 07 January 2014 - 02:58 PM Edited by Deji, 07 January 2014 - 03:45 PM.

CVehicleModelInfo completed.

<*snip*>
There are too many unsued fields. Possibly left from III/VC painting system (arrays of poiners for editable materials), and also looks like field_270 is an additional buffer for dirt materials. I DON'T KNOW WHY, but Steam & Mobile versions use 32 dirt layers while PC 1.0 uses 16.
And field_30 is possibly a null-terminator (?)

 

 

The PC 1.0 version should use 16 layers (based on how the function at 0x5D5BC0 divides the texture) - which was fixed since 1.01 (R* included 'dirty cars now able to get clean' fix from here), however there are additional problems with the code which need fixing as you may remember from when you helped me when I was trying to fix it for VJ. Unfortunately, I no longer remember how I eventually did it despite recording a video of the completed work :p Fortunately, the information supplied with the mobile version should make this tonnes easier.

 

I guess MTA will get a huge boost in productivity too, which means they'll most likely soon have heaps more useful things documented.

 

 

SA Mobile class, functions and variables list (similar format to that gta3 class list file)

https://dl.dropboxus...asslist.txt.zip

Could not paste it on pastebin because it's too big, anyone with PRO account should do it  :p

I'm on it! :p


_DK
  • _DK

    Homie

  • Feroci Racing
  • Joined: 12 Apr 2009
  • Ukraine

#1318

Posted 20 January 2014 - 01:40 PM

6A2F80     ; CAutomobile::DebugCode(void)

R*'s code for changing & testing handling.cfg in-game? :p


Danikov
  • Danikov

    The Fake Russian

  • Members
  • Joined: 27 Aug 2009
  • Israel

#1319

Posted 22 January 2014 - 06:22 PM

6A2F80     ; CAutomobile::DebugCode(void)

R*'s code for changing & testing handling.cfg in-game? :p

 

would it be possible to make an in-game handling editor with this?


JoeBullet
  • JoeBullet

    Player Hater

  • Members
  • Joined: 04 Dec 2011

#1320

Posted 27 January 2014 - 08:08 PM

Actually some members of MTA team do have pretty much complete GTA-SA IDB which was done by early reversers, even though some info was lost while converting between versions of IDA or something, go figure... There is next to none chance it will ever see a light of a day however.





2 user(s) are reading this topic

1 members, 1 guests, 0 anonymous users