Conversation
| #pragma comment(lib, "Advapi32.lib") | ||
| #pragma comment(lib, "wbemuuid.lib") | ||
| #pragma comment(lib, "ole32.lib") | ||
| #pragma comment(lib, "oleaut32.lib") |
There was a problem hiding this comment.
It would be preferable to move library linkage from #pragma directives into CMake (nextclient/engine_mini/CMakeLists.txt), in target_link_libraries
| #include "hwid_collector.h" | ||
|
|
||
| #define WIN32_LEAN_AND_MEAN | ||
| #define NOMINMAX |
There was a problem hiding this comment.
WIN32_LEAN_AND_MEAN and NOMINMAX are not required, as they are already defined in CMakeLists.txt
| std::string Sanitize(const std::string& s) | ||
| { | ||
| const char* kInvalid[] = { | ||
| "To be filled by O.E.M.", "Default string", "None", "00000000-0000-0000-0000-000000000000", "0000_0000_0000_", "" |
There was a problem hiding this comment.
It may be safer to remove "" from kInvalid. The logic appears somewhat fragile: if the space were missing in find_first_not_of, all valid values would be treated as invalid
| std::string t = s.substr(start, end - start + 1); | ||
|
|
||
| for (const char* inv : kInvalid) | ||
| if (t.find(inv) != std::string::npos || t == inv) |
There was a problem hiding this comment.
The condition || t == inv appears redundant, since the substring is already checked immediately before
| VariantInit(&vSerial); | ||
|
|
||
| bool ok = false; | ||
| if (SUCCEEDED(pObj->Get(L"Index", 0, &vIdx, nullptr, nullptr)) && vIdx.vt == VT_I4 || vIdx.vt == VT_UI4) |
There was a problem hiding this comment.
It looks like parentheses are missing here:
if (SUCCEEDED(pObj->Get(L"Index", 0, &vIdx, nullptr, nullptr)) && (vIdx.vt == VT_I4 || vIdx.vt == VT_UI4))
| } | ||
|
|
||
| ULONGLONG tick = GetTickCount64(); | ||
| DWORD pid = GetCurrentProcessId(); |
There was a problem hiding this comment.
It would be preferable to use random generation here, just in case. While a collision between GetTickCount64 and GetCurrentProcessId is unlikely, it is still possible
| return false; | ||
|
|
||
| const std::string& hwidStr = hwid::Collect(); | ||
| if (hwidStr.size() != 64) |
There was a problem hiding this comment.
This should most likely use NCLM_HWID_SIZE instead of 64
| std::string combined = seed1 + "|" + seed2; | ||
| std::string hwid = Sha256Hex(combined); | ||
|
|
||
| if (hwid.size() == 64) |
There was a problem hiding this comment.
This should most likely use NCLM_HWID_SIZE instead of 64
| @@ -0,0 +1,6 @@ | |||
| #pragma once | |||
|
|
|||
There was a problem hiding this comment.
Add #include "hlsdk.h", the project does not compile due to the missing declaration of sizebuf_t
lozatto
left a comment
There was a problem hiding this comment.
Looks good to me.
Everything is clear and well organized, and the changes make sense.
perfect
|
I've made the suggested updates; please see if they look good to you @Polarhigh |
Technical Proposal: Persistent Hardware Identification System (HWID) v2
Overview
The goal is to implement a robust Hardware ID (HWID) system for Counter-Strike 1.6 by extending the NextClient (Client-side) and NextClientServerApi (Server-side). This ensures a player’s identity is tied to their physical machine, effectively preventing identity spoofing, bypassing bans via IP/SteamID rotation, and improving community integrity.
1. Client-Side Collection (NextClient)
Objective: Generate a unique, anonymized, and highly resilient hardware fingerprint.
IOCTL_STORAGE_QUERY_PROPERTYcalls to bypass WMI corruption.HKCU\Software\NextClientif all hardware probes fail.2. Synchronization (NCLM Protocol)
Objective: Securely transmit the HWID during the initial connection handshake.
src/common/nclm_proto.h:NCLM_C2S_HARDWARE_ID: Sent immediately after the version check and before entering the game.3. Session Management (Server Module)
Objective: Bind the HWID to the active player session for lookups.
NCLM_C2S_HARDWARE_IDopcode withinnclm_server.cpp.CPlayerobject insideplayer_manager.cpp.4. AMX Mod X Interface (API Layer)
Objective: Expose the HWID to Pawn scripts (e.g., Zombie Plague, Anti-Cheat, or Rank systems).
ncl_get_hardware_idto the NextClient API.Expected Repository Structure
Client Repository (
nextclient)Server Repository (
NextClientServerApi)Reference: Resolves architectural requirements for advanced ban management and identity validation. Fixes Issue #100.