5 years ago, when i was in love with VB
, I created this simple program to detect if a file is virus or not.
What I'd like is to see if you can help me optimize it, speed-wise.
I open an executable file in a rich textbox control and use the Instr
method to search for occurrences of predefined string. The problem is that the Instr
method is damn slow when searching files as small as 512KB.
Can the speed be enhanced?
If InStr(1, rt.Text, "scripting.filesystemobject") Then
It does something with FSO
End If
If InStr(1, rt.Text, "thisprogramcannotberunindosmode") Or InStr(1, rt.Text, "thisprogrammustberununderwin32") Then
Probably a DOS program
Else
looks like a GUI program
End If
If InStr(1, rt.Text, "hkey_local_machine") Then
Does something with registry
End If
If InStr(1, rt.Text, "hkey_users") Then
Does something with registry
End If
If InStr(1, rt.Text, "hkey_current_user") Then
Does something with registry
End If
If InStr(1, rt.Text, "hkey_classes_root") Then
Does something with registry
End If
If InStr(1, rt.Text, "hkey_current_config") Then
Does something with registry
End If