Jump to content
Nytro

[VB6] Detect VMWare

Recommended Posts

Posted
'-----------------------------------------
'Detect VMWare
'Tested : VNWare 6.0 -> 7.0
'Coder : DungCoi (VirusVN.com)
'Email : dungcoivb@gmail.com
'-----------------------------------------
Private Type DISPLAY_DEVICE
cb As Long
DeviceName As String * 32
DeviceString As String * 128
StateFlags As Long
DeviceID As String * 128
DeviceKey As String * 128
End Type
Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Private Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type
Private Declare Function EnumDisplayDevices Lib "user32" Alias "EnumDisplayDevicesA" (Unused As Any, ByVal iDevNum As Long, lpDisplayDevice As DISPLAY_DEVICE, ByVal dwFlags As Long) As Boolean
Sub Main()
Dim strVGA As String
strVGA = getVGACard
If InStr(1, LCase(strVGA), "vmware") > 0 Then
MsgBox "Dze dze. VMWare", , "VirusVN.com"
Else
MsgBox "I'm not running on VMWare :P", , "VirusVN.com"
End If


End
End Sub
Public Function getVGACard() As String
Dim DD As DISPLAY_DEVICE
DD.cb = Len(DD)
If EnumDisplayDevices(ByVal 0&, 0, DD, ByVal 0&) Then
getVGACard = Left$(DD.DeviceString, InStr(1, DD.DeviceString, Chr$(0)) - 1)
Else
getVGACard = ""
End If
End Function

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...