Hai programmer ? Sekarang saya akan menjelaskan cara memprotect Exe yang dibuat dari visualbasic 6 ( VB 6 ) dengan Protect Size. Artinya Size(Ukuran) Exe(aplikasi) anda Jika diowah-owah orang lain maka otomatis Exe tersebut didelete/dihapus oleh komputer secara otomatis.
Tutorial pemasangan Sourcecode program :
- Buka Visual Basic 6 ( Jika belum punya silahkan klik Download )
- Klik kanan pada Forms dan pilih View Code.
- Hapus code Option Explicit dan masukan source code berikut.
Option Explicit
Function ProtectErvankusnaidi()
On Error GoTo err
If FileLen(App.EXEName + ".exe") <> 499712 Then '499712 adalah file size(kb) setelah dicompile,sesuaikan jika anda menggunakan VMProtect,UPX atau exe compressor lainnya
Call DeleteAPP
Kill App.Path & "\PerX.ini"
MsgBox "File Size is changed !, Application will delete from your computer...", vbCritical, "Error"
End
End If
err:
End Function
Private Sub Form_Load()
On Error Resume Next
Debug.Print 1
If err Then
Me.Show
CenterForm Me
Else
ProtectErvankusnaidi
End If
End Sub
- Membuat module baru dan masukan code dibawah ini :
Option Explicit
Public strBatName As String
Private Declare Function GetShortPathName Lib "kernel32" _
Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Sub GetName()
Dim strBatDir As String
Dim lenBatDir As Long
Dim I As Long
Dim strExe As String
Dim LenAppDir As Long
Dim strAppDir As String
strAppDir = Space(256)
If Right(App.Path, 1) <> "\" Then
strExe = "\" & App.EXEName
Else
strExe = App.EXEName
End If
MkDir App.Path & strExe
LenAppDir = GetShortPathName(App.Path & strExe, strAppDir, 256)
RmDir App.Path & strExe
strAppDir = Left(strAppDir, LenAppDir)
strAppDir = strAppDir & ".exe"
strBatDir = Space(256)
lenBatDir = GetShortPathName(Environ$("windir"), strBatDir, 256)
strBatDir = Left(strBatDir, lenBatDir)
If Right(strBatDir, 1) <> "\" Then
strBatDir = strBatDir & "\"
End If
I = 1
Do Until Len(Dir(strBatDir & I & ".bat")) = 0
I = I + 1
Loop
strBatName = strBatDir & I & ".bat"
Open strBatName For Output As #1
Print #1, "@echo off"
Print #1, ":redo"
Print #1, "del "; strAppDir
Print #1, "if exist "; strAppDir; " goto redo"
Print #1, "del "; strBatName
Close #1
End Sub
Public Sub DeleteAPP()
On Error GoTo IDEerr
GetName
Debug.Print 1 \ 0
Shell strBatName, vbHide
Exit Sub
IDEerr:
Kill strBatName
End Sub
'================================'
Keterangan ( Nota benne ) :
- ProtectErvanKusnaidi */Berwarna Merah\* = Jangan diHapus / Ganti nama.
- 499712 /*Berwarna Hijau*\ = Size(Ukuran) File Exe anda.








0 komentar