![]() |
|
Membuat Anti Debugger pada program [ Vb 6 ] - Printable Version +- HN-Community (https://hacker-newbie.org) +-- Forum: Miscellaneous (https://hacker-newbie.org/forum-86.html) +--- Forum: Coding/Programing (https://hacker-newbie.org/forum-19.html) +---- Forum: Visual Basic (VB) (https://hacker-newbie.org/forum-68.html) +---- Thread: Membuat Anti Debugger pada program [ Vb 6 ] (/thread-5942.html) |
Membuat Anti Debugger pada program [ Vb 6 ] - mydisha - 12-17-2010 bila ada yang masih kurang mengerti tentang debug,debugger,debuggin bisa baca ini dulu Quote:Debugging adalah sebuah metode yang dilakukan oleh para pemrogram dan pengembang perangkat lunak untuk meng-analisa alur kerja program, mencari dan mengurangi bug, atau kerusakan di dalam sebuah program komputer atau perangkat keras sehingga perangkat tersebut bekerja sesuai dengan harapan. Debugging cenderung lebih rumit ketika beberapa subsistem lainnya terikat dengan ketat dengannya, mengingat sebuah perubahan di satu sisi, mungkin dapat menyebabkan munculnya bug lain di dalam subsistem lainnya. intinya debugger itu membuat program kita engga sesuai alur yang udah kita buat Correct Me If I Wrong dah selesai dengan pengertian debugger yuk ke pokok pembahasannya mungkin agan" kesel banget apabila program yang kita buat di lucuti oknum tak bertanggung jawab biasanya cracker yang suka kayak gini nih . nah untuk itu kita perlu memasang security pada program yang kita buat ... nih ada contoh code anti debug [Anti Debugger] yang sangat sederhana sekali tetapi memiliki manfaat yang besar cocok untuk kita" belajar code ini hanya bekerja apabila program yang kita buat telah di run di process :) * buka microsoft visual basic 6 * lalu di pojok atas kanan ada tulisan Project1 (Project1.vbp) lalu klik kanan * setelah di klik kanan pilih Project1 Properties > Starup Object Pilih yang Sub Main * Buat 1 module terserah ingin dinamakan apa module tersebut * pada form buat 1 button teserah namanya apa lalu copykan code ini di button tersebut code untuk button Code: unload me
endLalu copy kan code ini di module yang sudah kita buat ... Code: 'by mydisha @ hacker - newbie
Public Type DEBUG_EVENT
dwDebugEventCode As Long
dwProcessId As Long
dwThreadId As Long
DATA(20) As Long 'enough space
End Type
Declare Function SetEvent Lib "kernel32" (ByVal hEvent As Long) As Long
Declare Function ResetEvent Lib "kernel32" (ByVal hEvent As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Declare Function OpenEvent Lib "kernel32" Alias "OpenEventA" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal lpName As String) As Long
Declare Function CreateEvent Lib "kernel32" Alias "CreateEventA" (lpEventAttributes As Any, ByVal bManualReset As Long, ByVal bInitialState As Long, ByVal lpName As String) As Long
Public Const SYNCHRONIZE = &H100000
Public Const STANDARD_RIGHTS_REQUIRED = &HF0000
Public Const EVENT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3)
Public Const SW_SHOWNORMAL = 1
Public Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Public Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
Public Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Byte
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Public Const INFINITE = &HFFFFFFFF
Public Const DBG_CONTINUE = &H10002
Public Const PROCESS_ALL_ACCESS = &H1F0FFF
Public Const EXIT_PROCESS_DEBUG_EVENT = 5
Declare Function ContinueDebugEvent Lib "kernel32" (ByVal dwProcessId As Long, ByVal dwThreadId As Long, ByVal dwContinueStatus As Long) As Long
Declare Function WaitForDebugEvent Lib "kernel32.dll" (ByRef lpDebugEvent As DEBUG_EVENT, ByVal dwMilliseconds As Long) As Long
Declare Function DebugActiveProcess Lib "kernel32" (ByVal dwProcessId As Long) As Long
Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, lpCommandLine As Any, lpProcessAttributes As Any, lpThreadAttributes As Any, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDirectory As String, lpStartupInfo As Any, lpProcessInformation As Any) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Public Sub Main()
'Work apabila program telah di compile & Di run
Dim ret As Long
Select Case Command
Case ""
Dim PIP As PROCESS_INFORMATION
Dim SC1 As SECURITY_ATTRIBUTES
Dim SC2 As SECURITY_ATTRIBUTES
Dim SI As STARTUPINFO
SC1.nLength = Len(SC1)
SC2.nLength = Len(SC2)
SI.cb = Len(sinfo)
SI.dwFlags = 1
SI.wShowWindow = 1
Dim RunAgain As String
RunAgain = AddSlash(App.Path) & App.EXEName & ".exe Disha"
ret = CreateProcess(vbNullString, ByVal RunAgain, SC1, SC2, 0, &H20, 0&, App.Path, SI, PIP)
WaitForSingleObject PIP.hProcess, 100
Protect PIP.dwProcessId
Case "Disha"
'Start The Program!
Dim EV As Long
EV = CreateEvent(ByVal 0&, 0, 0, "GO!")
Call WaitForSingleObject(EV, INFINITE)
CloseHandle EV
Form1.Show 'Form1 dapat di ganti dengan nama form yang anda sukai
End Select
End Sub
Function AddSlash(ByVal StrX As String) As String
If Right(StrX, 1) <> "" Then AddSlash = StrX & ""
End Function
Sub Protect(ByVal ProcessId As Long)
Call DebugActiveProcess(ProcessId)
Dim EVX As Long
EVX = OpenEvent(EVENT_ALL_ACCESS, 0, "GO!")
SetEvent EVX
Dim DBGEVENT As DEBUG_EVENT
Do
WaitForDebugEvent DBGEVENT, INFINITE
Select Case DBGEVENT.dwDebugEventCode
Case EXIT_PROCESS_DEBUG_EVENT
Dim H As Long
H = OpenProcess(PROCESS_ALL_ACCESS, 0, DBGEVENT.dwProcessId)
TerminateProcess H, 0
CloseHandle H
End
End Select
Call ContinueDebugEvent(DBGEVENT.dwProcessId, DBGEVENT.dwThreadId, &H10002)
Loop
End Subini hanyalah program anti debug sederhana semoga bisa membantu agan"
RE: Membuat Anti Debugger pada program [ Vb 6 ] - coe88 - 12-17-2010 ![]() ![]() ![]() Bookmark dolo sob.... Jadi pada inti nya supaya coding vb kita tidak bisa dibajak yoooo. RE: Membuat Anti Debugger pada program [ Vb 6 ] - hogyz - 12-17-2010 * hogyz masih bingung dengan yang ini Case "" Dim PIP As PROCESS_INFORMATION Dim SC1 As SECURITY_ATTRIBUTES Dim SC2 As SECURITY_ATTRIBUTES Dim SI As STARTUPINFO SC1.nLength = Len(SC1) SC2.nLength = Len(SC2) SI.cb = Len(sinfo) SI.dwFlags = 1 SI.wShowWindow = 1 Dim RunAgain As String RunAgain = AddSlash(App.Path) & App.EXEName & ".exe Disha" ret = CreateProcess(vbNullString, ByVal RunAgain, SC1, SC2, 0, &H20, 0&, App.Path, SI, PIP) WaitForSingleObject PIP.hProcess, 100 Protect PIP.dwProcessId Case "Disha" 'Start The Program! Dim EV As Long EV = CreateEvent(ByVal 0&, 0, 0, "GO!") Call WaitForSingleObject(EV, INFINITE) CloseHandle EV Form1.Show 'Form1 dapat di ganti dengan nama form yang anda sukai RE: Membuat Anti Debugger pada program [ Vb 6 ] - mydisha - 12-17-2010 (12-17-2010, 05:24 PM)hogyz Wrote: * hogyz masih bingung dengan yang ini itu fungsinya gan ... jadi ini tuh kayak nge buat double thread gan :D RE: Membuat Anti Debugger pada program [ Vb 6 ] - Sidom - 12-17-2010 nice share aja gan ![]() ![]() msh sama sprt dlu kagak ngerti VB RE: Membuat Anti Debugger pada program [ Vb 6 ] - mydisha - 12-18-2010 (12-17-2010, 10:02 PM)Sidom Wrote: nice share aja gan belajar dong om sidom
RE: Membuat Anti Debugger pada program [ Vb 6 ] - maximus999 - 12-18-2010 nice share RE: Membuat Anti Debugger pada program [ Vb 6 ] - mydisha - 12-25-2010 iya om ... silahkan di gunakan codenya :D |