-
-
[转帖]检测虚拟机代码(MASM)
-
发表于: 2007-8-4 09:13 8030
-
检测虚拟机的代码
.386
.model flat, stdcall
option casemap:none
; VMware hessam salehi (kernex)
; HKEY_LOCAL_MACHINE\software\VMWare, Inc.\VMware tools
; include .inc
include \MASM32\include\windows.inc
include \MASM32\include\user32.inc
include \MASM32\include\kernel32.inc
include \MASM32\include\advapi32.inc
; include .lib
includelib \MASM32\lib\user32.lib
includelib \MASM32\lib\kernel32.lib
includelib \MASM32\lib\advapi32.lib
.data
MsgCaption db “VMware Detector 1.0″,0
Msgare db “you are in a vmware !!”,0
Msgnot db “you are not in a vmware !!”,0
szTestKey db “software\VMWare, Inc.\VMware tools”,0
hKey db “InstallPath”,0
.code
start:
INVOKE RegOpenKeyEx, HKEY_LOCAL_MACHINE, addr szTestKey, 0,\
KEY_WRITE or KEY_READ, addr hKey
.if eax == ERROR_SUCCESS
invoke MessageBox, NULL,addr Msgare, addr MsgCaption, MB_OK
.else
invoke MessageBox, NULL,addr Msgnot, addr MsgCaption, MB_OK
.endif
invoke ExitProcess,NULL
end start
start:
PUSH EBP
MOV EBP,ESP
try_again:
…..
rdtsc
mov ebx,eax
rdtsc
sub eax,ebx
push eax
cmp eax,1 ; infrequent some CPUs return the value 1,
jz try_again ; which seems to be a bug! in this case we try again.
Invoke printf, ADDR print_result,eax
pop eax
cmp eax,0200h
jb no_vm
Invoke printf, ADDR print_vm ; you ARE in a VM
jmp finish
no_vm:
Invoke printf, ADDR print_novm ; You are NOT in a VM
finish:
MOV ESP,EBP
POP EBP
RETN
[招生]系统0day安全班,企业级设备固件漏洞挖掘,Linux平台漏洞挖掘!
赞赏记录
参与人
雪币
留言
时间
Youlor
为你点赞~
2023-12-7 00:00
伟叔叔
为你点赞~
2023-9-7 00:05
PLEBFE
为你点赞~
2023-6-16 03:15
QinBeast
为你点赞~
2023-6-12 00:46
shinratensei
为你点赞~
2023-5-21 00:03
心游尘世外
为你点赞~
2023-5-14 00:46
飘零丶
为你点赞~
2023-5-6 00:45
赞赏
他的文章
- 虚拟键盘、虚拟鼠标驱动 196445
- [转帖]Antonis Kyprianou写的MiniDBG 7023
- [求助]写DLL脱壳机中获取某一模块上下文内容的问题 7119
- [分享]微狗驱动模拟程序(MASM源码) 27475
- [己解决]关于在VMWARE虚拟机中使用摄像头 28673
看原图
赞赏
雪币:
留言: