Pclxav木馬獵手第一代特徵碼引擎原始碼

來源:互聯網
上載者:User

發布原因,主要是因為國內某安全軟體長期存在的引擎問題.希望本文可以讓其做實質性更新.

安全軟體,要給使用者,使用者以安全,而不是麻煩

.具體引擎問題表現,是掃描檔案,建立一拷貝,再掃描這個拷貝的檔案.

即使象AVP這種殺殼專家,見到殼也不會通通脫掉.也有很大的可能直接在殼中提取病毒

定義.

原始碼如下,有部分刪節,因本文並不是讓所有的人都來寫掃描器,且此引擎亦不再使用

.

const cBuf_Size = 65536;

var fintbuffer:pbytearray;

procedure CheckInternalBuffer ( aPos : Integer );

var

pFR : Integer;

begin

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

(fIntBufferPos+cBuf_size))

then begin

pFR := aPos - (cBuf_size div 2);

if pFR < 0

then

pFR := 0;

fIntFile.Position := pFR;

fIntFile.Read ( fIntBuffer^, cBuf_Size);

fIntBufferPos := pFR;

end;

end;

procedure FreeFile;

begin

if fIntFile <> nil

then begin

fIntFile.Free;

fIntFile := nil;

end;

end;

function CanOpenFile ( const aName : string ) :Boolean;

var

fHandle : THandle ;

begin

Result := False;

//ReadOnly := True;

if FileExists ( aName )

then begin

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

NIL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

if fhandle <> INVALID_HANDLE_VALUE

then begin

closehandle ( fHandle );

Result := True;

end;

end;

end;

function LoadFromFile(const Filename: string): Boolean;

begin

Result := True;

fIntFile := newreadfilestream ( filename );

try

fIntFile.Position := 0;

fdatasize2:=fintfile.Size;

fintbufferpos:=-1;

Result := True;

finally

end

end;

function Find ( aBuffer : PChar ; const aCount , aStart , aEnd : Integer

) : Integer;

// find something in the current file and return the

position, -1 if not found const IgnoreCase , SearchText : Boolean

var

// pCR : TCursor;

pChAct : Char;

pCMem , pCFind , pCHit , pEnd : Integer;

begin

Result := -1;

pEnd := aEnd;

if aCount < 1

then

Exit;

if aStart + aCount > (pEnd+1)

then

Exit; // will never be found, if search-part is smaller than

searched data

try

pCMem := aStart;

PCFind := 0;

pCHit := pCMem+1;

repeat

if pCMem > pEnd

then

Exit;

CheckInternalBuffer ( pCMem );

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

if ( PChAct = aBuffer[PCFind] )

then begin

if PCFind = (aCount-1)

then begin

Result := PCMem-aCount+1;

Exit;

end

else begin

if PCFind = 0

then

PCHit := PCMem+1;

Inc ( PCMem );

Inc ( PCFind );

end;

end

else begin

PCMem := PCHit;

PCFind := 0;

PCHit := PCMem+1;

end;

until False;

finally

// Cursor := pCR;

end;

end;

function TForm1.check2(filename:string):boolean;

const

cHexChars = 0123456789ABCDEF;

var h,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 ) div 2;

for pCT := 0 to (Length ( findstr ) div 2) -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)

if FindPos = -1

then exit

else

begin

// do something!

result:=true;

exit;

end;

finally

end;

end;

支援多段定義的代碼省略,無非也就是找到後再繼續咯.

支援?忽略部分位元組的代碼省略,無非改改函數.

代碼很亂,確實,本人一向不大喜歡排 整齊,不然怎麼出BUG(搞笑)

此代碼是從十六進位編輯器代碼中分離的,由於原控制項是為使用者編輯檔案而作,所以默

認是將檔案拷到WINDOWS臨時檔案夾,再修改那個

拷貝的檔案,避免使用者誤操作.

所以使用任何控制項,還是得仔細檢查原始碼意圖,必要時修改之 ,不然對使用者是不利的

.

關於國產殺軟,江民不知錯就改,剔除可查2000種病毒 的某安全軟體病毒碼,就不能認為

有度量

瑞星,如能提升國際病毒獵 殺力,多多關注國外動向,還是有希望 的.

金山,不要免費贈送使用者不需要的東西,未來會更好.

國外殺軟獵 殺病毒 能力:KAV>MCAFEE>NOD32

未知病毒獵殺力則相反

最後一點小小要求,望國人少使用國外多引擎檢測,使得國產殺軟的底氣再足點吧.

關於本文作者,jike,the2avpro(pclxav)建立者,該軟體正運行著第二代特徵碼引擎,第

三代浮動特徵碼引擎能不能出來尚是未知數.

聯絡:jike_man@hotmail.com http://crackchina.nease.net/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.