Developed or developing a new product in PureBasic? Tell the world about it.
Inf0Byt3
PureBasic Fanatic
Posts: 2236 Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia
Post
by Inf0Byt3 » Mon Jul 31, 2006 12:30 pm
Thx
... 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)
Flype
Addict
Posts: 1542 Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy
Post
by Flype » Mon Jul 31, 2006 1:53 pm
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
Posts: 2236 Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia
Post
by Inf0Byt3 » Mon Jul 31, 2006 8:26 pm
Yes, it should
. 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
Posts: 1 Joined: Sat Dec 28, 2013 1:19 pm
Post
by YanGrob » Sat Dec 28, 2013 3:27 pm
Link dead . Please give a live link .
jassing
Addict
Posts: 1885 Joined: Wed Feb 17, 2010 12:00 am
Post
by jassing » Sat Dec 28, 2013 7:33 pm
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..
em_uk
Enthusiast
Posts: 366 Joined: Sun Aug 08, 2010 3:32 pm
Location: Manchester UK
Post
by em_uk » Sat Feb 22, 2014 12:12 am
But link plz!
----
R Tape loading error, 0:1