From 9bd0b8f59734958003f9d85c9681a1264b5de30b Mon Sep 17 00:00:00 2001 From: xqrs <3bd3bdr@gmail.com> Date: Tue, 30 Dec 2025 01:51:44 +0300 Subject: [PATCH] fix(http/props): mask launch_signature to prevent client mod detection (#676) Co-authored-by: Ayyan --- internal/http/props.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/internal/http/props.go b/internal/http/props.go index 9559dca..5d2a919 100644 --- a/internal/http/props.go +++ b/internal/http/props.go @@ -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() +}