403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.168
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/games/scorched3d/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/games/scorched3d/files/patch-src_client_client_SecureID.cpp
--- src/client/client/SecureID.cpp.orig	2016-06-20 14:16:37 UTC
+++ src/client/client/SecureID.cpp
@@ -71,6 +71,47 @@ std::string SecureID::GetPrivateKey(void
 	return result;
 }
 
+#elif defined(__FreeBSD__)
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if_dl.h>
+#include <ifaddrs.h>
+
+std::string SecureID::GetPrivateKey(void)
+{
+       std::string Key;
+       struct ifaddrs* ifaphead;
+
+       if (getifaddrs(&ifaphead) != 0)
+       {
+               return "";
+       }
+
+       for (struct ifaddrs* ifap = ifaphead; ifap; ifap = ifap->ifa_next)
+       {
+               if (ifap->ifa_addr->sa_family == AF_LINK)
+               {
+                       if (strncmp(ifap->ifa_name, "lo", 2) != 0)
+                       {
+                               struct sockaddr_dl* sdl =
+                                       (struct sockaddr_dl *)ifap->ifa_addr;
+                               unsigned char* if_mac = (unsigned char*)LLADDR(sdl);
+                               char buf[18];
+                               snprintf(buf, 18,
+                                       "%02x:%02x:%02x:%02x:%02x:%02x",
+                                       if_mac[0], if_mac[1], if_mac[2],
+                                       if_mac[3], if_mac[4], if_mac[5]);
+                               Key = buf;
+                               break;
+                       }
+               }
+       }
+
+       freeifaddrs(ifaphead);
+       return Key;
+}
+
 #else
 
 #include <sys/ioctl.h>

Youez - 2016 - github.com/yon3zu
LinuXploit