Login Register






Detect Virtual Machines filter_list
Author
Message
Detect Virtual Machines #1
It's a long Way to detect if running on a Virtual Machine , not special , just for pass time

Hope enjoy


Code:
;========================================= ; Detect Virtual PC >> Vmware |VirtualBox ; Autor : M3 ;========================================= Func _DetectVirtualPC() Local $sWMI, $sFind ,$sActive , $VM , $VBox $VM = "VMwaretray.exe" $VBox = "VboxSvc.exe" $sWMI = ObjGet("winmgmts:") $sFind = $sWMI.InstancesOf("win32_process") For $sActive In $sFind Select Case $VM If $sActive.Caption = $VM Then Msgbox(0,"","Yeah I`m running on Vmware") Exit EndIf Case $VBox If $sActive.Caption = $VBox Then Msgbox(0,"","Yeah I`m Running on VirtualBox") Exit EndIf EndSelect Next Endfunc

Reply

RE: Detect Virtual Machines #2
which language is this??

oops..i didn't saw the section, my bad..
[Image: fow57.jpg]

Reply

RE: Detect Virtual Machines #3
Lol i'ts posted on AutoIt session xD

Reply

RE: Detect Virtual Machines #4
Nice code. But safer way is checking if first letter starts with V Tongue
Pierce the life fibers with your drill.

Reply

RE: Detect Virtual Machines #5
here is a more secure way to do it:

Quote:$SysInfo_Read = _RunStdOutRead("SystemInfo")

Func _RunStdOutRead($sRunCmd)
Local $iPID = Run(@ComSpec & ' /c ' & $sRunCmd, @ScriptDir, @SW_HIDE, 4 + 2)
Local $sStdOutRead = ""

While ProcessExists($iPID)
$sStdOutRead &= StdoutRead($iPID)
WEnd

$location = StringInStr($sStdOutRead, "innotek", 0, 1) ; Find the 1st occurance of "innotek" - innotek is a word from virtualbox
if $location = 0 then
;do nothing
Else
MsgBox(4096, "Error", "Virtual machine is detected")
EndIf

Return $sStdOutRead
EndFunc
[Image: AQiSh.jpg]

Reply