Virus Scanner
This is kind of a Virus Scanner...It's to let you get the feel of a scanner which searches for strings a virus might have and then displays that it is a virus in a message box. Put this in a module and call it from like a button or something. I am only 13 so if you think this code is dumb or wouldn't work...sorry im still learning. E-Mail me at BmFWaLk316@Juno.com if you have any problems. Later.
AI
Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Zdrojový kód
Function Scanner(File As String)
Infected = 0
Trojan = 0
Dim BO As Integer
Dim FileLenn As Variant
Dim FileLennn As Variant
Dim l003A As Variant
Dim l003E As Variant
Dim l0039 As String
Dim l0001 As Single
Dim l0002 As Single
Dim l0003 As Single
Dim l0004 As Single
Dim l0005 As Single
Dim l0006 As Single
Dim l0007 As Single
Dim l0008 As Single
Dim l0009 As Single
Dim l0010 As Single
Dim l0011 As Single
Dim l0012 As Single
Dim l0013 As Single
Dim l0014 As Single
Dim l00530 As Single
If LCase(Right$(File, 3)) = "swp" Then MsgBox "File Is a System.swp File": Exit Function
Open File For Binary As #2
DoEvents
FileLenn = LOF(2)
FileLennn = FileLenn
l003A = 1
While FileLennn >= 0
If FileLennn > 32000 Then
l003E = 32000
ElseIf FileLennn = 0 Then
l003E = 1
Else
l003E = FileLennn
End If
l0039$ = String$(l003E, " ")
Get #2, l003A, l0039$
l0001! = InStr(1, l0039$, "@juno.com", 1)
l0002! = InStr(1, l0039$, "@hotmail.com", 1)
l0003! = InStr(1, l0039$, "@rocketmail.com", 1)
l0004! = InStr(1, l0039$, "Password", 1)
l0005! = InStr(1, l0039$, "Screen Name", 1)
l0006! = InStr(1, l0039$, "win32.exe", 1)
l0007! = InStr(1, l0039$, "STEALER1", 1)
l0008! = InStr(1, l0039$, "PWSTEAL", 1)
l0009! = InStr(1, l0039$, "usa.com", 1)
l0010! = InStr(1, l0039$, "Remove Directory", 1)
l0011! = InStr(1, l0039$, "autoapp", 1)
l0012! = InStr(1, l0039$, "deltree /y", 1)
l0013! = InStr(1, l0039$, "kill *.*", 1)
l0014! = InStr(1, l0039$, "load", 1)
l00530! = InStr(1, l0039$, "win.ini", 1)
If l0001! Then Infected = 1: MsgBox "File Sends Mail To juno.com": Exit Function
If l0002! Then Infected = 1: MsgBox "File Sends Mail To hotmail.com": Exit Function
If l0003! Then Infected = 1: MsgBox "File Sends Mail To rocketmail.com": Exit Function
If l0004! Then Infected = 1: MsgBox "File Contains The String 'Password'": Exit Function
If l0005! Then Infected = 1: MsgBox "File Contains The String 'Screen Name'": Exit Function
If l0006! Then Infected = 1: MsgBox "File Loads Itself As 'Win32'": Exit Function
If l0007! Then Infected = 1: MsgBox "File Is An AOL Trojan": Exit Function
If l0008! Then Infected = 1: MsgBox "File Is An AOL Trojan": Exit Function
If l0009! Then Infected = 1: MsgBox "File Sends Mail To usa.com": Exit Function
If l0010! Then Infected = 1: MsgBox "File Removes Directories": Exit Function
If l0011! Then Infected = 1: MsgBox "File Is Probably An Auto Mailer": Exit Function
If l0012! Then Infected = 1: MsgBox "File Is A Deltree": Exit Function
If l0013! Then Infected = 1: MsgBox "File Is A Virus": Exit Function
If l0014! And l00530! Then Infected = 1: MsgBox "File Writes To The 'win.ini' File ": Exit Function
If BO = 3 And FileLenn = 124928 Then Trojan = 1: MsgBox "File Is The BackOrifice.Trojan": Exit Function
If Not l0001! Or Not 10002! Or Not 10003 Or Not 10004! Or Not 10005! Or Not 10006! Or Not l0007! Or Not l0008! Or Not l0009! Or Not l0010! Or Not l0011! Or Not l0012! Or Not l0013! Or Not l0014! Then Infected = 0: MsgBox "No Virus Found": Exit Function
Wend
End Function
<P align=center><FONT size=5>Cross-frame Javascript Tutorial<BR><FONT size=1>by
Herbert L. Riede, Programmer, WinDough.com, Inc.</FONT></FONT></P>
<P align=left><FONT face=Arial size=2>After creating extensive code for a window
with a dozen frames, I thought that submitting this article, even if only for my
future reference, would come in handy to someone. </FONT></P>
<P align=left><STRONG>Myth #1: Frames are complicated</STRONG></P>
<P align=left>While frames are not always ideal for many designs, they do
sometimes come in handy with specialized applications.</P>
<P align=left>Let's take a look at a fictional frameset:</P>
<P align=left><FONT face=System><FONT><frameset cols="100,*" border="0"
framespacing="0" frameborder="NO" <FONT
color=#339966>onbeforeunload="areyousure();"</FONT>><BR>
<frameset rows="120,*,300,*,10" border="0" framespacing="0"
frameborder="NO"><BR> <frame
name="logo" src="My100x120Logo.html" marginwidth="0" marginheight="0"
scrolling="no" frameborder="0"
noresize><BR></FONT> <frame
name="spacer1" src="Spacer.html" marginwidth="0" marginheight="0" scrolling="no"
frameborder="0" noresize> <BR></FONT><FONT
face=System> <frame name="menu"
src="menu.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"
noresize><BR> <frame
name="spacer2" src="Spacer.html" marginwidth="0" marginheight="0" scrolling="no"
frameborder="0" noresize><BR>
<frame name="notice" src="Notice.html" marginwidth="0" marginheight="0"
scrolling="no" frameborder="0" noresize><BR>
</frameset><BR> <frame name="mainwindow"
src="content.html" marginwidth="0" marginheight="0" scrolling="yes"
frameborder="0"><BR></frameset></FONT></P><FONT face="Times New Roman">
<P align=left>The first tag is the FRAMESET tag. It specifies two columns, one
is 100 pixels wide, and the other takes up the rest of the width. There is to be
no space between the two frames, no border, and before the frameset is unloaded,
you wish to execute the JavaScript function areyousure().</P>
<P align=left><STRONG><EM>onbeforeunload() is specific to Internet
Explorer.</EM></STRONG></P>
<P align=left>The second tag is a FRAMESET tag as well.. It will split up the
100 pixel wide column in the previous FRAMESET. It defines 5 rows, with the
first one 120 pixels high, the <EM>third</EM> one 300 pixels high, and the
<EM>fifth</EM> one 10 pixels high.<BR>The second and fourth row will
<EM><U>evenly split</U></EM> any remaining vertical pixels left, if any.</P>
<P align=left>The next five tags assign the attributes to the five rows in the
first column.</P>
<P align=left>The next tag is necessary to close the inner frameset for the
first column. (</FRAMESET>)</P>
<P align=left>The next tag is a FRAME tag that assigns ALL of the second column
to one page, and unlike all of the other frames, it enables scrolling, if
necessary.</P>
<P align=left>The FRAMESET map looks like this:</P>
<P align=left>
<U>LOGO </U>|<BR>
<U>SPACER1 </U>|<BR>
<U>MENU </U>|
MAINWINDOW<BR> <U>SPACER2 </U>| <BR>
NOTICE |</P>
<P align=left>Most tuorials will show you simple stuff like navigating the
"mainwindow" frame from, say, the "menu" frame.</P>
<P align=left><FONT face=System><a href="anotherpage.html"
target="mainwindow"> -OR-</FONT></P>
<P align=left><FONT face=System>top.mainwindow.document.location.href=
"anotherpage.html";</FONT></P>
<P align=left><FONT>But what if you want to set a variable in another frame? Or
run a function in another frame? Just as simple:</FONT></P><FONT
face=System><FONT face=System>
<P align=left><FONT face="Times New Roman">The first one runs menuClicked() in
the "mainwindow" frame, the second sets "mainwindow" frame's myvariable to
1.</FONT></P>
<P align=left><a href="javascript:doNothing();"
onClick="top.mainwindow.menuClicked(1); return false;"> -OR-</FONT></P>
<P align=left><FONT face=System><a href="javascript:doNothing();"
onClick="top.mainwindow.myvariable = 1; return false;"></FONT></P>
<P align=left>[NOTE: doNothing() is usually a Javascript programmer's junk
function, which contains no commands but still exists in each page's
javascript]</P>
<P align=left><FONT face="Times New Roman">Now what if you have one of your
pages, say content.html, load a frameset of it's own? And you want to check to
see is it has been loaded before you try to address the frames? OK, let's assume
the content.html will split into two frames, named "topcontent" and
"bottomcontent".. Now say you want the "logo" frame to have a link that loads
something into "bottomcontent" if it exists, or into the entire "mainwindow" if
it doesn't:</FONT></P>
<P align=left>function LoadCopyright() {<BR>if (top.mainwindow.bottomcontent)
{<BR>
top.mainwindow.bottomcontent.document.location.href="Copyright.html";<BR>} else
{<BR> top.mainwindow.document.location.href = "Copyright.html";<BR>}</P>
<P align=left><A href="javascript:doNothing();" onClick="LoadCopyright();
return false;"></P>
<P align=left><FONT face="Times New Roman">It took more typing to explain it
than it did to DO it... Of course you need to surround javascript functions in a
<SCRIPT> tag, and each <A href...> needs an </A> after the
text or image you use for your link...</FONT></P>
<P align=left><FONT face="Times New Roman">Now to a neat "Stu<a href=""></a>pid FrameSet Trick"
only available in IE using the FRAMESET or BODY tag's <b><i>onbeforeunload="areyousure();";</i></b> property:</FONT></P>
<P align=left>function areyousure() {<BR>event.returnValue = "Are you sure you
want to miss out on [My Offer]?";<BR>}</FONT></P>
<P align=left>This has great use in a frameset, because the viewer will only be
asked if they:<BR>A. Refresh the entire window<BR>B. Visit a site that breaks
out of the frameset<BR>C. Clicks the Back button to exit your site<BR><STRONG>D.
Clicks the 'X' Close button</STRONG></P>
<P align=left>Another neat side-effect is that if they click "Cancel", (to stay
at your site) NOTHING happens! If you use "onunload", the window closes and you
need to re-open the window!</P>
<P align=left>You can see all of this functionality in it's full glory where I
developed it at:<BR><A
href="http://www.windough.com">http://www.windough.com</A> </P>
<P align=left>Please note that what I present here is simplified and 'common
knowledge' of advanced Javascript programmers. You may develop based on this
tutorial, but you may not use code from Windough.com.</P>
<P align=left>If you have any comment or questions, please don't hesitate to
post them. I enjoy helping people.</P>
<P align=left>If this was of any use to you,<STRONG> please Vote</STRONG>.. I
don't expect to win, but positive votes help the ego now and then :)</P>
<P align=left>Also, if you have any other tutorial suggestions, please comment
here as well.</P>
<P align=left>Herbert Riede<BR>Programmer, WinDough.com,
Inc.</P></FONT>
Původní komentáře (3)
Obnoveno z Wayback Machine