CString getOSName()
{
CString osName = _T("");
int a=0,b=0,i=0,j=0;
_asm
{
pushad
mov ebx,fs:[0x18] ; get self pointer from TEB
mov eax,fs:[0x30] ; get pointer to PEB / database
mov ebx,[eax+0A8h] ; get OSMinorVersion
mov eax,[eax+0A4h] ; get OSMajorVersion
mov j,ebx
mov i,eax
popad
}
if((i==5)&&(j==0))
{
osName = _T("当前系统版本为:Windows 2000");
}
else if((i==5)&&(j==1))
{
osName = _T("当前系统版本为:Windows XP");
}
else if((i==5)&&(j==2))
{
osName = _T("当前系统版本为:Windows 2003");
}
else if((i==6)&&(j==0))
{
osName = _T("当前系统版本为:Windows Vista");
}
else if((i==6)&&(j==1))
{
osName = _T("当前系统版本为:Windows 7");
CString getOSName()
{
CString osName = _T("");
int a=0,b=0,i=0,j=0;
_asm
{
pushad
mov ebx,fs:[0x18] ; get self pointer from TEB
mov eax,fs:[0x30] ; get pointer to PEB / database
mov ebx,[eax+0A8h] ; get OSMinorVersion
mov eax,[eax+0A4h] ; get OSMajorVersion
mov j,ebx
mov i,eax
popad
}
if((i==5)&&(j==0))
{
osName = _T("当前系统版本为:Windows 2000");
}
else if((i==5)&&(j==1))
{
osName = _T("当前系统版本为:Windows XP");
}
else if((i==5)&&(j==2))
{
osName = _T("当前系统版本为:Windows 2003");
}
else if((i==6)&&(j==0))
{
osName = _T("当前系统版本为:Windows Vista");
}
else if((i==6)&&(j==1))
{
osName = _T("当前系统版本为:Windows 7");