Source Code Heuristic File Terinfeksi Vitro (Ramnit)
Pertama tambahkan Componet “Microsoft CommonDialog Control 6.0 (SP3)” Dengan Menekan “Ctrl +T” Setelah Component Tersebut Di tambahkan Lalu Buatlah
a. 1 buah Commondialog
b. 2 buah commandbutton
c. 1 TextBox
Seperti Gambar Beriut
Lalu Masukan Code Berikut ini Ke dalam form tsb
Private Sub Command1_Click()
CommonDialog1.Filter = ".dll|*.dll"
CommonDialog1.ShowOpen
Text1.Text = CommonDialog1.FileName
End Sub
Private Sub Command2_Click()
If DetectRamnitG(Text1.Text) = True Then
MsgBox "File : " & "[" & Text1.Text & "]" & " Terinfeksi Ramnit.G!", vbCritical, "SMK AntiVir"
If MsgBox("Apakah Anda Ingin Menghapusnya?", vbQuestion + vbYesNo, APP_PROGRAM) = vbYes Then
On Error Resume Next
Kill Text1.Text
End If
Else
MsgBox "File : " & "[" & Text1.Text & "]" & " Bukan Virus!!", vbInformation, "SMK AntiVir"
End If
End Sub
Private Sub Form_Load()
MsgBox "Terimakasih telah Mendownload File Ini", vbInformation, "SMK AntiVir"
End Sub
Kemudian Setelah Selah Semua Tools Di masukan Ke dalam Form, Butlah Sebuah Module Dengan nma
“ModRamnitG” , lalu iskan Code Brikut kedalam Module tsb
Function DetectRamnitG(spath As String) As Boolean
Dim TheVirusString As String, TheVirusName As String
TheVirusString = "®®#Áóà"
TheVirusName = "Terinfek Ramnit.G" 'bisa dikembangin dgn membaca database. Apakah cocok?? Jika ya > lapor"
If InStr(ReadFile(spath), TheVirusString) > 0 Then
DetectRamnitG = True
End If
End Function
Public Function ReadFile(sFile As String) As String
On Error Resume Next
Open sFile For Binary Access Read As #1
ReadFile = Space(LOF(1))
Get #1, , ReadFile
Close #1
End Function
0 komentar:
Post a Comment