No Lintah V 1.0 

Program AntiVirus
Untuk menghilangkan virus yang menempel di MS Word


Selanjutnya, tekan File – Make Carifile.exe dan anda akan mendapatkan file target berisi alamat file exe di suatu folder. Cara penggunaannya dijelaskan pada gambar dibawah ini :

Catatan : kalau anda tidak mempunyai MS Visual Basic, atau sama sekali tidak tertarik dengan pemrograman, langsung aja download paket No Lintah V 1.0 disini  . Tulisan ini memang dimaksudkan untuk  mempelajari pemrograman berikut algoritmanya agar dapat dikembangkan lebih lanjut.

Gambar 7. Penggunaan program carifile.exe

Selanjutnya simpan file tersebut dengan nama sembarang. Contoh : target.txt. Penyimpanan secara default berada dimana program carifile.exe berada

2.      Membuat Macro untuk membersihkan virus

Langkah selanjutnya, kita buka MS Word, click Tools  - Macro – Security. Set security to low atau medium

Langkah kedua, buka Tools – Macro – Visual Basic Editor, pada project explorer, click nama dokumen kita, pastekan  kode berikut ini . Saya akan menjelaskan kodenya satu per satu .

a.       Kode untuk memasukkan file yang akan diproses, kemudian dibaca satu per satu dan di cek ada virusnya nggak.

Untuk itu, kita harus mempunyai file target, yaitu file yang telah kita dapatkan dari program Carifile.exe tadi. Selanjutnya buka file ini. Untuk menampilkan kotak dialog membuka file, cukup mudah. Periksa perintah fuction bukafile di bawah ini.

Function bukafile() As String
 Dim lngCount As Long
 ' Open the file dialog
   With Application.FileDialog(msoFileDialogOpen)
   .AllowMultiSelect = True
   .Show
 ' Display paths of each file selected
   For lngCount = 1 To .SelectedItems.count
   bukafile = .SelectedItems(lngCount)
   Next lngCount
 End With
End Function

Fungsi diatas memungkinkan kita memasukkan nama file lebih dari satu.

Keterangan selanjutnya dapat dibaca di program.
Sub proses()
 Laporan = ""
 MsgBox ("masukkan dahulu target file berupa berisi alamat file *.exe 
yang akan diproses") filenya = bukafile Close #1 Open filenya For Input As #1 Do While Not EOF(1) AdaVirus = False Line Input #1, LineProcessed If Len(LineProcessed) <> 0 Then Postitik = InStr(1, LineProcessed, ".") FileSave = Mid(LineProcessed, 1, Postitik) + "doc" Call bukafileBervirus(LineProcessed, FileSave, Laporan, AdaVirus) If AdaVirus Then Kill LineProcessed End If Loop MsgBox (Laporan) Close #1 End Sub
Sub bukafileBervirus(Bervirus, Simpan, Lapor, Viruskah)
Dim WordID, PanjKar
           Dim KarTampung
           Dim Lokasi, PanjFile, lokasi2
           Dim Ketemu
           Dim count
   Close #2
   Close #3
   Ketemu = False
   'Bervirus = bukafile
   Open Bervirus For Binary As #2
   PanjFile = FileLen(Bervirus)
   WordID = "ÐÏࡱá"
   PanjKar = Len(WordID)
   count = 1
   Do While Not EOF(2) And count < 500000
   Seek #2, count
   pola1 = Input(1, #2)
   lokasi2 = count + PanjKar - 1
   Seek #2, lokasi2
   pola2 = Input(1, #2)
   If pola1 = "Ð" And pola2 = "á" Then
   Seek #2, count
   KarTampung = Input(PanjKar, #2)
   If KarTampung = WordID Then
   Lokasi = Loc(2) - PanjKar
   'MsgBox ("Virus ketemu, File Word/Excel pada " + CStr(Lokasi))
   Ketemu = True
   Viruskah = True
   exefile = False
   GoTo KeluarLoop
   
   Else: count = count + 1
   End If
   
   Else
   count = count + 1
   End If
   
   Loop
   KeluarLoop:
   If Ketemu Then
   KataLapor = "VIRUS!!!, Sudah dibersihkan"
   
   Open Simpan For Output As #3
   Seek #2, Lokasi + 1
   Do While Not EOF(2)
   KarTampung = Input(PanjFile, #2)
   Print #3, KarTampung
   Loop
   Close #3
   Else: KataLapor = " BUKAN VIRUS, tak diapa-apakan" 'MsgBox ("Gak ketemu")
   End If
   Lapor = Lapor + Bervirus + " " + KataLapor + Chr(13)
   'MsgBox (KataLapor)
   Close #2
   'Close #3
   End Sub
   Function bukafile() As String
 Dim lngCount As Long
 ' Open the file dialog
   With Application.FileDialog(msoFileDialogOpen)
   .AllowMultiSelect = True
   .Show
 ' Display paths of each file selected
   For lngCount = 1 To .SelectedItems.count
   bukafile = .SelectedItems(lngCount)
   Next lngCount
 End With
End Function
Private Sub CommandButton1_Click()
   proses
   End Sub
         

Ok, dan program anda sudah siap untuk diuji. Agar lebih sempurna, tambahkan beberapa cara penggunaan. Selamat berburu VIRUS.... 



Kemana Setelah Ini?

Bahasan Berikutnya
Selanjutnya, hentikan virus di Memori
Halaman Bantuan Umum