Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
ikt

CHandlingData in memory

Recommended Posts

ikt

So I'm making a realtime handling editor and I thought this could be useful. Mainly that CHandlingData somewhat is completely represented in memory. Found the following thing on Google: http://www.unknowncheats.me/forum/1229279-post294.html. Decided to completely check it and finish it.

 

Pointer to struct @ Vehicle+0x830 (b791_2)

 

Offsets within CHandlingData:

 

 

const struct HandlingOffset {	DWORD dwHandlingNameHash = 0x0008;	int fMass = 0x000C;	int fInitialDragCoeff = 0x0010;	// 0x0014	// 0x0018	// 0x001C	vecOffset vecCentreOfMass = {		0x0020,		0x0024,		0x0028};	// 0x002C	vecOffset vecInertiaMultiplier = {		0x0030,		0x0034,		0x0038};	// 0x003C	int fPercentSubmerged = 0x0040;	int fSubmergedRatio = 0x0044;	int fDriveBiasFront = 0x0048;	int fDriveBiasRear = 0x004C;	uint8_t nInitialDriveGears = 0x0050;	int fDriveInertia = 0x0054;	int fClutchChangeRateScaleUpShift = 0x0058;	int fClutchChangeRateScaleDownShift = 0x005C;	int fInitialDriveForce = 0x0060;	int fDriveMaxFlatVel = 0x0064;	int fInitialDriveMaxFlatVel = 0x0068;	int fBrakeForce = 0x006C;	// 0x0070	int fBrakeBiasFront = 0x0074;	int fBrakeBiasRear = 0x0078;	int fHandBrakeForce = 0x007C;	int fSteeringLock = 0x0080;	int fSteeringLockRatio = 0x0084;	int fTractionCurveMax = 0x0088;	int fTractionCurveMaxRatio = 0x008C;	int fTractionCurveMin = 0x0090;	int fTractionCurveRatio = 0x0094;	int fTractionCurveLateral = 0x0098;	int fTractionCurveLateralRatio = 0x009C;	int fTractionSpringDeltaMax = 0x00A0;	int fTractionSpringDeltaMaxRatio = 0x00A4;	int fLowSpeedTractionLossMult = 0x00A8;	int fCamberStiffness = 0x00AC;	int fTractionBiasFront = 0x00B0;	int fTractionBiasRear = 0x00B4;	int fTractionLossMult = 0x00B8;	int fSuspensionForce = 0x00BC;	int fSuspensionCompDamp = 0x00C0;	int fSuspensionReboundDamp = 0x00C4;	int fSuspensionUpperLimit = 0x00C8;	int fSuspensionLowerLimit = 0x00CC;	int fSuspensionRaise = 0x00D0;	int fSuspensionBiasFront = 0x00D4;	int fSuspensionBiasRear = 0x00D8;	int fAntiRollBarForce = 0x00DC;	int fAntiRollBarBiasFront = 0x00E0;	int fAntiRollBarBiasRear = 0x00E4;	int fRollCentreHeightFront = 0x00E8;	int fRollCentreHeightRear = 0x00EC;	int fCollisionDamageMult = 0x00F0;	int fWeaponDamageMult = 0x00F4;	int fDeformationDamageMult = 0x00F8;	int fEngineDamageMult = 0x00FC;	int fPetrolTankVolume = 0x0100;	int fOilVolume = 0x0104;	// 0x0108	int fSeatOffsetDistX = 0x010C;	int fSeatOffsetDistY = 0x0110;	int fSeatOffsetDistZ = 0x0114;	int nMonetaryValue = 0x0118;	DWORD dwStrModelFlags = 0x011C;	DWORD dwStrHandlingFlags = 0x0120;	DWORD dwStrDamageFlags = 0x0124;	DWORD dwAIHandlingHash = 0x0134;} hOffsets = {};
Offsets with // VERIFIED behind them are all manually verified by me. (I re-checked all of the UnknownCheats post, since a few seemed to be off). Comments indicate how the value in handling.meta translates to the value in memory, if needed. This is useful/essential to get the correct balance.

*BiasFront in the handling.meta have these matching pairs.

 

Steering lock appears to be in radians for the inner wheel, while handling.meta uses degrees.

 

Handling editor can be seen here:

https://github.com/E66666666/GTAVHandlingEditor/

 

I haven't finished the part where everything is read and written yet and I'm trying to find a less stupid way of doing this, but the offsets should all work if you plug them in the correct conversion method (if needed).

 

Update: Fixed a few offsets.

 

Final update:

Handling editor is released. Take it as a demo, or something.

 

Update - Turns out leftas completely reversed the class before. Updated the struct with offsets.

Edited by ikt

Share this post


Link to post
Share on other sites
ikt

Real Time Handling Editor is done, as an .asi script.

 

I hope this info and this tool proves to be useful for somebody.

Edited by ikt

Share this post


Link to post
Share on other sites
unknown modder

The correct way to do this is look at how the exe loads the handling data instead of comparing memory structures with handling data

Share this post


Link to post
Share on other sites
ikt

I sadly don't have experience with reverse engineering executables and assembly to make proper use of things like IDA.

Share this post


Link to post
Share on other sites
InfamousSabre

Nice work! we need more threads like this

Share this post


Link to post
Share on other sites
Skorpro

The correct way to do this is look at how the exe loads the handling data instead of comparing memory structures with handling data

True :^: But I'm happy with ikt's method too :)

A :cookie: for you, ikt!

And a :cookie: for you, unknown modder (G_index 2576573 & decompiled scripts)!

Share this post


Link to post
Share on other sites
luckyma1990

@ikt

 

Thanks so much for your

GTAVHandlingEditor

project in github. Helped me solve a very annoying problem!!! Already stared!

Share this post


Link to post
Share on other sites
Cal_fromdabow

Now we just need those subclasses and we'll have conquered rockstar

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.