fix(http/props): mask launch_signature to prevent client mod detection (#676)

Co-authored-by: Ayyan <ayn2op@gmail.com>
This commit is contained in:
xqrs 2025-12-30 01:51:44 +03:00 • committed by GitHub
parent 458ea764ae
commit 9bd0b8f597
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,7 +36,7 @@ func IdentifyProperties() gateway.IdentifyProperties {
"client_launch_id": uuid.NewString(),
"client_heartbeat_session_id": uuid.NewString(),
"launch_signature": uuid.NewString(),
"launch_signature": generateLaunchSignature(),
"system_locale": Locale,
"release_channel": "stable",
"has_client_mods": false,
@ -64,3 +64,23 @@ func getSuperProps() (string, error) {
return base64.StdEncoding.EncodeToString(raw), nil
}
func generateLaunchSignature() string {
// Discord uses specific UUID bits to detect client modifications.
// This mask clears detection bits to avoid identification.
// Reference: https://docs.discord.food/reference#launch-signature
//
// Required version and variant bits for UUIDv4 validity are set by google/uuid.
// Reference: https://github.com/google/uuid/blob/master/version4.go#L54
mask := [16]byte{
0b11111111, 0b01111111, 0b11101111, 0b11101111,
0b11110111, 0b11101111, 0b11110111, 0b11111111,
0b11011111, 0b01111110, 0b11111111, 0b10111111,
0b11111110, 0b11111111, 0b11110111, 0b11111111,
}
id := uuid.New()
for i := range mask {
id[i] &= mask[i]
}
return id.String()
}