Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 팁&트릭
Delphi Programming Tip&Tricks
[241] 가상머신에서 동작중인지 확인하기
civilian [civilian] 4731 읽음    2008-04-23 09:58
function IsRunningVirtualPC: boolean;
asm  
	push ebp;  
	mov ebp, esp;  
	mov ecx, offset @exception_handler;  
	push ebx;  
	push ecx;  
	push dword ptr fs:[0];  
	mov dword ptr fs:[0], esp;  
	mov ebx, 0; // Flag  
	mov eax, 1; // VPC function number  
	// call VPC  
	db $0F, $3F, $07, $0B  
	mov eax, dword ptr ss:[esp];  
	mov dword ptr fs:[0], eax;  
	add esp, 8;  
	test ebx, ebx;  
	setz al;  
	lea esp, dword ptr ss:[ebp-4];  
	mov ebx, dword ptr ss:[esp];  
	mov ebp, dword ptr ss:[esp+4];  
	add esp, 8;  
	jmp @ret1;
@exception_handler:  
	mov ecx, [esp+0Ch];  
	mov dword ptr [ecx+0A4h], -1; // EBX = -1 ->; not running, ebx = 0 -> running  
	add dword ptr [ecx+0B8h], 4;  // ->; skip past the call to VPC  
	xor eax, eax;                 // exception is handled
@ret1:
end;

출처 : http://ruminatedrumblings.blogspot.com/2008/04/detecting-virtual-pc.html

+ -

관련 글 리스트
241 가상머신에서 동작중인지 확인하기 civilian 4731 2008/04/23
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.