Post: Help with HWID protection
08-30-2011, 08:17 AM #1
fill0botto95
You talkin to me?
(adsbygoogle = window.adsbygoogle || []).push({}); well, i was trying to make my own hwid protection for some my tools but i got an error on vb studio 2010..

i followed this You must login or register to view this content.

i was stopped on the second step by an error

you see this code...

    Dim HWID As String = String.Empty
Dim mc As New ManagementClass("win32_processor")
Dim moc As ManagementObjectCollection = mc.GetInstances()

For Each mo As ManagementObject In [COLOR="#FF0000"]moc[/COLOR]
If HWID = "" Then
HWID = mo.Properties("processorID").Value.ToString()
Exit For
End If
Next
Dim wc As New WebClient
Dim strings As String
strings = wc.DownloadString("YourHWID.text file url here")
wc.Dispose()

If strings.Contains(HWID) Then
MessageBox.Show("Your HWID Is Confirmed", "Login", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Show()
Else
MessageBox.Show("Error, Your HWID Has Not Been Confirmed", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.Close()
End If


The error was about "moc" var...it said that moc was not an array
if you make it works, i swear little vbux Awesome face
(adsbygoogle = window.adsbygoogle || []).push({});
08-31-2011, 01:29 AM #2
Epic?
Awe-Inspiring
Originally posted by fill0botto95 View Post
well, i was trying to make my own hwid protection for some my tools but i got an error on vb studio 2010..

i followed this You must login or register to view this content.

i was stopped on the second step by an error

you see this code...

    Dim HWID As String = String.Empty
Dim mc As New ManagementClass("win32_processor")
Dim moc As ManagementObjectCollection = mc.GetInstances()

For Each mo As ManagementObject In [COLOR="#FF0000"]moc[/COLOR]
If HWID = "" Then
HWID = mo.Properties("processorID").Value.ToString()
Exit For
End If
Next
Dim wc As New WebClient
Dim strings As String
strings = wc.DownloadString("YourHWID.text file url here")
wc.Dispose()

If strings.Contains(HWID) Then
MessageBox.Show("Your HWID Is Confirmed", "Login", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Show()
Else
MessageBox.Show("Error, Your HWID Has Not Been Confirmed", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.Close()
End If


The error was about "moc" var...it said that moc was not an array
if you make it works, i swear little vbux Awesome face


Sorry if I get this completely wrong, as I don't really do much in the form of VB. But perhaps its because ManagementObjectCollection isn't an array? Its a collection, you can use CopyTo(Array, Int32) to copy the collection to an array. Although it seems to me that it should work anyways...

The other thing is, you don't need moc, you can just do it like so, referencing GetInstances() right from the get go...
    Dim c As New ManagementClass("Win32_Process")
Dim o As ManagementObject
For Each o In c.GetInstances()
Console.WriteLine( _
"Next instance of Win32_Process : {0}", o("Name"))
Next o
08-31-2011, 07:11 AM #3
fill0botto95
You talkin to me?
Originally posted by AsianInvasion View Post
Sorry if I get this completely wrong, as I don't really do much in the form of VB. But perhaps its because ManagementObjectCollection isn't an array? Its a collection, you can use CopyTo(Array, Int32) to copy the collection to an array. Although it seems to me that it should work anyways...

The other thing is, you don't need moc, you can just do it like so, referencing GetInstances() right from the get go...
    Dim c As New ManagementClass("Win32_Process")
Dim o As ManagementObject
For Each o In c.GetInstances()
Console.WriteLine( _
"Next instance of Win32_Process : {0}", o("Name"))
Next o


i'll try this, thank you for the help
anyway i solved adding system.management reference before coding the program
09-01-2011, 02:42 AM #4
Epic?
Awe-Inspiring
Originally posted by fill0botto95 View Post
i'll try this, thank you for the help
anyway i solved adding system.management reference before coding the program


That would make sense, often times its small stuff like that, so it really helps if you can provide the full error.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo