private unsafe static void TestDXCore() { using (IDXCoreAdapterFactory adapterFactory = DXCoreCreateAdapterFactory <IDXCoreAdapterFactory>()) { using (IDXCoreAdapterList adapterList = adapterFactory.CreateAdapterList <IDXCoreAdapterList>(new[] { D3D12_CoreCompute })) { adapterList.Sort(new[] { AdapterPreference.Hardware, AdapterPreference.HighPerformance }).CheckError(); for (int i = 0; i < adapterList.AdapterCount; i++) { using (IDXCoreAdapter candidateAdapter = adapterList.GetAdapter <IDXCoreAdapter>(i)) { AdapterMemoryBudgetNodeSegmentGroup nodeSegmentGroup = new AdapterMemoryBudgetNodeSegmentGroup { NodeIndex = 0, SegmentGroup = SegmentGroup.Local }; candidateAdapter.QueryState(AdapterState.AdapterMemoryBudget, nodeSegmentGroup, out AdapterMemoryBudget memoryBudget ).CheckError(); string driverDescription = candidateAdapter.DriverDescription; bool isHardware = candidateAdapter.IsHardware; HardwareID hardwareID = candidateAdapter.HardwareID; if (candidateAdapter.GetProperty(AdapterProperty.HardwareIDParts, out HardwareIDParts hardwareIDParts).Success) { } } } } } }
private void regB_Click(object sender, EventArgs e) { if (userBox.Text.Length < 3 || passBox.Text.Length < 8) { MessageBox.Show("Minimun length for username is 3 and password is 8.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } NameValueCollection register = new NameValueCollection(); register["HTTP_X_FORWARDED_FOR"] = "24.133.120.66"; register["username"] = userBox.Text; register["password"] = passBox.Text.Hash(); register["hwid"] = HardwareID.Value(); byte[] rawresponse = Program.client.UploadValues("http://193.111.77.77/api/api/login/register.php", register); string response = Encoding.Default.GetString(rawresponse); MessageBox.Show(response); switch (response) { case "success": MessageBox.Show("Registered Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); break; case "overuse": MessageBox.Show("The username is taken or your HWID already exists in the database.", "Multiple accounts are not allowed.", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case "fail": MessageBox.Show("There is an error with our database. Please contact the developers!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case "vpn": MessageBox.Show("VPN/Any type of proxy are not allowed!", "VPN/Proxy are Prohibited", MessageBoxButtons.OK, MessageBoxIcon.Error); break; default: MessageBox.Show("There is an error with our database. Please contact the developers!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } }
private void RegisterDeviceService(ISystemRegistryHive systemRegistryHive, PNPDriverINFFile pnpDriverInf, BaseDeviceService deviceService) { // We ignore start type. if the user uses this program, she wants to boot something! const int startType = 0; // Note: using a different service registry key under CurrentControlSet\Services with an ImagePath entry referring to the .sys will not work in text mode setup! // Text-mode setup will always initialize services based on the values stored under Services\serviceName, where serviceName is the service file name without the .sys extension. // write all to registry: var serviceName = deviceService.ServiceName; if (deviceService.ServiceDisplayName != string.Empty) { systemRegistryHive.SetServiceRegistryKey( serviceName, string.Empty, "DisplayName", RegistryValueKind.String, deviceService.ServiceDisplayName); } systemRegistryHive.SetServiceRegistryKey(serviceName, string.Empty, "ErrorControl", RegistryValueKind.DWord, deviceService.ErrorControl); if (deviceService.ServiceGroup != string.Empty) { systemRegistryHive.SetServiceRegistryKey( serviceName, string.Empty, "Group", RegistryValueKind.String, deviceService.ServiceGroup); } systemRegistryHive.SetServiceRegistryKey(serviceName, string.Empty, "Start", RegistryValueKind.DWord, startType); systemRegistryHive.SetServiceRegistryKey(serviceName, string.Empty, "Type", RegistryValueKind.DWord, deviceService.ServiceType); if (systemRegistryHive is HiveSystemINFFile) // GUI Mode registry { systemRegistryHive.SetServiceRegistryKey( serviceName, string.Empty, "ImagePath", RegistryValueKind.String, deviceService.ImagePath); } // Note that software key will stick from text-mode: var softwareKeyName = @"Control\Class\" + pnpDriverInf.ClassGUID + @"\" + _classInstanceID; var service = deviceService as NetworkDeviceService; if (service != null) { var netCfgInstanceID = service.NetCfgInstanceID; // - sanbootconf and iScsiBP use this value, but it's not necessary for successful boot, static IP can be used instead. // - the presence of this value will stick and stay for the GUI mode // - the presence of this value during GUI Mode will prevent the IP settings from being resetted // - the presence of this value will cause Windows 2000 \ XP x86 to hang after the NIC driver installation (there is no problem with Windows Server 2003) // - the presence of this value will cause Windows XP x64 to hang during the "Installing Network" phase (there is no problem with Windows Server 2003) // we will set this value so sanbootconf / iScsiBP could use it, and if necessary, delete it before the NIC driver installation (using hal.inf) systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "NetCfgInstanceId", RegistryValueKind.String, netCfgInstanceID); if (!_installation.IsWindowsServer2003) { // delete the NetCfgInstanceId registry value during the beginning of GUI-mode setup _installation.HalInf.DeleteNetCfgInstanceIdFromNetworkAdapterClassInstance(_classInstanceID); } // The Linkage subkey is critical, and is used to bind the network adapter to TCP/IP: // - The NetCfgInstanceId here is the one Windows actually uses for TCP/IP configuration. // - The first component in one entry corresponds to the first component in the other entries: systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "Linkage", "Export", RegistryValueKind.MultiString, new[] { @"\Device\" + netCfgInstanceID }); systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "Linkage", "RootDevice", RegistryValueKind.MultiString, new[] { netCfgInstanceID }); // Windows can still provide TCP/IP without this entry systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "Linkage", "UpperBind", RegistryValueKind.MultiString, new[] { "Tcpip" }); } // We need to make sure the software key is created, otherwise two devices can end up using the same software key // Note for network adapters: // "MatchingDeviceId" is not critical for successfull boot or devices which are not network adapters, but it's critical for NICBootConf in case it's being used // Note: Windows will store the hardwareID as it appears in the driver, including &REV systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "MatchingDeviceId", RegistryValueKind.String, HardwareID.ToLower()); // not necessary. in addition, it will also be performed by GUI-mode setup if (deviceService.DeviceDescription != string.Empty) { systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "DriverDesc", RegistryValueKind.String, deviceService.DeviceDescription); } if (pnpDriverInf.DriverVersion != string.Empty) { systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "DriverVersion", RegistryValueKind.String, pnpDriverInf.DriverVersion); } if (pnpDriverInf.Provider != string.Empty) { systemRegistryHive.SetCurrentControlSetRegistryKey(softwareKeyName, "ProviderName", RegistryValueKind.String, pnpDriverInf.Provider); } }
public static string GetHardwareID() { return(HardwareID.GetHardwareID(true, false, true, true, false, false)); }
private void loginB_Click(object sender, EventArgs e) { NameValueCollection register = new NameValueCollection(); string hwid = HardwareID.Value(); register["username"] = userBox.Text; register["password"] = passBox.Text.Hash(); register["hwid"] = hwid; byte[] rawresponse = Program.client.UploadValues("http://193.111.77.77/api/api/login/login.php", register); string response = Encoding.Default.GetString(rawresponse); MessageBox.Show(response); string[] split = response.Split('|'); Console.WriteLine(response); if (response.Contains("success")) { Variables.PCoinAddress = split[1]; Variables.Username = userBox.Text; Variables.Password = passBox.Text; Variables.Hwid = hwid; using (RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default).CreateSubKey("Pollery")) { if (key != null) { key.SetValue("Username", userBox.Text); key.SetValue("Password", passBox.Text); if (key.GetValueNames().Contains("Teams")) { string[] val = (string[])key.GetValue("Teams"); Variables.Teams.AddRange(val); } } } rgb.Stop(); Hide(); var mainForm = new MainForm(); mainForm.Closed += (s, args) => Close(); mainForm.Show(); } else { switch (split[0]) { case "ban": MessageBox.Show("Sorry but you're banned/blacklisted.", "Your account has been banned.", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case "fail": MessageBox.Show("There is an error with our database. Please contact the developers!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case "stolen": MessageBox.Show("This is not your account or you are using a different device.", "Unknown device", MessageBoxButtons.OK, MessageBoxIcon.Error); break; default: MessageBox.Show("There is an error with our database. Please contact the developers!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } } }