From c02d8bf0ef00bfd2cd01446daf29b846331cf32a Mon Sep 17 00:00:00 2001 From: 12problems Date: Tue, 20 Jan 2026 18:44:30 -0500 Subject: [PATCH] Added mac hwid logging (finally) --- lib/crypto.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/crypto.lua b/lib/crypto.lua index 91e80914..6f04257f 100644 --- a/lib/crypto.lua +++ b/lib/crypto.lua @@ -49,7 +49,14 @@ function MP.UTILS.server_connection_ID() local serial_ptr = ffi.new("DWORD[1]") local ok = ffi.C.GetVolumeInformationA("C:\\", nil, 0, serial_ptr, nil, nil, nil, 0) if ok ~= 0 then raw_id = tostring(serial_ptr[0]) end - end + elseif os_name == "OS X" then + local cmd = [[ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }']] + local handle = io.popen(cmd) + local result = handle:read("*a") + if handle then handle:close() end + print(result) + raw_id = tostring(result) + end if not raw_id then raw_id = os.getenv("USER") or os.getenv("USERNAME") or os_name end