Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,181 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. 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

    2. Red Dead Redemption

    3. 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. Forum Support

    2. 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

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