[ How To ] Injektor Erstellen mit Visual Basic

04/28/2010 16:57 HackTec#1
UPDATE -> CRONORS SOURCE 09.12.10



Creditz:

cronors... (warhax)
Hacktec fuer das umsetzten ^^


Hey Com :D ja es gibt bestimmt schon son tut vll auch als vid :D nur meine methode sollte auch jeder verstehen das es eig nur um C&p geht das sollte jeder könn ^^


So öffnet Visual Basic und macht ein neues Projekt

[Only registered and activated users can see links. Click Here To Register...]

und natuerlich ein timer einbauen


So nun klick einfach doppel klick auf eure form und dann löscht alles wa das steht und ersetzt es durch den unten code... auf deine form musst du noch 2 labels drauf packen da wird dann der text erscheinen

[Only registered and activated users can see links. Click Here To Register...]


und ersetzt ihn durch den code von hier unten dann speichern und fertig ist der injektor ^^



Quote:
Option Strict On
Option Explicit On
Imports System.Runtime.InteropServices

Public Class Form1
Const MEM_COMMIT As Integer = &H1000
Const PAGE_READWRITE As Integer = &H4
Const PROCESS_CREATE_THREAD As Integer = &H2
Const PROCESS_VM_OPERATION As Integer = &H8
Const PROCESS_VM_READ As Integer = &H10
Const PROCESS_VM_WRITE As Integer = &H20

<DllImport("kernel32.dll", SetLastError:=True, CallingConvention:=CallingConvention.Winapi)> _
Public Shared Function OpenProcess(ByVal dwDesiredAccess As UInteger, <MarshalAs(UnmanagedType.Bool)> _
ByVal bInheritHandle As Boolean, ByVal dwProcessId As Integer) As System.IntPtr
End Function

<DllImport("kernel32.dll", SetLastError:=True, CallingConvention:=CallingConvention.Winapi)> _
Public Shared Function WriteProcessMemory(ByVal hProcess As System.IntPtr, ByVal lpBaseAddress As System.IntPtr, _
ByVal lpBuffer As String, ByVal nSize As Int32, <Out()> ByRef lpNumberOfBytesWritten As Int32) As _
<MarshalAs(UnmanagedType.Bool)> Boolean
End Function

<DllImport("kernel32.dll", SetLastError:=True, CallingConvention:=CallingConvention.Winapi)> _
Public Shared Function VirtualAllocEx(ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, _
ByVal dwSize As Integer, ByVal flAllocationType As UInteger, _
ByVal flProtect As UInteger) As IntPtr
End Function

<DllImport("kernel32.dll", SetLastError:=True, CallingConvention:=CallingConvention.Winapi)> _
Public Shared Function GetModuleHandle(ByVal lpModuleName As String) As IntPtr
End Function

<DllImport("kernel32.dll", SetLastError:=True, CallingConvention:=CallingConvention.Winapi)> _
Public Shared Function GetProcAddress(ByVal hModule As IntPtr, ByVal lpProcName As String) As IntPtr
End Function

<DllImport("kernel32.dll", SetLastError:=True, CallingConvention:=CallingConvention.Winapi)> _
Public Shared Function CreateRemoteThread(ByVal hProcess As IntPtr, ByVal lpThreadAttributes As Integer, _
ByVal dwStackSize As UInteger, ByVal lpStartAddress As IntPtr, ByVal lpParameter As IntPtr, _
ByVal dwCreationFlags As UInteger, ByRef lpThreadId As IntPtr) As IntPtr
End Function

<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode, EntryPoint:="LoadLibraryA")> _
Public Shared Function LoadLibrary(ByVal lpFileName As String) As IntPtr
End Function

Friend WithEvents OZ As New Timer
Const TargetName As String = "WarRock"
Dim ExeName As String = IO.Path.GetFileNameWithoutExtension(Application.Ex ecutablePath)


Private Sub InnjectionMethods_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TopMost = True
OZ.Interval = 25
If IO.File.Exists(Application.StartupPath & "\" + ExeName + ".dll") Then
Me.Label1.Text = "...Warten auf WarRock.exe"
OZ.Start()
Else
Me.Label1.Text = ">" + ExeName
Me.Label2.Text = ".dll Nicht Gefunden !"
End If
End Sub

Private Sub OZs(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OZ.Tick
Dim Target As Process() = Process.GetProcessesByName(TargetName)
If Target.Length <> 0 Then
Me.Label2.Text = ">WarRock Is Running"
OZ.Stop()
InjectToProcess()
End If
End Sub

Sub InjectToProcess()
Dim ExeName As String = IO.Path.GetFileNameWithoutExtension(Application.Ex ecutablePath)
Dim Target As Process() = Process.GetProcessesByName(TargetName)
Dim pHandle As IntPtr = OpenProcess(PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, False, Target(0).Id)
If (pHandle = IntPtr.Zero) Then
Label2.Text = "<Failed To Open Processs!"
Else
Dim pszLibFileRemote As String = Application.StartupPath & "\" + ExeName + ".dll"
Dim pfnStartAddr As IntPtr = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")
Dim TargetBufferSize As Integer = Int(1 + Len(pszLibFileRemote))
Dim LoadLibParamAdr As IntPtr = VirtualAllocEx(pHandle, IntPtr.Zero, TargetBufferSize, MEM_COMMIT, PAGE_READWRITE)
If (LoadLibParamAdr = IntPtr.Zero) Then
Label2.Text = "<Failed To Allocate Memory!"
Else
Dim Rtn As Boolean = WriteProcessMemory(pHandle, LoadLibParamAdr, pszLibFileRemote, TargetBufferSize, 0)
If Rtn = False Then
Label2.Text = "<Failed To Write Memory!"
Else
Dim lpThreadId As IntPtr
CreateRemoteThread(pHandle, 0, 0, pfnStartAddr, LoadLibParamAdr, 0, lpThreadId)
If (lpThreadId = IntPtr.Zero) Then
Label2.Text = "<Failed To Create Thread!"
Else
Label2.Text = "<Dll Injected Succefully!"
End If
Me.Close()
End If
End If
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.BackColor = Color.Red
Me.TransparencyKey = Me.BackColor
Me.Hide()
End Sub



End Class

ihr musst eigt nur 2 label auf eurer projekt klatschen ;) ^^
04/28/2010 17:00 fcbm1995#2
geht der auch für w7?
04/28/2010 17:01 Cash²#3
Jo, weis auch woher das ist.

Außerdem kann man den untersten Teil löschen mit dem Button.
04/28/2010 17:01 bassbanane#4
Naja ein wirkliches Tutorial finde ich ist das jetzt nicht. Die ganzen Leecher hier machen sowieso nur Copy&Paste und dadurch lernen sie ja noch weniger :D
Ich finde man sollte wirklich mal erklären, wie ein Injektor überhaupt funktioniert und den Sourcecode wenigstens ein wenig kommentieren um das ganze auchverständlich zu machen.
Ich weiß z.B. nicht wie ein Injektor arbeitet aber ich würde es gerne wissen, dann kann ich nämlich auch selbst einen in meine Projekte einbinden, wenn ich einen brauch.
04/28/2010 17:09 HackTec#5
dazu fehlt mir leider die zeit das selber zu machen da mein blinddarm probleme macht -.-
wenn das einer besser erklärt haben möchte ueber visual basic der sollte mal die sempervideo anschauen ^^ alles gut erklärt^^

Quote:
Originally Posted by Cash² View Post
Jo, weis auch woher das ist.

Außerdem kann man den untersten Teil löschen mit dem Button.

wenn man ein thanks butten machen will kann er drin bleiben ^^
04/28/2010 17:52 Yasin™#6
weis ich aless™ hat es mir beigebracht!
04/28/2010 17:59 .TanTien#7
im code ist ein fehler:
Code:
(Application.Ex ecutablePath)
(Application.ExecutablePath) wäre richtig ;)

und du hast vergessen zu zeigen, dass man einen timer einbauen muss...
04/28/2010 18:03 Yasin™#8
haha!
04/28/2010 18:07 tarikgangster#9
Da hat es zu viele Fehler-_- kriegst kein Thx
04/28/2010 18:08 .TanTien#10
sry es waren doch 2 ^^
04/28/2010 18:09 Cash²#11
Klar, funktioniert das.
04/28/2010 18:10 .TanTien#12
aber 1 fehler im code und einer im tutorial (er hat vergessen zu zeigen, dass man einen timer einbauen muss)
04/28/2010 18:12 Cash²#13
Quote:
Originally Posted by Axel007649 View Post
aber 1 fehler im code und einer im tutorial (er hat vergessen zu zeigen, dass man einen timer einbauen muss)
Das wird spätestens bemerkbar, wenn der Timer, also im Code, unterstrichen oder gekringelt ist.
04/28/2010 18:14 .TanTien#14
da haste natürlich recht...der fehler im code wird aber nicht unterstrichen oder so...d.h. suchen und korrigieren ;)
04/28/2010 18:19 joki4444#15
ok geht doch sry