-
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
feat(natives): implement GET_MOUNTED_FILE_HASH
#2792
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea to have as a native, given the performance implications.
4ee263d
to
c942ca3
Compare
Do you have any ideas for a better implementation? |
Not off the top of my head, no
Perhaps. LOAD_RESOURCE_FILE exists so I guess loading files inside of natives isn't unheard of. |
More weird anticheat "detection" attempts? :/ |
Some people are editing their client files to get advantages in PvP servers, I guess it's to block this |
What about a method to find out what files are loaded from the mods or citizen folder? |
it would be nice if there is a method to identify modified files from mods/citizen/game files or blocking certain files to be modified. For example i want my players to use NVE graphics mod, but not to use custom audio files like louder footsteps or headshot sounds for advantage in pvp. Maybe a new pure mode level 3 that will block all modified client files except known graphics mods can be a solution for that. |
99% of cheaters these days are people using modified files. A simple native like this could prevent this and remove 99% of cheaters from FiveM and bring more positivity. As for performance issue, this will be checked during the loading process so this is not really an issue. Maybe adding a note in the native description could be a good idea then. |
I have thought about something similar some time ago. In my opinion, there should be an additional pure mode which would allow server owners to specify the hashes of allowed files in the server configuration. Native function for that is not the most convenient solution. |
your solution is the same thing but requires a game restart for every join, not really convenient. |
Furthermore, unlike a traditional cheat, players don't risk being banned from the platform
It's the perfect example of why Pure Mode is not widely used and why we need something like this instead. Each game server has different requirements regarding the files that should be blocked |
Seconding exactly what @william-des and @manzarek123 said.
While I think this native would be useful too, I think a better approach would be to detect modification on certain file-names (or better yet, "modification-classes") then allow server owners to either transparently allow/black these classes or do it via a self-coded script that will kick a user for disallowed files. Even better yet would be if denied "classes" can be disabled by the server-owner and the vanilla data is used respectively. |
Yeah, initially it was my idea. Including the fact that all the content files are read-only, can we make async hashing possible in another thread and waiting for result? |
I think sounds would make be tricky having just categories, for example I can see custom sirens being acceptable, but weapon sounds not so much (can make silenced weapons/footsteps easier to hear). Perhaps servers don't even need a hash, simply having a list of files overriden by rpfs in the mod folder, and relying on puremode to make sure the game files aren't touched, would still be better than the status quo. |
please add this already, no one can stand pure mode xD |
? I can't see why you would dislike pure mode, unless you are trying to let players load whatever random files they want into your server. |
Maybe because pure mode is full restricted and doesn't allow as a server owner to accept some files you may want players to have. Especially for PvP servers. |
Fair enough I guess, didn't really think of such case |
} | ||
else | ||
{ | ||
// Mark non-whitelisted paths as complete with "missing" hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't g_isFetching stay forever true when this condition is reached. Same if (it != g_fileHashes.end())?
@PichotM What do you think about defining hashes list on server side in cfg file? So we can guarantee that check will be done on connect time and won't affect performance in play time. |
We then need a way to generate the hash without this native so that we can put it in the cfg. |
|
||
if (handle != -1) | ||
{ | ||
auto len = device->GetFileLength(handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use chunked reading and hash calculation here
will be back soon |
Goal of this PR
This PR introduces a new native
GET_MOUNTED_FILE_HASH
.How is this PR achieving the goal
By implementing the native using the same logic as puremode's hashes.
This PR applies to the following area(s)
FiveM & RedM client
Successfully tested on
FiveM and will most likely work in RedM too.
Game builds: 3095
Platforms: Windows
Checklist