PureAV - Antivirus in PureBasic - finally here

Developed or developing a new product in PureBasic? Tell the world about it.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post 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.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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"

:?:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Yes, it should :D. That signature is very rare, but it's important... Thanks!
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
YanGrob
New User
New User
Posts: 1
Joined: Sat Dec 28, 2013 1:19 pm

Re: PureAV - Antivirus in PureBasic - finally here

Post by YanGrob »

Link dead . Please give a live link .
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: PureAV - Antivirus in PureBasic - finally here

Post 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..
User avatar
em_uk
Enthusiast
Enthusiast
Posts: 366
Joined: Sun Aug 08, 2010 3:32 pm
Location: Manchester UK

Re: PureAV - Antivirus in PureBasic - finally here

Post by em_uk »

But link plz!

:)
----

R Tape loading error, 0:1
Post Reply