Page 4 of 4

Posted: Mon Jul 31, 2006 12:30 pm
by Inf0Byt3
Thx :D... I think i've kind of forgotten that one... However, here's it is the source:

Code: Select all

;[--------------------------------------------------------
;//PFileTypes.pb
;//File version 0.1 - 27 May 2006
;//(c)2006 Trutia Alexandru - FrostLabs Software
;[--------------------------------------------------------
;//Description: PureAV File Recognition Engine
;[--------------------------------------------------------

#PureAV_FileType_ERR       = 0
#PureAV_FileType_UNKNOWN   = 1
#PureAV_FileType_EXE       = 2
#PureAV_FileType_RAR       = 3
#PureAV_FileType_ZIP       = 4

ProcedureDLL PureAVRecognizeFile(FilePath.s)

 If ReadFile(0,FilePath)
  For ReadHeader = 1 To 6
   Header.s = Header.s + Chr(ReadCharacter(0))
  Next ReadHeader 
  
  If Left(Header,2) = "MZ"
   ProcedureReturn #PureAV_FileType_EXE
  ElseIf Left(Header,4) = "Rar!"
   ProcedureReturn #PureAV_FileType_RAR
  ElseIf Left(Header,2) = "PK"
   ProcedureReturn #PureAV_FileType_ZIP
  ElseIf Left(Header,3) = "003"
   ProcedureReturn #PureAV_FileType_ZIP
  ElseIf Left(Header,2) = "004"
   ProcedureReturn #PureAV_FileType_ZIP
  ElseIf Header = "PK00PK"
   ProcedureReturn #PureAV_FileType_ZIP
  Else
   ProcedureReturn #PureAV_FileType_UNKNOWN
  EndIf
 
  CloseFile(0)
 Else
  ProcedureReturn #PureAV_FileType_ERR
 EndIf

EndProcedure
In fact this script only recognises the type of the file being scanned by it's signature. The actual virus-checking code is in the EngineAPI.pb file. The procedure is called PureAVScanFile.

Posted: Mon Jul 31, 2006 1:53 pm
by Flype
looks like an error in the code here :

Code: Select all

  ElseIf Left(Header,2) = "004" 
   ProcedureReturn #PureAV_FileType_ZIP
Left(Header,2) = "004" shouldn't be Left(Header,3) = "004"

:?:

Posted: Mon Jul 31, 2006 8:26 pm
by Inf0Byt3
Yes, it should :D. That signature is very rare, but it's important... Thanks!

Re: PureAV - Antivirus in PureBasic - finally here

Posted: Sat Dec 28, 2013 3:27 pm
by YanGrob
Link dead . Please give a live link .

Re: PureAV - Antivirus in PureBasic - finally here

Posted: Sat Dec 28, 2013 7:33 pm
by jassing
YanGrob wrote:Link dead . Please give a live link .
I would think that after 7 1/2 years, it's a dead project and wouldn't compile anyway..

Re: PureAV - Antivirus in PureBasic - finally here

Posted: Sat Feb 22, 2014 12:12 am
by em_uk
But link plz!

:)