-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(game/five): verify pickup weapon component is valid on creation #2797
Merged
prikolium-cfx
merged 1 commit into
citizenfx:master
from
slashkeyvalue:fix/pickup-creation-invalid-weap-comp
Oct 3, 2024
Merged
fix(game/five): verify pickup weapon component is valid on creation #2797
prikolium-cfx
merged 1 commit into
citizenfx:master
from
slashkeyvalue:fix/pickup-creation-invalid-weap-comp
Oct 3, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
invalid
Requires changes before it's considered valid and can be (re)triaged
label
Sep 17, 2024
iridium-cfx
reviewed
Sep 17, 2024
code/components/gta-core-five/src/CrashFixes.InvalidPickupCreation.cpp
Outdated
Show resolved
Hide resolved
fix(game/five): pickup weapon component creation validation is only needed after 1604 fix(game/five): jmp back to original code instead of returning, improve code flow
slashkeyvalue
force-pushed
the
fix/pickup-creation-invalid-weap-comp
branch
from
September 17, 2024 13:20
8b10a5e
to
15417bd
Compare
github-actions
bot
added
triage
Needs a preliminary assessment to determine the urgency and required action
invalid
Requires changes before it's considered valid and can be (re)triaged
and removed
invalid
Requires changes before it's considered valid and can be (re)triaged
triage
Needs a preliminary assessment to determine the urgency and required action
labels
Sep 17, 2024
prikolium-cfx
approved these changes
Sep 19, 2024
prikolium-cfx
added
ready-to-merge
This PR is enqueued for merging
and removed
invalid
Requires changes before it's considered valid and can be (re)triaged
labels
Sep 19, 2024
Is there something else pending or ...? Would be nice to be less abused by cheats :P |
Is the cheater taking down every player that some fix date goes into production? @prikolium-cfx |
The cheater is taking down all players, do you have a fix date for it to go into production? @prikolium-cfx |
In case testing code is desired; static uintptr_t g_writerVtbl;
static void (*origCPickupCreationDataNode__Serialise)(void* self, void* serialiser);
static void CPickupCreationDataNode__Serialise(void* self, void* serialiser)
{
bool isWriter = *(uintptr_t*)serialiser == g_writerVtbl;
if (isWriter)
{
*(uint32_t*)((uintptr_t)self + 0x128) = 0xFFFFFFFF;
*(uint32_t*)((uintptr_t)self + 0x158) = 0x0000000C;
}
origCPickupCreationDataNode__Serialise(self, serialiser);
}
static HookFunction hookFunction([]
{
g_writerVtbl = hook::get_address<uintptr_t>(hook::get_pattern("4C 8B 10 48 8B C8 41 FF 52 ? 48 8B 4B 08", 0x11));
origCPickupCreationDataNode__Serialise = hook::trampoline(hook::get_pattern("40 55 53 56 57 41 54 41 56 41 57 48 8B EC 48 83 EC ? 48 8B 02 4C 8D B1"), &CPickupCreationDataNode__Serialise);
}); |
Open
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal of this PR
Prevent crash caused by invalid pickup weapon components on pickup creation.
How is this PR achieving the goal
Adds proper validations on pickup creation
This PR applies to the following area(s)
FiveM
Successfully tested on
Game builds: 2060, 3095
Platforms: Windows
Checklist
Fixes issues
Fixes
GTA5_b3095.exe!sub_141163854 (0x456)