Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Fix steering angle, throttle power, and brake power offsets not found… #153

Merged
merged 1 commit into from
Dec 23, 2023

Conversation

kagikn
Copy link
Contributor

@kagikn kagikn commented Dec 23, 2023

Related to #148

It's been a while in this repo. Looks like some people are giving you a hard time too badly, so I disassembled the new GTA5.exe to find what to fix and I managed to find one. It would be great if we could find a more stable place to extract the offset, but this change works at least.

The register to read got changed from rbx to rdi in the memory pattern 74 0A F3 0F 11 B3 ? ? ? ? EB 25.
In b2944:

// 74 0A F3 0F 11 B3 ? ? ? ? EB 25
jz      short loc_7FF781A3D48E
movss   dword ptr [rbx+98Ch], xmm6
jmp     short loc_7FF781A3D4B3

In b3095:

// 74 0A F3 0F 11 B7 ? ? ? ? EB 25
jz      short loc_7FF7EFBE70AD
movss   dword ptr [rdi+9D4h], xmm6
jmp     short loc_7FF7EFBE70D2

Even with the register value to read ignored, we can find only one occurrence, even in b372 and b1604.

I know we have to make other memory patterns to patch how vehicle gears work, but still this PR would be a good start to support b3095.

… in b3095

The register to read got changed from `rbx` to `rdi`.
It would be great if we could find a more stable place to extract the
offset, but this change works.
@kagikn kagikn mentioned this pull request Dec 23, 2023
@kagikn
Copy link
Contributor Author

kagikn commented Dec 23, 2023

CI build failed, it doesn't seem to be due to the change this PR contains.

@ikt32
Copy link
Owner

ikt32 commented Dec 23, 2023

Neat, saw your message on the 5mods Discord already.

@ikt32 ikt32 merged commit edf609a into ikt32:master Dec 23, 2023
1 check failed
@fingaweg
Copy link
Contributor

Related to #148

It's been a while in this repo. Looks like some people are giving you a hard time too badly, so I disassembled the new GTA5.exe to find what to fix and I managed to find one. It would be great if we could find a more stable place to extract the offset, but this change works at least.

The register to read got changed from rbx to rdi in the memory pattern 74 0A F3 0F 11 B3 ? ? ? ? EB 25. In b2944:

// 74 0A F3 0F 11 B3 ? ? ? ? EB 25
jz      short loc_7FF781A3D48E
movss   dword ptr [rbx+98Ch], xmm6
jmp     short loc_7FF781A3D4B3

In b3095:

// 74 0A F3 0F 11 B7 ? ? ? ? EB 25
jz      short loc_7FF7EFBE70AD
movss   dword ptr [rdi+9D4h], xmm6
jmp     short loc_7FF7EFBE70D2

Even with the register value to read ignored, we can find only one occurrence, even in b372 and b1604.

I know we have to make other memory patterns to patch how vehicle gears work, but still this PR would be a good start to support b3095.

nice quick fix! so the pattern mask is still unique to one function, right? I cant check right now however, i prepared some stuff when patches should get fixed. so we could already update the game version stuff.
image

@kagikn
Copy link
Contributor Author

kagikn commented Dec 23, 2023

yes, the new pattern mask is still unique to one function, tested in b372, b1604, b2944, and b3095.

@kagikn kagikn deleted the b3095-fix-vehicle-data branch December 23, 2023 15:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants