Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gta-core-five): validate bounds collisions #3182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DaniGP17
Copy link
Contributor

Goal of this PR

Fix a game crash when two collisions collide with each other without having a valid m_Bounds. This is happening for specific objects, mostly testing objects that are not used in the map but are spawned by malicious players to make people nearby crash. By default when spawning the prop there is no problem, but if the player or something external hits a sub-object that makes it move and collide with another sub-object of the same object it will reproduce this crash.

How is this PR achieving the goal

Hooking the ProcessSelfCollision function and validating that the boundComposite and boundComposite->m_Bounds are valid

This PR applies to the following area(s)

FiveM

Successfully tested on

Game builds: 1, 1604, 2060, 2189, 2372, 2545, 3095, 3258, 3407

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixes #3173

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Feb 21, 2025
@ook3D
Copy link
Contributor

ook3D commented Feb 25, 2025

for where you defined the phBound structs, would it be possible to use the already defined ones inside rage-formats-x component to prevent duplicating code? https://github.com/citizenfx/fivem/tree/master/code/components/rage-formats-x/include

@DaniGP17
Copy link
Contributor Author

for where you defined the phBound structs, would it be possible to use the already defined ones inside rage-formats-x component to prevent duplicating code? https://github.com/citizenfx/fivem/tree/master/code/components/rage-formats-x/include

I didn't realize that, I'll do it thanks

@DaniGP17
Copy link
Contributor Author

Can the phBound structure from the rage-formats-x project be easily referenced from gta-core-five?

@Gogsi
Copy link

Gogsi commented Feb 27, 2025

Can the phBound structure from the rage-formats-x project be easily referenced from gta-core-five?

You can add "rage:formats:x" as a dependency in component.json and rerun fxd gen -game five and fxd vs -game five.
That should be enough to reference the project, hopefully it doesn't cause other issues.

@DaniGP17
Copy link
Contributor Author

I've tried using phBoundComposite from the rage-formats-x project but the m_childBounds member is private, should I change it to public or leave the structure as I have it?

@ook3D
Copy link
Contributor

ook3D commented Feb 27, 2025

I've tried using phBoundComposite from the rage-formats-x project but the m_childBounds member is private, should I change it to public or leave the structure as I have it?

Probably best to leave it how you have it originally then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build 12933 and 12947, crashing GTA5_b3258.exe!sub_1414C81F4
3 participants