Quantcast

Jump to content

» «
Photo

CHandlingData in memory

6 replies to this topic
ikt
  • ikt

    _

  • Members
  • Joined: 02 Oct 2006
  • None

#1

Posted 02 October 2016 - 06:05 PM Edited by ikt, 08 October 2016 - 03:31 PM.

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.unknownch...79-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/E...HandlingEditor/

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.
  • Skorpro, jedijosh920, Jitnaught and 2 others like this

ikt
  • ikt

    _

  • Members
  • Joined: 02 Oct 2006
  • None

#2

Posted 02 October 2016 - 11:56 PM Edited by ikt, 02 October 2016 - 11:56 PM.

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

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

unknown modder
  • unknown modder

    Bon Jon Bovi

  • Members
  • Joined: 04 Jul 2012
  • United-Kingdom

#3

Posted 03 October 2016 - 08:13 AM

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

ikt
  • ikt

    _

  • Members
  • Joined: 02 Oct 2006
  • None

#4

Posted 03 October 2016 - 08:36 AM

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


InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#5

Posted 03 October 2016 - 12:23 PM

Nice work! we need more threads like this

  • Skorpro and Jitnaught like this

Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#6

Posted 08 October 2016 - 03:23 PM

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)!

  • unknown modder likes this

luckyma1990
  • luckyma1990

    Player Hater

  • Members
  • Joined: 10 Dec 2016
  • China

#7

Posted 10 December 2016 - 08:47 AM

@ikt

 

Thanks so much for your

GTAVHandlingEditor

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

  • ikt likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users