Pclxav木马猎手第一代特征码引擎源代码_漏洞研究教程-查字典教程网
Pclxav木马猎手第一代特征码引擎源代码
Pclxav木马猎手第一代特征码引擎源代码
发布时间:2016-12-26 来源:查字典编辑
摘要:发布原因,主要是因为国内某安全软件长期存在的引擎问题.希望本文可以让其做实质性更新.安全软件,要给用户,使用者以安全,而不是麻烦.具体引擎问...

发布原因,主要是因为国内某安全软件长期存在的引擎问题.希望本文可以让其做实质性更新.

安全软件,要给用户,使用者以安全,而不是麻烦

.具体引擎问题表现,是扫描文件,创建一拷贝,再扫描这个拷贝的文件.

即使象AVP这种杀壳专家,见到壳也不会通通脱掉.也有很大的可能直接在壳中提取病毒

定义.

源代码如下,有部分删节,因本文并不是让所有的人都来写扫描器,且此引擎亦不再使用

.

constcBuf_Size=65536;

varfintbuffer:pbytearray;

procedureCheckInternalBuffer(aPos:Integer);

var

pFR:Integer;

begin

if(fIntBufferPos=-1)or(aPos<fIntBufferPos)or((aPos+16)>

(fIntBufferPos+cBuf_size))

thenbegin

pFR:=aPos-(cBuf_sizediv2);

ifpFR<0

then

pFR:=0;

fIntFile.Position:=pFR;

fIntFile.Read(fIntBuffer^,cBuf_Size);

fIntBufferPos:=pFR;

end;

end;

procedureFreeFile;

begin

iffIntFile<>nil

thenbegin

fIntFile.Free;

fIntFile:=nil;

end;

end;

functionCanOpenFile(constaName:string):Boolean;

var

fHandle:THandle;

begin

Result:=False;

//ReadOnly:=True;

ifFileExists(aName)

thenbegin

fhandle:=CreateFileA(pchar(aname),GENERIC_READ,FILE_SHARE_READ,

NIL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);

iffhandle<>INVALID_HANDLE_VALUE

thenbegin

closehandle(fHandle);

Result:=True;

end;

end;

end;

functionLoadFromFile(constFilename:string):Boolean;

begin

Result:=True;

fIntFile:=newreadfilestream(filename);

try

fIntFile.Position:=0;

fdatasize2:=fintfile.Size;

fintbufferpos:=-1;

Result:=True;

finally

end

end;

functionFind(aBuffer:PChar;constaCount,aStart,aEnd:Integer

):Integer;

//findsomethinginthecurrentfileandreturnthe

position,-1ifnotfoundconstIgnoreCase,SearchText:Boolean

var

//pCR:TCursor;

pChAct:Char;

pCMem,pCFind,pCHit,pEnd:Integer;

begin

Result:=-1;

pEnd:=aEnd;

ifaCount<1

then

Exit;

ifaStart+aCount>(pEnd+1)

then

Exit;//willneverbefound,ifsearch-partissmallerthan

searcheddata

try

pCMem:=aStart;

PCFind:=0;

pCHit:=pCMem+1;

repeat

ifpCMem>pEnd

then

Exit;

CheckInternalBuffer(pCMem);

PChAct:=Char(fIntBuffer[pCMem-fIntBufferPos]);

if(PChAct=aBuffer[PCFind])

thenbegin

ifPCFind=(aCount-1)

thenbegin

Result:=PCMem-aCount+1;

Exit;

end

elsebegin

ifPCFind=0

then

PCHit:=PCMem+1;

Inc(PCMem);

Inc(PCFind);

end;

end

elsebegin

PCMem:=PCHit;

PCFind:=0;

PCHit:=PCMem+1;

end;

untilFalse;

finally

//Cursor:=pCR;

end;

end;

functionTForm1.check2(filename:string):boolean;

const

cHexChars=’0123456789ABCDEF’;

varh,n,x,

findlen,FindPos,mypos:longint;

up,findstr:string;

pSTR:String;

pCT,pCT1:integer;

begin

result:=false;

findstr,mypos给值:

mypos:=mypoint;

pSTR:=’’;

pCT1:=Length(findstr)div2;

forpCT:=0to(Length(findstr)div2)-1

pStr:=pStr+Char((Pos(findstr[pCt*2+1],cHexChars)-1)*16+

(Pos(findstr[pCt*2+2],cHexChars)-1));

GetMem(FindBuf,pCT1);

try

FindLen:=pCT1;

Move(pStr[1],FindBuf^,pCt1);

FindPos:=Find(findstr,FindBuf,FindLen,mypos,mypos+findlen-1)

ifFindPos=-1

thenexit

else

begin

//dosomething!

result:=true;

exit;

end;

finally

end;

end;

支持多段定义的代码省略,无非也就是找到后再继续咯.

支持?忽略部分字节的代码省略,无非改改函数.

代码很乱,确实,本人一向不大喜欢排整齐,不然怎么出BUG(搞笑)

此代码是从十六进制编辑器代码中分离的,由于原控件是为使用者编辑文件而作,所以默

认是将文件拷到WINDOWS临时文件夹,再修改那个

拷贝的文件,避免用户误操作.

所以使用任何控件,还是得仔细检查源代码意图,必要时修改之,不然对使用者是不利的

.

关于国产杀软,江民不知错就改,剔除可查2000种病毒的某安全软件病毒码,就不能认为

有度量

瑞星,如能提升国际病毒猎杀力,多多关注国外动向,还是有希望的.

金山,不要免费赠送用户不需要的东西,未来会更好.

国外杀软猎杀病毒能力:KAV>MCAFEE>NOD32

未知病毒猎杀力则相反

最后一点小小要求,望国人少使用国外多引擎检测,使得国产杀软的底气再足点吧.

关于本文作者,jike,the2avpro(pclxav)创建者,该软件正运行着第二代特征码引擎,第

三代浮动特征码引擎能不能出来尚是未知数.

联系:jike_man@hotmail.comhttp://crackchina.nease.net/

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新漏洞研究学习
    热门漏洞研究学习
    实用技巧子分类