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(positional-audio): Add plugin for Among Us #4571
FEAT(positional-audio): Add plugin for Among Us #4571
Conversation
plugins/amongus/amongus.cpp
Outdated
stream << "Hat ID: " << std::to_string(playerFields.hatId) << std::endl; | ||
stream << "Pet ID: " << std::to_string(playerFields.petId) << std::endl; | ||
stream << "Dead: " << (playerFields.isDead ? "true" : "false") << std::endl; | ||
stream << "Impostor: " << (playerFields.isImpostor ? "true" : "false") << std::endl; |
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'm considering removing this, as it would allow anyone who can read the identity to cheat.
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.
Well I think the positional data alone is enough info for being able to cheat. Not sure if we have to be this cautious here
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.
Technically the positional data could indeed indicate whether a player is an impostor, for example due to the coordinates "jumping" when moving through a duct (only impostors can do that).
However, I'm pretty sure it can be mistaken for lag.
plugins/amongus/Game.cpp
Outdated
} | ||
|
||
const std::vector< uint8_t > clientPattern = { 0x74, 0x39, 0xA1, '?', '?', '?', '?', 0x8B, 0x40, 0x5C }; | ||
m_client = m_proc.peekPtr(m_proc.peekPtr(m_proc.findPattern(clientPattern, iter->second) + 3)); |
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.
Why + 3
? The comment about "magic numbers" applies here as well
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 can see why it's confusing, I will write the assembly code in a comment.
plugins/amongus/amongus.cpp
Outdated
stream << "Hat ID: " << std::to_string(playerFields.hatId) << std::endl; | ||
stream << "Pet ID: " << std::to_string(playerFields.petId) << std::endl; | ||
stream << "Dead: " << (playerFields.isDead ? "true" : "false") << std::endl; | ||
stream << "Impostor: " << (playerFields.isImpostor ? "true" : "false") << std::endl; |
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.
Well I think the positional data alone is enough info for being able to cheat. Not sure if we have to be this cautious here
397dfcc
to
762d392
Compare
plugins/Process.cpp
Outdated
@@ -9,6 +9,8 @@ | |||
|
|||
#include <chrono> | |||
|
|||
constexpr uint16_t findPatternBufferSize = 32768; |
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.
This still doesn't explain, why it has to be this specific vlaue...
And if this variable is only ever used inside findPattern
, then I would make this a local variable to that function.
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.
It doesn't have to be a specific value.
In fact, I could make the variable a parameter to the function.
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.
Well if it doesn't have to be a specific value, how did you arrive at this particular number? It looks oddly specific to me xD
I don't think that making this a function parameter is a good idea. This seems like an implementation detail that the caller shouldn't have to worry about
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 chose a number that appears a good balance for the buffer size.
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 guess if it was plain 33000
instead folks like me wouldn't start wondering how that number came to existence ^^
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 wrote a comment explaining that it's 32 KiB.
I also made this: https://github.com/StarGate01/AmongUs-Mumble , a mod for the game itself - uses the Mumble Link plugin. It has the benefit of being faster than memory scanning (uses hooking) and can be updated independently to follow the games rapid release cycle. |
Awesome, thank you very much for your work! Consider that memory is never scanned once the plugin is successfully initialized, because memory addresses are cached. The main advantage with your method is that game functions can be called directly, allowing to easily expand the plugin's feature set. Among (Us) the disadvantages:
Regardless of that, it's still a really cool idea. The README is well made too. About the RPC calls: with the new plugin framework (#3743) it will be possible to do that in the plugin itself. However, I believe it would be better to handle that server-side through the "identity" sent by the client (see https://github.com/mumble-voip/mumo). |
Agree on all points. Linux support is planned, the Proton/Wine adapter is currently in development. Cheat detection is a valid concern, if this ever becomes relevant we hope to make a deal with the developers. The new JSON RPC API will be included once Mumble 1.4 releases with pluggin support, see #4575. |
762d392
to
0155a24
Compare
searchInBuffer() searches for the specified pattern in the specified buffer. "?" is used as wildcard. findPattern(), given a start address and the size of the area, reads memory in chunks of 32 KiB. It stops when a match is found, the end is reached or an error is encountered (peek() fails). There's also an overload which iterates through the specified module's readable regions.
Tested with v2020.10.22s and v2020.09.22s. Unless the pattern we're searching for becomes invalid or the structures we're using change, the plugin should keep working.
0155a24
to
2feebe6
Compare
No description provided.