You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.7 KiB
C++

#include "StdAfx.h"
#include "EncryptionMgr.h"
#include "LogMgr.h"
#include "MsgBox.h"
#include "winioctl.h"
#include "WarningMgr.h"
#pragma comment( lib, "KernelMode.lib")
CKernelMode gKernelMode;
#define LEFT_DAYS_ALAM 10 //ʣ<><EFBFBD><E0BCB8><EFBFBD><EFBFBD>ʾ
CEncryptionMgr *gEncryptionMgr = new CEncryptionMgr;
CEncryptionMgr::CEncryptionMgr(void)
{
m_LeftDays = 0;//ʣ<><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_bRunAtNoteBook = false;//<2F>Ƿ<EFBFBD><C7B7>ڱʼDZ<CABC><C7B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
CEncryptionMgr::~CEncryptionMgr(void)
{
}
void CEncryptionMgr::OnAppInitialize()
{
m_CurHardDiskSerialNum = GetHardDiskSerialNum();
set<CString> NoteBookHardDiskSerialSet;
NoteBookHardDiskSerialSet.insert("2cc413dd");//k2450 <20>ʼDZ<CABC>
NoteBookHardDiskSerialSet.insert("4a410fe7");//t420 <20>ʼDZ<CABC>
NoteBookHardDiskSerialSet.insert("ebfac14d");//T460S <20>ʼDZ<CABC>
NoteBookHardDiskSerialSet.insert("d8affd1b");//ʵ<><CAB5>ƽ̨
NoteBookHardDiskSerialSet.insert("6c83a0a8");//С<><D0A1>notebook
//NoteBookHardDiskSerialSet.insert("600451aa");//ʵ<><CAB5>ƽ̨
//<2F>ʼDZ<CABC>
if(NoteBookHardDiskSerialSet.count(m_CurHardDiskSerialNum))
{
m_bRunAtNoteBook = true;
}
}
//<2F><>ȡӲ<C8A1><D3B2><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>(C<><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2>)
CString CEncryptionMgr::GetHardDiskSerialNum()
{
CString id;
char Name[MAX_PATH];
DWORD serno;
DWORD length;
DWORD FileFlag;
char FileName[MAX_PATH];
BOOL Ret;
Ret = GetVolumeInformation("c:\\", Name, MAX_PATH, &serno, &length, &FileFlag, FileName, MAX_PATH);
if (Ret)
id.Format( "%x", serno);
return id;
}
#if 1
/*
code:530001 <EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>з<EFBFBD><EFBFBD>ּ<EFBFBD><EFBFBD>ܹ<EFBFBD>
code:530002 <EFBFBD><EFBFBD>ȡBinary<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
code:530003 Binary<EFBFBD>ļ<EFBFBD>ID<EFBFBD>ͼ<EFBFBD><EFBFBD>ܹ<EFBFBD>ID<EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD>
code:530004 <EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><EFBFBD><EFBFBD>
code:530005 <EFBFBD>·ݹ<EFBFBD><EFBFBD><EFBFBD>
code:530006 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
code:530007 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>кŲ<EFBFBD>ƥ<EFBFBD><EFBFBD>
*/
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>false)
bool CEncryptionMgr::CheckLockState()
{
return true;
#ifndef __USE_SUPER_DOG__
return true;
#endif
//<2F>ʼDZ<CABC>
if(m_bRunAtNoteBook)
{
return true;
}
int code = gKernelMode.CheckState();
//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD>仹ʣn <20><>
if(code>100 && code<=(100+LEFT_DAYS_ALAM))
{
m_LeftDays = code-100;
}
else if(code==0 || code>(100+LEFT_DAYS_ALAM))
{
m_LeftDays = 0;//ʣ<><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
else if(code>0 && code!=7)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>)
{
m_LeftDays = 0;//ʣ<><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CString AddInfo;
AddInfo.Format(_T("ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>쳣(code :53000%d)"),code);
gWarningMgr->SendWarningMsg(_Warning_Code_14,AddInfo);
return false;
}
//<2F><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(10 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>)
CheckLeftDays();
return true;
}
//<2F><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(10 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>)
void CEncryptionMgr::CheckLeftDays()
{
}
#endif