Hex editor

Posted by TheFueleffect 
Hex editor
Date: April 17, 2015 05:06PM
Posted by: TheFueleffect
Hi everyone,

Some time ago I e-mailed Belini if he knew how to cure the unrealistic slipstream effect in GP4. He gave me a lot of potentially useful data relating to the slipstream effect, AI blocking behavior and many more. The changes are made through the exe by using a hex editor. Unfortunately, the entries below don't seem to match the entries in my hex editor. I'd like to know which entries in the hex editor are related to:
1) Slipstream values
2) AI blocking behavior
3) The default grip (74 0D should be changed into 90 90 somewhere to change your own default grip to the value in the performance file)

Does anyone know?

Data from Belini in the hex editor:

SPA TRACK SELECT?
00419C26 83 3D 30 EE 7E 00 0D cmp dTrackNr, 13
00419DB8 83 3D 30 EE 7E 00 0D cmp dTrackNr, 13

005534C0 00 55 00 00 BLOCKING?

COCKPIT PATCHING
SOFTWARE: 45295A TO 45349C
HARDWARE: 458538 TO 45907A

FIND: 82FFFFFF0000

CAMERA 18A2CE
ORIG 2001 2010
Y COORD -20 -19 -21
Z COORD 28 28 28
PITCH -1 -3 -3
DETAIL 2 72 72 72

ROLLBAR CAM
18A330 X B0FF -80 0
18A332 Y D8FF -40 80
18A334 Z 48FE -440 -60
18A336 DIR 007D 32000 0
18A338 PITCH 007D 0 -6
18A33A ROLL 007D 0

18A33C DETAIL1 000F 3840
18A33D DETAIL2 0005 1280


SPRITE/POLYGON - 0=BOTH SPRITE 1=SPRITE 256=POLY 257=BOTH POLY
18A340 REAR 0000 0 0
18A342 FRONT 0000 256 257


---------------------------------------------------------------
FUEL 2006
00551F30 46 AC 06 00 FuelWeight PATCHED 69 02 0A 00 655977
00551F34 1F D4 18 00 FuelWeight2 PATCHED 6A 8D 10 00 1084778
151F34

BLOCKING

00552F12 20 00 OvertakeDistance_32 dw 20h 10 00 NOT PATCHED 2001
00552F38 70 00 OvertakeDistance_112 50 00 NOT PATCHED 2001
00552F78 00 10 00 00 BlockingAmount 00 04 00 00
00552F7C 28 00 OvertakeDistance_40 18 00 NOT PATCHED 2001

------------------------------------------------------------------------------------------
2010 FULL FUEL PIT STOP

00406864 75 0C FULL FUEL JUMP 90 90 CARS START WITH FULL FUEL
0040686D 83 C0 02 ADDS 2 LAPS PITSTOP FUEL NOT PATCHED
0040687D 83 C0 02 ADDS 2 LAPS RACE FUEL NOT PATCHED

0042BB56 05 BE 0A 00 00 MIN FUEL STOP 2570 - PATCHED 2304 00 09
0042BBE5 05 50 46 00 00 MAX REPAIR TIME 18000 - PATCHED 12000 E0 2E
0042BCA6 05 58 1B 00 00 MIN PIT STOP TIME 7000 - PATCHED 1000 E8 03

00552008 E0 2E 00 00 FUEL FLOW 12000 - PATCHED 1066576 50 46 10 00
152008

00406BE1 66 8B 56 60 NOPE 2010 FULL FUEL Car.wFuelLaps
90 90 90 90
00406BE5 66 89 46 60 NOPE 2010 FULL FUEL
90 90 90 90

----------------------------------------------------------------------------

PIT STOP

0042BB56 05 BE 0A 00 00 MIN RANDOM STOP 2570 - PATCHED 1000 E8 03
0042BB61 3D 00 19 00 00 MAX RANDOM STOP 6400 - PATCHED 4000 A0 0F
0042BB68 B8 00 19 00 00 6400 - PATCHED 4000 A0 0F

0042BBE5 05 50 46 00 00 MAX REPAIR TIME 18000 - PATCHED 12000 E0 2E
0042BCA6 05 58 1B 00 00 MIN PIT STOP TIME 7000 - PATCHED 1000 E8 03

00552008 E0 2E 00 00 FUEL FLOW 12000 - PATCHED 18000 50 46 00 00
152008

0042BE73 E8 3D AC FD FF call sub_406AB5

-------------------------------------------------------------------------------------------
PRACTICE LAP LIMIT
00478F84 C7 05 2C 44 80 00 10 27 00 00 mov dTotalNumLaps, 10000 PATCHED 5A 00 (90LAPS)

HOTSEAT TYRE PATCH
00437C71 83 F8 15 cmp eax, 21 16
00437C74 7E 05 jle short loc_437C7B ; 90 90 player tyre wear equal
00437C76 B8 15 00 00 00 mov eax, 21 16
______________________________________________________________________________________________


PLAYER GRIP AS AI
13D78 74 0D

17342 B8 FD 02 00 00 MAX TORQUE BHP PATCHED 829 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

16FE24 gp32k torque 0056FE24 PATCHED
22EE9C gp4 torque 0062EE9C

REVS LIMIT
1651C4 00 20 4E 00 rev_limit 5120000=19900 2001=4E054C00 PATCHED 19000


------------------------------------------------------------------------
DEFAULT GRIP 16200

PLAYER GRIP AS AI
00413D71 F6 86 8D 00 00 00 01 test [esi+Car.flags_8D], 1 ; 1=add extra weight? 2=in pitlane 4=session over 10=had failure 20=moved in pit menu 80=not yet in pitbox
00413D78 74 0D jz short loc_413D87
90 90
STOPS PUSH 1024
174A8 81 FD 00 04 00 00 81 FD 30 04 00 00 1072
174B0 BD 00 04 00 00 BD 30 04 00 00 1072


151928 gp32k slipstream 00 00 04 00 PATCHED 00 02 00 00

00552EE4 80 01 Slipstream_384 PATCHED 20 01 288
00552EE6 00 01 Slipstream_256 PATCHED C0 00 192

0041130A BA 05 41 00 00 player default brake PATCHED 00 38
1130A

00478F84 C7 05 2C 44 80 00 10 27 00 00 MAX PRACTICE LAPS 10000 PATCHED 5A 00 (90)
78F84

00551F30 46 AC 06 00 FuelWeight 437318 PATCHED B8 AD 0C 00 830904 22 03 0D 00 852770
00551F34 1F D4 18 00 FuelWeight2 (1627167) NOT PATCHED 8D BB 0C 00 834445
151F34

00552254 00 40 00 00 PlayerDefaultWet PATCHED 00 3D
152254

00553492 00 3B BrakeDistance PATCHED 00 32 GP4 00 3D
153492

00566EA0 00 40 00 00 CornerGrip PATCHED 00 48
166EA0

0056FB90 69 20 00 00 gp32k_8297_gp4_8665 PATCHED D9 21
0056FB94 97 1F 00 00 gp32k_8087_gp4_7719 PATCHED 27 1E

0056FF90 00 rev_band PATCHED

BHP
00417322 B8 2A 03 00 00 mov eax, 810 qual
00417330 B8 2A 03 00 00 mov eax, 810 race
00434684 BF 2A 03 00 00 mov edi, 810 qual
00434689 B9 2A 03 00 00 mov ecx, 810 race
004346C6 BD 2A 03 00 00 mov ebp, 810 qual
004346D2 BD 2A 03 00 00 mov ebp, 810 race



_______________________________________________________________________
TYRE STUFF
004163D8 75 65 jnz short locret_41643F ; EB removes player tyres
0041643D 75 A5 jnz short loc_4163E4 ; 90 90 player tyre wear equal - pcar eratic after change over
0042D07D 74 5E jz short locret_42D0DD ; all tyre wear increased
0042D116 75 05 jnz short loc_42D11D ; EB bypasses player tyre wear
00437C74 7E 05 jle short loc_437C7B ; 90 90 player tyre wear equal - no ai tyre wear
00437DC6 60 pusha ; Converts tyre wear. Called when going from cockpit to car setup menu
____________________________________________________________________________________________
REVS
0041230B 3D 38 4A 00 00 cmp eax, 19000
00412312 B8 38 4A 00 00 mov eax, 19000

00412713 66 81 7E 62 10 27 cmp [esi+Car.wRevs], 10000
0041271B 66 C7 46 62 10 27 mov [esi+Car.wRevs], 10000

126FA 3D 20 4E 00 00 cmp eax, 20000 UPPER REV LIMIT
12701 B8 20 4E 00 00 mov eax, 20000 UPPER REV LIMIT
1272E 3D 68 42 00 00 cmp eax, 17000 GEAR REVS
12735 B8 68 42 00 00 mov eax, 17000
127D7 81 FD 68 42 00 00 cmp ebp, 17000
127DF BD 68 42 00 00 mov ebp, 17000

--------------------------------------------------------------------------------------
00413063 81 C5 00 40 00 00 default brake NOT PATCHED 00 4C

004052AC 81 FD 00 10 00 00 cmp ebp, 4096 00 08
004052CA 3D 00 40 00 00 cmp eax, 16384 00 20

004353B6 66 81 FB 00 58 cmp bx, 22528
353B6
------------------------------------------------------------------------------------

0055259C 00 20 00 00 value_8192_55259C 00 30 00 00
005525A0 00 28 00 00 FrontWing_10240 00 38 00 00
1525A0

00552F82 20 00 word_552F82 10 00 MAYBE AI MORE CAUTIOUS/OVERTAKE DISTANCE
00552F84 40 00 SLIPSTREAM SECTORS??? 10 00 CAUSES ERATIC OVERTAKE
00552F86 40 00 word_552F86 10 00
00552F88 20 00 word_552F88

00552ED8 00 02 00 03

00552EDC 00 02 Slipstream_512

00552EEA 19 00

00552F0C A0 01 Blocking?_416 dw 1A0h A0 00
00552F0E 38 00 word56_552F0E dw 38h
00552F10 40 00 word64_552F10 dw 40h

00552F4A 30 01 word_552F4A

00566E34 00 40 00 00 PlayerGrip_16384 dd 4000h

0056FC80 4C 00 physics_76_ccline
0056FCF0 00 00 00 00 00 80 4B 40 dbl55_56FCF0 IMPROVES OVERTAKE????

5707E8 00 3C 00 00 dword_5707E8 grip 4 wheels
00 3C 00 00
00 3C 00 00
00 3C 00 00

00570808 00 40 00 00 slipstream?16384_570808 MAYBE AI MORE CAUTIOUS
00570AD8 00 40 00 00 slipstream?_16384_570AD8 MAYBE AI MORE CAUTIOUS



0043977C 05 00 40 00 00 add eax, 16384
00439781 F7 2D F4 0A 57 00 imul ai_Traction_Off_Line_22528

____________________________________________________________________

005701D8 E8 01 57 00 value_5702120 (gp4 = 6484576 ) 60 F2 62 00

005525AC 00 40 00 00 RearWing_16384

___________________________________________________________________

00413D78 grip

0056FC40 66 physics_3_05 db 66h ; f ; (gp32k=3.05 gp3=2.655 gp4=3.05) downforce drag ratio
NO EFFECT

0056FC48 CD physics_2_725 db 0CDh ; _ ; (gp32k=2.725 gp3=2.405 gp4=2.78) downforce drag ratio
GP32K

0056FC50 33 DownforceDrag_ratio db 33h ; 3 ; downforce drag ratio 2.4 (gp3 2.155 gp4 2.5)
NO EFFECT GPX

0056FC68 7B physics_drag_1543_22 db 7Bh ; { ; (gp32k=1543.22 gp3=1535.44 gp4=1820)
NO EFFECT

0056FC70 C3 DownforceCoeff_1984_14 db 0C3h ; _ ; ( gp32k=1984.14 gp4=2202 )
GP32K

0056FC78 85 physics_2425_06 db 85h ; ? ; (gp32k=2425.06 gp3=2412.84 gp4=2360)
NO EFFECT GPX


0056FC80 4C 00 00 00 grip/downforce value 76

------------------------------------------------------------------------------------------------------------------------------
005520F4 00 40 ; DATA XREF: sub_41A6A7+18r TWEAKER GRIP 1 GP4 16384
005522A0 00 3C ; DATA XREF: sub_41A6A7+27r TWEAKER GRIP 2 GP4 15360



16FC90 physics_revs_17000 dq 1.7e4
16FC98 physics_revs_16800 dq 1.68e4
16FCA0 physics_revs_16600 dq 1.66e4
00551F30 46 AC 06 00 FuelWeight_437318

0056FE18 B6 35 00 00 player_drag_13756
00551964 00 00 04 00 revs

--------------------------------------------------------------------------
REV LIMIT
0041272E 3D 68 42 00 00 cmp eax, 17000
00412733 7E 05 jle short loc_41273A
00412735 B8 68 42 00 00 mov eax, 17000

004127D3 0F BF 6E 62 movsx ebp, [esi+Car.wRevs]
004127D7 81 FD 68 42 00 00 cmp ebp, 17000
004127DD 7E 05 jle short loc_4127E4

0056FC90 00 00 00 00 00 9A D0 40 physics_revs_17000 dq 1.7e4
0056FC98 00 00 00 00 00 68 D0 40 physics_revs_16800 dq 1.68e4
0056FCA0 00 00 00 00 00 36 D0 40 physics_revs_16600 dq 1.66e4


-------------------------------------------------------------------------------------
0056FC50 DownforceDrag_ratio
0056FC48 (gp32k=2.725 gp3=2.405 gp4=2.78) downforce drag ratio
----------------------------------------------------------------

0056FE20 00 torque

00551928 00 00 04 00 Slipstream_value dd (262144)
00601C68 00 00 04 00 Slipstream gp4

00417342 B8 FD 02 00 00 drag mov eax, 765 (gp4 856 1B734) TEST 99 02

0042B1CE 7D 3C jge short loc_42B20C ; EB removes slipstream

00551B28 27 63 02 00 master_power dd 26327h

00551B38 D0 40 00 00 Player_PitSpeed dd 40D0h

00551B3C 00 40 00 00 Air_Resistance_Master dd 4000h

00551934 00 40 00 00 RearDownforce_16384

-------------------------------------------------------------------

0056FC40 66 (gp32k=3.05 gp3=2.655 gp4=3.05) downforce drag ratio GP3 VALUES SEEMS MORE RELIABLE

MAYBE FRONT WING SLIPSTREAM EFFECT
00553038 00 04 00 00 dword_553038 dd 400h


COCKPIT PATCHING
CAR EDITOR ONLY PATCHES SOFTWARE LOCATION 45295A TO 453497
HARDWARE: 458538 TO 45907A


-----------------------------------------------------------------------------


CAMERA VIEW
18A2CE 1C 10 camera_data

4533D9



0056FA7C 5B 83 awTeamPowerQual dw 835Bh ; DATA XREF: sub_434652r


PLAYER GRIP AS AI
00413D71 F6 86 8D 00 00 00 01 test [esi+Car.flags_8D], 1 ; 1=add extra weight? 2=in pitlane 4=session over 10=had failure 20=moved in pit menu 80=not yet in pitbox
00413D78 74 0D jz short loc_413D87
90 90

STOPS PUSH
174A8 81 FD 00 04 00 00 81 FD 00 08 00 00
174B0 BD 00 04 00 00 BD 00 08 00 00


----------------------------------------------------------------------------------------------
005701D8 E8 01 57 00 value_5702120 dd 5701E8h (gp4 = 6484576 )
60 F2 62 00
______________________________________________________________________________________________


004172E0 05 00 40 00 00 add eax, 16384 ; base revs 20480
00 50 00 00

00551B28 27 63 02 00 master_power dd 26327h 156455
A0 F7 03 00 260000



00417322 B8 2A 03 00 00 mov eax, 810 810
00417330 B8 2A 03 00 00 mov eax, 810 810

00417342 B8 FD 02 00 00 mov eax, 765 ; master drag 856 528
58 03 00 00

00434684 BF 2A 03 00 00 mov edi, 810 680
00434689 B9 2A 03 00 00 mov ecx, 810 680
A8 02 00 00

004346C6 BD 2A 03 00 00 mov ebp, 32Ah 810 680
004346D2 BD 2A 03 00 00 mov ebp, 32Ah 810 680
A8 02 00 00


______________________________________________________________________________________________________

GP32K START OF MAGIC DATA 16E514

005525AC 00 40 00 00 RearWing_16384 dd 4000h ; DATA XREF: sub_404DFD+DCr
005525BC 00 38 00 00 fuel_weight_14336 dd 3800h ; DATA XREF: sub_404907+91r

0041276C 81 C2 00 40 00 00 add edx, 16384

00417342 B8 FD 02 00 00 mov eax, 765 ; master drag 856 900

00551B3C 00 40 00 00 Air_Resistance_Master dd 4000h 00 69?


PLAYER GRIP
00566E34 00 40 00 00 PlayerGrip_16384 dd 4000h

PHYSICS
GP32K 16FC30
GP4 22ECB0

0056FC88 00 00 00 00 00 7C B5 40 physics_550 dq 5.5e3 ; DATA XREF: sub_40D8D9+50r
0056FC90 00 00 00 00 00 9A D0 40 physics_revs_17000 dq 1.7e4 ; DATA XREF: sub_40D8D9+44r
0056FC98 00 00 00 00 00 68 D0 40 physics_revs_16800 dq 1.68e4 ; DATA XREF: sub_40D8D9+1r
0056FCA0 00 00 00 00 00 36 D0 40 physics_revs_16600 dq 1.66e4 ; DATA XREF: sub_40D8D9+Dr
0056FCA8 00 00 00 00 00 00 89 40 physics_800 dq 8.0e2 ; DATA XREF: sub_40D8D9+19r
0056FCB0 00 00 00 00 00 4C AD 40 physics_3750 dq 3.75e3 ; DATA XREF: sub_40D8D9+5Cr
0056FCB8 9A 99 99 99 99 99 A9 3F dbl_56FCB8 dq 5.0e-2 ; DATA XREF: sub_40D8D9+68r
0056FCC0 F8 92 68 F7 1B 65 17 40 physics_finaldrive_ratio dq 5.848739496 ; DATA XREF: sub_40D8D9+8Cr
0056FCC0 ; sub_40E9E1r
0056FCC8 00 00 00 00 00 00 2B 40 dbl_56FCC8 dq 1.35e1 ; DATA XREF: sub_40D8D9+3DFr
0056FCC8 ; sub_40D8D9+403r
0056FCD0 00 00 00 00 00 00 28 40 dbl_56FCD0 dq 1.2e1 ; DATA XREF: sub_40D8D9+3F1r
0056FCD0 ; sub_40D8D9+409r
0056FCD8 33 33 33 33 33 A3 74 40 dbl_56FCD8 dq 3.302e2 ; DATA XREF: sub_40D8D9+1ABr
0056FCD8 ; sub_40D8D9+1E3r
0056FCE0 9A 99 99 99 99 3D 74 40 dbl_56FCE0 dq 3.2385e2 ; DATA XREF: sub_40D8D9+1F9r
0056FCE0 ; sub_40D8D9+537r
0056FCE8 00 00 00 00 00 A6 B6 40 dbl_56FCE8 dq 5.798e3 ; DATA XREF: sub_40D8D9+549r
0056FCE8 ; sub_40D8D9+567r
0056FCE8 ; sub_40D8D9+57Dr
0056FCF0 00 00 00 00 00 80 4B 40 dbl_56FCF0 dq 5.5e1 ; DATA XREF: sub_40D8D9+55Br



--------------------------------------------------------------------------------------------------------

BHP

004172DB C1 E0 03 shl eax, 3
004172DE F7 D8 neg eax
004172E0 05 00 40 00 00 add eax, 16384 ; base revs (new 19000) 23098
004172E5 A3 B4 20 55 00 mov dword_5520B4, eax
004172EA F6 05 BC 39 56 00 FF test byte_5639BC, Car.flags_FF
004172F1 74 12 jz short loc_417305
004172F3 81 3D B4 20 55 00 00 40+ cmp dword_5520B4, 16384 ; base revs (new 4096) 16384
004172FD 74 06 jz short loc_417305
004172FF 80 7E 72 06 cmp [esi+Car.bGear], 6 ; -1=reverse, 0=neutral 1-7=gear 1-7
00417303 74 00 jz short $+2

00417322 B8 2A 03 00 00 mov eax, 810 910 810
00417327 80 3D 3D 44 80 00 80 cmp bSessionMode, 80h
0041732E 74 05 jz short loc_417335
00417330 B8 2A 03 00 00 mov eax, 810 910 810
00417335
00417335 loc_417335: ; CODE XREF: sub_4172AF+7Fj
00417335 A3 3C C3 5F 00 mov gear_drag_revs??, eax
0041733A DB 05 3C C3 5F 00 fild gear_drag_revs??
00417340 DE C9 fmulp st(1), st
00417342 B8 FD 02 00 00 mov eax, 765 ; master drag 856 900
00417347 A3 3C C3 5F 00 mov gear_drag_revs??, eax
0041734C DB 05 3C C3 5F 00 fild gear_drag_revs??
00417352 DE F9 fdivp st(1), st
00417354 DC 0D E8 11 55 00 fmul physics_5_5
0041735A DB 1D 3C C3 5F 00 fistp gear_drag_revs??
00417360 A1 3C C3 5F 00 mov eax, gear_drag_revs??
00417365 3B 05 18 FE 56 00 cmp eax, player_drag_13756
0041736B 7D 05 jge short loc_417372
0041736D A1 18 FE 56 00 mov eax, player_drag_13756


00434679 66 81 3D 3C EE 7E 00 01+ cmp wOppStandard, 1
00434682 74 28 jz short loc_4346AC
EB 28 OR 90 90
00434684 BF 2A 03 00 00 mov edi, 810
00434689 B9 2A 03 00 00 mov ecx, 810


004346BE E8 86 00 00 00 call FwdSetCarPowerFromTrack??
004346C3 50 push eax
004346C4 F7 E7 mul edi
004346C6 BD 2A 03 00 00 mov ebp, 32Ah 810 680 810

004346CB F7 F5 div ebp
004346CD 8B F8 mov edi, eax
004346CF 58 pop eax
004346D0 F7 E1 mul ecx
004346D2 BD 2A 03 00 00 mov ebp, 32Ah 810 680 810

---------------------------------------------------------------------------
FORCE FEEDBACK
00552B88 00 40 00 00 forcefeedback_16384 dd 4000h ; DATA XREF: sub_4161AE+19Ar

CAR NUMBERS
008F53EC 23 08 00 00 dword_8F53EC dd 823h ; DATA XREF: sub_487BC1+3Br
GP3 = 181b00

BRAKING FORCE
0056FCE8 00 00 00 00 00 A6 B6 40 dbl_56FCE8 dq 5.798e3 ; DATA XREF: sub_40D8D9+549r
0056FCE8 ; sub_40D8D9+567r

004127B2 BA 26 02 00 00 mov edx, 550 slipstreaming????

00551B38 D0 40 00 00 Player_PitSpeed dd 40D0h ; DATA XREF: sub_411619+73r

11659
151B38

===================================
PLAYER GRIP AS AI
00413D71 F6 86 8D 00 00 00 01 test [esi+Car.flags_8D], 1 ; 1=add extra weight? 2=in pitlane 4=session over 10=had failure 20=moved in pit menu 80=not yet in pitbox
00413D78 74 0D jz short loc_413D87
90 90
GP4
00417C04 74 0D jz short loc_417C13 ; player grip as ai 90 90

GP3
1B4DB 74 90
1B4DC 0D 90


PIT STOP
0042BB39 E8 28 59 FD FF call GetRandomNumber
90 90 90 90 90

0042BB56 05 BE 0A 00 00 add eax, 2750 ; minimum time in pits?
05 00 04 00 00 1024

00552008 E0 2E 00 00 Fuel_Flow dd 12000
00 37 00 00 14080

00551F34 1F D4 18 00 fuel_data_value dd 18D41Fh ; DATA XREF: sub_4067B7+1Er


REMOVES 2x2
0042D8DF 66 3B 15 7C E4 56 00 cmp dx, dTrk_2x2
0042D8E6 7C 07 jl short loc_42D8EF
90 90

WORKS IN GP4 - NOT CORRECT IN GP32K
0042D8D0 80 7E 70 01 cmp byte ptr [esi+70h], 1
00

CAMERA VIEW
0058A2CE 1C 00
14 00 HEIGHT (GP4 13)
0058A2D0 EC FF
00 00 DISTANCE

PLAYER BHP
004347A3 A8 FF test al, Car.flags_FF
A8 00
004347A5 79 37 jns short loc_4347DE
EB 37

AI GRIP/BHP
00438FF1 0F B7 05 3A EE 7E 00 movzx eax, wOppLevel
EB 2C 90 90 90 90 90
004390DC B8 00 40 00 00 mov eax, 16384
EB 1E 00 00 00


SLIPSTREAMING
00551B3C 00 40 00 00 Air_Resistance_Master dd 4000h 00 69?
151B3C

00565BEC 00 08 00 00 dword_565BEC dd 800h
===================================
PLAYER GRIP
00566E34 00 40 00 00 PlayerGrip_16384 dd 4000h
00 3C

AI GRIP
00566E74 00 40 00 00 Aigrip_16384 dd 4000h

OVERALL GRIP
00566E98 00 40 00 00 OverallGrip_16384 dd 4000h

DOWNFORCE/DRAG
0056FC30 00 downforce_drag_ratio db 0 ;
0056FE20 00 TORQUE
00552CB8 70 3D 00 00 drag_factor dd 3D70h

PLAYER PIT SPEED LIMIT 324 = 1 MPH 50MPH = 16592
0041168C imul Player_PitSpeed

00551B38 D0 40 00 00 Player_PitSpeed dd 40D0h

-----------------------------------------------------------------------------------------
ORIG BHP/GRIP PATCH
00434786 75 07 jnz short loc_43478F
EB 07

004347A3 A8 FF test al, Car.flags_FF
A8 00

004347A5 79 37 jns short loc_4347DE
EB 37

00434941 F6 C2 FF test dl, Car.flags_FF
F6 C2 00

00439005 66 89 86 F6 00 00 00 mov [esi+Car.wPower], ax
90 90 90 90 90 90 90

00439018 66 89 86 0E 01 00 00 mov [esi+Car.field_10E]
90 90 90 90 90 90 90

-------------------------------------------------------------------------------

PHYSICS

16FB80 32.1873
16FB88 9.81071
16FB90 1.71606e-310

164C90 17000 17000
164C98 16800 800
164CA0 16600 16800
164CA8 800 16600


GP4 NOT PATCHED
22ED50 14 16FCC8 13.5
22ED58 11 16FCD0 12
NO DATA 16FD00 -515.535
-----------------------------------------

22EDE8 575 16FD68 580

22EDF0 649 16FD70 400
22EDF8 83.8 16FD78 85

NOT THE SAME
22EE00 16FD80
22EE28 16FDB0

--------------------------------------
17342 DRAG FD02 765 2B02 555 V4 GP4 5803 856 v5 A002 672

152CB8 DRAG FACTOR 703D 15728
151B3C SLIPSTREAMING 0040 16384 0044 17404
16FC58 DOWNFORCE COEFF

3465D POWER QUAL 3180 32817 NEW 807F 32640
3466C POWER RACE 3180 32817 NEW 807F 32640

00551B28 27 63 02 00 master_power dd 26327h

DRAG RELATED
0056FE18 B6 35 00 00 dword_56FE18 dd 35B6h

005511E8 00 00 00 00 00 30 81 40 dbl_5511E8 dq 5.5e2 ; DATA XREF: sub_4172AF+A5r
005511F0 09 A8 70 04 A9 EC 9C 40 dbl_5511F0 dq 1.851165056e3 ; DATA XREF: sub_4173F1+53r


-----------------------------------------------------------------
REV LIMIT
005651C4 00 20 4E 00 dword_5651C4 20000 ; DATA XREF: sub_4178A7+D0r

00434684 BF 2A 03 00 00 mov edi, 32Ah
00434689 B9 2A 03 00 00 mov ecx, 32Ah


004346C6 BD 2A 03 00 00 mov ebp, 32Ah
004346D2 BD 2A 03 00 00 mov ebp, 32Ah

0043471E 0F B7 04 45 38 E4 56 00 movzx eax, magic_PowerFactorAce[eax*2]
00434726 BA 27 31 08 00 mov edx, 536871




005651C4 00 20 4E 00 rev_limit dd 4E2000h

004126FA 3D 20 4E 00 00 cmp eax, 20000
004126FF 7E 05 jle short loc_412706
00412701 B8 20 4E 00 00 mov eax, 20000


00412722 53 push ebx
00412723 51 push ecx
00412724 52 push edx
00412725 BB BC 2C 55 00 mov ebx, offset physics??
0041272A 0F BF 46 62 movsx eax, [esi+Car.wRevs]
0041272E 3D 68 42 00 00 cmp eax, 17000
00412733 7E 05 jle short loc_41273A
00412735 B8 68 42 00 00 mov eax, 17000

004127C1 E8 5C FF FF FF call sub_412722
004127C6 F7 2D 70 19 57 00 imul dword_571970
004127CC 0F AC D0 08 shrd eax, edx, 8
004127D0 C1 FA 08 sar edx, 8
004127D3 0F BF 6E 62 movsx ebp, [esi+Car.wRevs]
004127D7 81 FD 68 42 00 00 cmp ebp, 17000
004127DD 7E 05 jle short loc_4127E4
004127DF BD 68 42 00 00 mov ebp, 17000


004126FA 3D 20 4E 00 00 cmp eax, 20000
004126FF 7E 05 jle short loc_412706
00412701 B8 20 4E 00 00 mov eax, 20000

0042BB1E 3D 20 4E 00 00 cmp eax, 20000
0042BB23 76 05 jbe short loc_42BB2A
0042BB25 B8 20 4E 00 00 mov eax, 20000

DEFAULT BHP 2
00434684 BF 2A 03 00 00 mov edi, 810
00434689 B9 2A 03 00 00 mov ecx, 810



____________________________________________________________________________________________
MAGIC DATA
0056E514 A6 TrackTable@56E514 db 166 ; DATA XREF: .data:0056E4D0o
0056E514 ; fw
0056E515 A5 db 165 ; rw
0056E516 B4 db 180 ; 1st
0056E517 B9 db 185 ; 2nd
0056E518 BE db 190 ; 3rd
0056E519 C3 db 195 ; 4th
0056E51A C9 db 201 ; 5th
0056E51B CF db 207 ; 6th
0056E51C A7 db 167 ; fw
0056E51D A7 db 167 ; rw

007EEE51 32 bRainChance? db 32h ; DATA XREF: sub_409305+90r
_____________________________________________________________________________________________
PITSTOP

0042BB04 BA E8 03 00 00 mov edx, 1000
F4 01 500

00552008 E0 2E 00 00 Fuel_Flow dd 2EE0h 12000
FF 7F 00 00 32767

0042BB1E 3D 20 4E 00 00 cmp eax, 20000 ; max fuel stop
10 27 10000
0042BB25 B8 20 4E 00 00 mov eax, 20000
10 27 10000

0042BB56 05 BE 0A 00 00 add eax, 2750 ; minimum time in pits?
5F 05 1375

0042BB61 3D 00 19 00 00 cmp eax, 6400 ; minimum fuel stop?
80 0C 3200

0042BBE5 05 50 46 00 00 add eax, 18000 ; max repair time
00 28 10240

-----------------------------------------------------------------------------------------------------

Yes, I'm getting all the physics values from the bhp physics editor,
and nowhere else, and I'm patching them for gp3(2k) too. I'm not sure about the torque.
These are the values I'm patching (subtract 0x400000 for exe offsets):

addrRacePower = 0;//0x417323; //#define POWER_DEFAULT 810
addrQualPower = 0;//0x417331;
addrPower = 0;//0x4347d8; //default 0x4000
addrPatchCarPower = 0x4347d7;
POWER_DEFAULT = 810;

addrUpShift = 0x55246c; //#define UPSHIFT_DEFAULT 2560
addrMechGrip = 0x552488; //#define OLDMECHGRIP_DEFAULT -524288
addrDownforce = 0x552490; //#define OLDDOWNFORCE_DEFAULT 44369


addrCOP = 0x56fbf8; COP_DEFAULT = 0.450;

addrDDRatio3 = 0x56fc40; //#define DDRATIO3_DEFAULT 3.05
addrDDRatio2 = 0x56fc48; //#define DDRATIO2_DEFAULT 2.725
addrDDRatio = 0x56fc50; //#define DDRATIO_DEFAULT 2.4

addrNewDownforce3 = 0x56fc68; //#define NEWDOWNFORCE3_DEFAULT 1543.22
addrNewDownforce = 0x56fc70; //#define NEWDOWNFORCE_DEFAULT 1984.14
addrNewDownforce2 = 0x56fc78; //#define NEWDOWNFORCE2_DEFAULT 2425.06

addrMaxRPM3 = 0x56fc90; //#define MAXRPM3_DEFAULT 17000.0
addrMaxRPM2 = 0x56fc98; //#define MAXRPM2_DEFAULT 16800.0
addrMaxRPM = 0x56fca0; //#define MAXRPM_DEFAULT 16600.0

addrFlywheel = 0x56fcb8; //#define FLYWHEEL_DEFAULT 0.05
addrFinalDrive = 0x56fcc0; //#define FINALDRIVE_DEFAULT 5.848739496
addrRearWeight = 0x56fcc8; //#define REARWEIGHT_DEFAULT 13.5
addrFrontWeight = 0x56fcd0; //#define FRONTWEIGHT_DEFAULT 12.0
addrRearRadius = 0x56fcd8; //#define REARRADIUS_DEFAULT 330.2
addrFrontRadius = 0x56fce0; //#define FRONTRADIUS_DEFAULT 323.85
addrBrake = 0x56fce8; //#define BRAKE_DEFAULT 5798.0

addrCOGHeight = 0x56fd10; //#define COGHEIGHT_DEFAULT 255
addrCOGNegDistToFront = 0x56fd20; // default -1538.0
addrWheelBase = 0x56fd28; //#define WHEELBASE_DEFAULT 3037
addrCOG1 = 0x56fd30; //#define COG1_DEFAULT 1422
addrCOG2 = 0x56fd38; //#define COG2_DEFAULT 1470

addrMass1 = 0x56fd50;
addrMass2 = 0x56fd60; //#define MASS_DEFAULT 605
addrInertiaX = 0x56fd68; //#define XINERTIA_DEFAULT 580
addrInertiaY = 0x56fd70; //#define YINERTIA_DEFAULT 640
addrInertiaZ = 0x56fd78; //#define ZINERTIA_DEFAULT 85

addrRearLateralGrip = 0x5703a8; //#define REARLATERALGRIP_DEFAULT 1983.6191

addrRearSlipAngle = 0x5703b8; //#define REARSLIPANGLE_DEFAULT -4
addrRearLongGrip = 0x570438; //#define REARLONGGRIP_DEFAULT -1824.6849
addrFrontLateralGrip = 0x5705d0;//#define FRONTLATERALGRIP_DEFAULT 1990
addrFrontSlipAngle = 0x5705e0; //#define FRONTSLIPANGLE_DEFAULT -4.22
addrFrontLongGrip = 0x570660; //#define FRONTLONGGRIP_DEFAULT -1862.9691
Re: Hex editor
Date: April 18, 2015 11:29PM
Posted by: SDI
Most offsets seem to be for GP3-2000. Some GP4 offsets in there too, including the default grip you mention. If you use a hex editor instead of a disassembler, subtract the executable base address from the offset. The base address is 0x400000.

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Hex editor
Date: April 20, 2015 08:15PM
Posted by: TheFueleffect
Thanks!

I tried to find the right offsets, by subtracting hexadecimal 400000 from the original offsets. These are the values in my exe:

013D78 (unchanged) 60 00 (Grip as AI?)

552EE4 --> 152EE4: 00 00 (Slipstream_384)
552EE6 --> 152EE6: FF DD (Slipstream_256)
552EEA --> 152EEA: 86 00 (Slipstream_512)

552F78 --> 152F78: 0F 8D 06 FF (Blocking amount)

42BCA6 --> 02BCA6: 66 F7 DA (Min. pitstop time)
42BB56 --> 02BB56: 00 7C 36 (Min. random stop)
42BB61 --> 02BB61: 00 7C 2B (Max. random stop)

As far as I understand the data structure, these figures are not even close to the values they are supposed to be. What am I doing wrong?
Re: Hex editor
Date: April 20, 2015 08:33PM
Posted by: SDI
The offsets you mention are all GP3-2000 offsets.

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Hex editor
Date: April 20, 2015 09:37PM
Posted by: TheFueleffect
Ok, even after subtracting hexadecimal 400000?
Is there a straightforward way to find the right offsets in GP4? Or is it just a matter of trial and error?
Re: Hex editor
Date: April 20, 2015 11:13PM
Posted by: SDI
Subtracting 400000 is only for going from process memory offset to executable file offset.

You cannot convert a GP3-2000 offset into a GP4 offset in a straightforward way. If the pattern is unique you can try to find the same pattern in the GP4 executable, but there's no guarantee it's still there. Simple patterns like 74 0D are not unique.

If you have only these few offsets to convert, I can help you with it.

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Hex editor
Date: April 20, 2015 11:38PM
Posted by: TheFueleffect
Wow, that sounds difficult. Thanks for helping!
Yes, these few offsets seem most promising to me.
Re: Hex editor
Date: April 21, 2015 11:28PM
Posted by: SDI
Ok, here they are:

GP32K -> GP4
----------------------
413D78 -> 417C04

552EE4 -> 603AF6
552EE6 -> 603AF8
552EEA -> 603AFC
552F78 -> 603B94

42BCA7 -> 432534
42BB57 -> 4323E4
42BB62 -> 4323EF

Note that for the last 3 I added 1 because that's where the actual offset is.

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Hex editor
Date: April 22, 2015 08:17PM
Posted by: TheFueleffect
You're great SDI!
But is it normal that these offsets only store zeros in my exe? They seem to be in a sea of zeros.
Re: Hex editor
Date: April 22, 2015 09:47PM
Posted by: SDI
Did you subtract 400000 first?

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Hex editor
Date: April 22, 2015 10:51PM
Posted by: TheFueleffect
No, I forgot... :(
One question: how can I save the changes in my GP4 exe? The game doesn't recognize the edited exe on my computer.
Re: Hex editor
Date: April 23, 2015 07:54PM
Posted by: SDI
I can't tell as I don't know how you are editing and what hex editor you're using.

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Hex editor
Date: April 24, 2015 10:38PM
Posted by: TheFueleffect
I probably corrupted the exe. The game runs fine and the races are more realistic than ever before. Thanks!
Re: Hex editor
Date: September 06, 2019 05:19AM
Posted by: Soutsen
Have anyone tried working on these? I'm interested in seeing how the AI blocking behavour can be changed with the AI Cars sometimes defending way too agressively:

[youtu.be]

Note how far Jordan car went from the CC-line to defend his position:


___________________________________________________________________________
For a list of EVERY download for GP4, look here:[docs.google.com]



Edited 1 time(s). Last edit at 09/11/2019 06:40AM by Soutsen.
Re: Hex editor
Date: June 29, 2020 09:20PM
Posted by: Philip00
Hi All,

Can somebody help me to find these riws in GP4?

2010 FULL FUEL PIT STOP

00406864 75 0C FULL FUEL JUMP 90 90 CARS START WITH FULL FUEL
0040686D 83 C0 02 ADDS 2 LAPS PITSTOP FUEL NOT PATCHED
0040687D 83 C0 02 ADDS 2 LAPS RACE FUEL NOT PATCHED

0042BB56 05 BE 0A 00 00 MIN FUEL STOP 2570 - PATCHED 2304 00 09
0042BBE5 05 50 46 00 00 MAX REPAIR TIME 18000 - PATCHED 12000 E0 2E
0042BCA6 05 58 1B 00 00 MIN PIT STOP TIME 7000 - PATCHED 1000 E8 03

00552008 E0 2E 00 00 FUEL FLOW 12000 - PATCHED 1066576 50 46 10 00
152008

00406BE1 66 8B 56 60 NOPE 2010 FULL FUEL Car.wFuelLaps
90 90 90 90
00406BE5 66 89 46 60 NOPE 2010 FULL FUEL
90 90 90 90

With disassembler i can find these things in gp3-2000 but in gp4 ex i can't find these rows.

EDIT: Also even I found with PE Explorer disassembler Gp3-2000 I can't modify there the hex values. with Hxd editor i can't ind hte offset :( Can somebody please help me?

Thank you in advance,

Philip



Edited 1 time(s). Last edit at 06/29/2020 09:48PM by Philip00.
Re: Hex editor
Date: July 03, 2020 05:25PM
Posted by: SDI
Sure, here are the offsets in memory:

GP3-2000 -> GP4 1.02
--------------------------
406864 -> 408863
40686D -> 40886C
40687D -> 40887C
42BB56 -> 4323E3
42BBE5 -> 432472
42BCA6 -> 432533
552008 -> 62EE04
406BE1 -> 408BE0
406BE5 -> 408BE4

Subtract 400000 for the exe offset:

GP3-2000 exe -> GP4 1.02 exe
--------------------------006864 -> 008863
00686D -> 00886C
00687D -> 00887C
02BB56 -> 0323E3
02BBE5 -> 032472
02BCA6 -> 032533
152008 -> 22EE04
006BE1 -> 008BE0
006BE5 -> 008BE4

René Smit, Independent Software Developer.
Download my GPx tools here.
Sorry, only registered users may post in this forum.

Click here to login

Maintainer: mortal, stephan | Design: stephan, Lo2k | Moderatoren: mortal, TomMK, Noog, stephan | Downloads: Lo2k | Supported by: Atlassian Experts Berlin | Forum Rules | Policy