Nadie ha pasado por esto?? Soy el primero que hace un inyector en vb,net? Please Help!
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
'ESTRUCTURA PROCESS_INFORMATION
Private Structure PROCESS_INFORMATION
Dim hProcess As Long
Dim hThread As Long
Dim dwProcessId As Long
Dim dwThreadId As Long
End Structure
'ESTRUCTURA STARTUPINFO
Private Structure STARTUPINFO
Dim cb As Long
Dim lpReserved As String
End Structure
'TIPOS PARA LA CREACION DEL PROCESO
Enum PROCESS_CREATION_FLAG As Integer
CREATE_BREAKAWAY_FROM_JOB = &H1000000
CREATE_DEFAULT_ERROR_MODE = &H4000000
CREATE_NEW_CONSOLE = &H10
CREATE_NEW_PROCESS_GROUP = &H200
CREATE_NO_WINDOW = &H8000000
CREATE_PROTECTED_PROCESS = &H40000
CREATE_PRESERVE_CODE_AUTHZ_LEVEL = &H2000000
CREATE_SEPARATE_WOW_VDM = &H800
CREATE_SHARED_WOW_VDM = &H1000
CREATE_SUSPENDED = &H4
CREATE_UNICODE_ENVIRONMENT = &H400
DEBUG_ONLY_THIS_PROCESS = &H2
DEBUG_PROCESS = &H1
DETACHED_PROCESS = &H8
EXTENDED_STARTUPINFO_PRESENT = &H80000
INHERIT_PARENT_AFFINITY = &H10000
NORMAL_PRIORITY_CLASS = &H10
End Enum
'CONSTANTES PARA VIRTUALALLOCEX
Const PROCESS_VM_OPERATION = &H8
Const PROCESS_VM_READ = &H10
Const PROCESS_VM_WRITE = &H20
Const PROCESS_ALL_ACCESS = 0
Const MEM_COMMIT = &H1000
Const MEM_RESERVE = &H2000
Const MEM_DECOMMIT = &H4000
Const MEM_RELEASE = &H8000
Const MEM_FREE = &H10000
Const MEM_PRIVATE = &H20000
Const MEM_MAPPED = &H40000
Const MEM_TOP_DOWN = &H100000
Const PAGE_EXECUTE_READWRITE = &H40
Const PAGE_READWRITE = &H4&
'FUNCIONES APIS
Private Declare Function CreateProcessA Lib "kernel32" (ByVal lpAppName As String, ByVal lpCommandLine As String, ByVal lpProcessAttributes As Integer, ByVal lpThreadAttributes As Integer, ByVal bInheritHandles As Integer, ByVal dwCreationFlags As Integer, ByVal lpEnvironment As Integer, ByVal lpCurrentDirectory As Integer, ByRef lpStartupInfo As STARTUPINFO, ByRef lpProcessInformation As PROCESS_INFORMATION) As Integer
Private Declare Function VirtualAllocEx Lib "kernel32.dll" (ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As IntPtr, ByVal flAllocationType As Integer, ByVal flProtect As Integer) As IntPtr
Public Sub Ejecutar(ByVal Programa As String)
Dim pInfo As PROCESS_INFORMATION
Dim sInfo As New STARTUPINFO
Dim Process As Long
Dim Memoria As Long
Dim DllLen As Integer = Len(DllName)
sInfo.cb = Len(sInfo)
Try
Process = CreateProcessA(vbNullString, Programa, 0, 0, False, PROCESS_CREATION_FLAG.CREATE_SUSPENDED, 0, 0, sInfo, pInfo)
Memoria = VirtualAllocEx(pInfo.hProcess, 0, DllLen, MEM_COMMIT, PAGE_EXECUTE_READWRITE)
Catch e As Exception
MsgBox(e.Message)
End Try
End Sub
Private Sub BtnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLoad.Click
Dim LoadLibHandle As Integer
Dim GetProcHandle As Integer
Dim StartUp As New STARTUPINFO
Dim ProcessInfo As New PROCESS_INFORMATION
Dim DllTam As Integer
Dim VirtualRet As Integer
Dim bytes() As Byte
bytes = System.Text.Encoding.Unicode.GetBytes(DllName)
Dim Retorno As Integer
LoadLibHandle = LoadLibraryA("kernel32.dll")
GetProcHandle = GetProcAddress(LoadLibHandle, "LoadLibraryA")
Retorno = CreateProcess(txtExeF.Text, vbNullString, vbNullString, vbNullString, vbNullString, PROCESS_CREATION_FLAG.CREATE_SUSPENDED, vbNullString, vbNullString, StartUp, ProcessInfo)
DllTam = Len(txtDllName.Text)
VirtualRet = VirtualAllocEx(ProcessInfo.hProcess, vbNullString, DllTam, MEM_COMMIT, PROCESS_ALL_ACCESS)
WriteProcessMemory(ProcessInfo.hProcess, VirtualRet, bytes, DllTam, vbNullString)
Try
CreateRemoteThread(ProcessInfo.hProcess, 0, 0, GetProcHandle, VirtualRet, 0, 0)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
ResumeThread(ProcessInfo.hProcess)
End Sub