From 4bbe001b15dec9cacd882ee55fe54f85c56a147f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 15 Dec 2024 15:50:25 +0300 Subject: Steam: service calls switched to static handlers --- protocols/Steam/src/steam_utils.cpp | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'protocols/Steam/src/steam_utils.cpp') diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index 800abe47e8..ebc3c2b6f8 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -9,6 +9,45 @@ int64_t getRandomInt() ///////////////////////////////////////////////////////////////////////////////////////// +MBinBuffer createMachineID(const char *accName) +{ + uint8_t hashOut[MIR_SHA1_HASH_SIZE]; + char hashHex[MIR_SHA1_HASH_SIZE * 2 + 1]; + + CMStringA _bb3 = CMStringA("SteamUser Hash BB3 ") + accName; + CMStringA _ff2 = CMStringA("SteamUser Hash FF2 ") + accName; + CMStringA _3b3 = CMStringA("SteamUser Hash 3B3 ") + accName; + + MBinBuffer ret; + uint8_t c = 0; + ret.append(&c, 1); + ret.append("MessageObject", 14); + + c = 1; + ret.append(&c, 1); + ret.append("BB3", 4); + mir_sha1_hash((uint8_t *)_bb3.c_str(), _bb3.GetLength(), hashOut); + bin2hex(hashOut, sizeof(hashOut), hashHex); + ret.append(hashHex, 41); + + ret.append(&c, 1); + ret.append("FF2", 4); + mir_sha1_hash((uint8_t *)_ff2.c_str(), _ff2.GetLength(), hashOut); + bin2hex(hashOut, sizeof(hashOut), hashHex); + ret.append(hashHex, 41); + + ret.append(&c, 1); + ret.append("3B3", 4); + mir_sha1_hash((uint8_t *)_3b3.c_str(), _3b3.GetLength(), hashOut); + bin2hex(hashOut, sizeof(hashOut), hashHex); + ret.append(hashHex, 41); + + ret.append("\x08\x08", 2); + return ret; +} + +///////////////////////////////////////////////////////////////////////////////////////// + int64_t CSteamProto::GetId(MCONTACT hContact, const char *pszSetting) { return _atoi64(getMStringA(hContact, pszSetting)); -- cgit v1.2.3