alert7写的检测linux是否运行在VMWARE中的一个程序
2004-10-17 12:34
441 查看
/*
* gcc -Wall -o checkVM checkVM.c
* check linux OS in VMare ?
* by alert7
*
*/
#include
#include
struct idtr {
unsigned short limit;
unsigned int base;
} __attribute__ ((packed));
unsigned int get_addr_idt() {
struct idtr idtr;
asm("sidt %0" : "=m" (idtr));
return idtr.base;
}
int main(int argc, char ** argv)
{
unsigned int ptr_idt;
ptr_idt=get_addr_idt();
printf("IDT Addr %p /n",ptr_idt);
if ( (ptr_idt>>24)==0xc0)
printf("Real Linux/n");
else printf("Maybe in VMare/n");
return 0;
}
* gcc -Wall -o checkVM checkVM.c
* check linux OS in VMare ?
* by alert7
*
*/
#include
#include
struct idtr {
unsigned short limit;
unsigned int base;
} __attribute__ ((packed));
unsigned int get_addr_idt() {
struct idtr idtr;
asm("sidt %0" : "=m" (idtr));
return idtr.base;
}
int main(int argc, char ** argv)
{
unsigned int ptr_idt;
ptr_idt=get_addr_idt();
printf("IDT Addr %p /n",ptr_idt);
if ( (ptr_idt>>24)==0xc0)
printf("Real Linux/n");
else printf("Maybe in VMare/n");
return 0;
}
相关文章推荐
- C#检测是否已经运行了一个当前的程序【搜藏】
- 用Linux守护进程检测某个程序是否运行2
- [代码]Delphi实现检测程序是否在VMWare中运行
- 用Linux守护进程检测某个程序是否运行
- linux下如何检测程序是否运行并重启
- linux c/c++ 检测程序是否在运行
- 检测你的程序是否运行在虚拟机(VMware)
- 用Linux守护进程检测某个程序是否运行
- [代码]Delphi实现检测程序是否在VMWare中运行
- 一个将java程序运行在linux系统后台的脚本
- 怎么判断一个程序是否在运行
- bat win7 检测程序是否已管理员身份运行
- linux查看指定程序是否运行及关闭
- 在Linux下用C语言写一个小程序实现一个进度条编写Makefile来进行运行
- c#检查程序是否已经运行,如何防止多次运行同一个程序?
- 判断程序是否在VMWare内运行
- 在运行该程序时如何检测与sql server是否能够连接
- Linux中用守护进程检测程序运行
- 通过脚本判断一个程序是否在运行
- Linux 判断进程是否已经运行的程序