' Owner ™ Administrador.
Mensagens : 201 Line Pontos : 663 Agradecementos : -2 Data de inscrição : 28/02/2011
| Assunto: Criaando Injector! Qua Mar 16, 2011 9:27 pm | |
| Aii Vaii custei pra Fazer Mais ta aii: Lembrando in e Que Visual Basic 6
Vamos precisar de: 3 CommandButton 4 Label Um temporizador 2 TextBox Um controle Microsoft Common Dialog 6,0 Módulo 3 Opção 2
Vamos comecar: Nenhuma carga Formulário declarar o Código mês seguinte: Opção1 (0). Value = True Text2.Text carga = ("hProcess", "Box2") Verifique se Text2.Text = Então Text2.Text = "" Carga Text1.Text = ("DllPath", "Box1") Verifique se Text1.Text = Text1.Text Então = ""
Feito ISSO Vamos proceguir.
OS 2 ° Adicione CommandButton e de O Nome De:
Command1 = cmdInjetar Command2 = cmdprocurar Command3 cmdprocurar2 =
Agora Adicione o mês seguinte Código não "cmdInjetar"
Se Exename fazem = 1 então Prosh = GetHProcExe (Text2.Text) Se Prosh = 0 Then Label1.Caption = "Não consigo achar processo!": Exit Sub DllPath Text1.Text = InjectDll DllPath, Prosh Mais Prosh = FindProc (Text2.Text) Se Prosh = 0 Then Label1.Caption = "Não consigo achar processo!": Exit Sub DllPath Text1.Text = InjectDll DllPath, Prosh End If
Agora Adicione OS Seguintes Codigos não "cmdprocurar"
CommonDialog1.Filter "Pedido | *. exe" = CommonDialog1.ShowOpen Text2.Text CommonDialog1.FileTitle = Text2.SetFocus
Agora OS codigos não "cmdprocurar2"
CommonDialog1.Filter "Biblioteca | *. DLL" = CommonDialog1.ShowOpen Text1.Text = CommonDialog1.FileName Text1.SetFocus
Agora Adicione o Componente Microsoft Common Dialog Control pressionando CTRL + 6,0 T, e declarar o Segunte Código:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Conteúdo As String Dim As String Dim DllPath
Agora Feito ISSO UM Adicione Timer e ponhe o mês seguinte Código:
keyresult = GetAsyncKeyState (96) Se keyresult = -32767 seguida Se Exename fazem = 1 então Prosh = GetHProcExe (Text2.Text) Se Prosh = 0 Then Label1.Caption = "Não consigo achar processo!": Exit Sub DllPath Text1.Text = InjectDll DllPath, Prosh Mais Prosh = FindProc (Text2.Text) Se Prosh = 0 Then Label1.Caption = "Não consigo achar processo!": Exit Sub DllPath Text1.Text = InjectDll DllPath, Prosh End If End If
Agora Adicione como Label e de O Nome de nenhuma legenda e "Processo.EXE" DLL Patch "
Adicione OS 2 "Option" e parágrafo o "Option0" Mude o Nome do Pará Caption "Nome EXE" e ponhe o mês seguinte Código:
Option0_Click Private Sub (Índice As Integer) Selecione Index Case Case 0 Label4.Caption = "Nome do processo EXE:" Command3.Enabled = True Exename fazem 1 = Caso 1 Label4.Caption = "Nome da janela de processo" Command3.Enabled = False Exename fazem 2 = End Select End Sub
No "Opção1" de O Nome do parágrafo legenda "Nome da Janela" e adicione o Código Abaixo:
Option1_Click Private Sub (Índice As Integer) Selecione Index Case Case 0 Label4.Caption = "Nome do processo EXE:" Command3.Enabled = True Exename fazem 1 = Caso 1 Label4.Caption = "Nome da janela de processo" Command3.Enabled = False Exename fazem 2 = End Select End Sub
also in Código Declare ESSE Suá "Form"
Private Sub Form_Unload (Cancel As Integer) Chame Save ("hProcess", "Box2" Text2.Text) Chame Save ("DllPath", "Box1" Text1.Text) End Sub
Adicione Mais 2 Label e de o Nome do Pará legenda: "Situação da Injeção" e "Esperando ..."
Agora Adicione 3 Módulos e parágrafo renomeias:
Módulo1 DllInjector = Module2 = modGetHProcExe Module3 = SaveSets
OS Adicione seguintes codigos nenhum módulo "DllInjector"
'VB DLL Injector "Por RodrigoEviL
"Toda a merda que é preciso para fazer VB para injetar dlls ... Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Long, lpAddress As Any, ByVal dwSize As Long, ByVal fAllocType As Long, flProtect As Long) As Long Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long Private Declare Function CreateRemoteThread Lib "kernel32" (ByVal ProcessHandle As Long, lpThreadAttributes As Long, ByVal dwStackSize As Long, ByVal lpStartAddress As Any, ByVal lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long Público Prosh As Long
"A Função da injeção Função Pública InjectDll (DllPath As String, Prosh As Long) Dim DLLVirtLoc As Long, DllLength, injetar As Long LibAddress, As Long Dim CreateThread As Long, ThreadId As Long
'Passo 1 - A parte mais fácil ... Colocar a cadela no processo de "memória Form1.Label1.Caption = "Injetando ......" "Encontrar um local agradável para sua DLL para relaxar usando VirtualAllocEx DllLength = Len (DllPath) DLLVirtLoc = VirtualAllocEx (Prosh, ByVal 0 DllLength, ByVal, & H1000, e H4) Se DLLVirtLoc = 0 Then Form1.Label1.Caption = "VirtualAllocEx API falhou!": Exit Function "Injetar a Dll em que local Injectar WriteProcessMemory = (Prosh, DLLVirtLoc, ByVal DllPath, DllLength, vbNull) Se Injectar = 0 Form1.Label1.Caption Então = "Falha ao Escrever DLL para o Processo!" Form1.Label1.Caption = "Dll injetado ... Criando ....." Thread
"ETAPA 2 - Carregando-o no processo "Este é o local onde fica um pouco interessante .... "Só jogando nosso DLL no processo isn't vai fazer merda a menos que você 'Load-lo para o endereço de precessão usando LoadLibrary. A função LoadLibrary "Mapas módulo executável especificado para o espaço de endereço do 'Processo de chamada. Você chama LoadLibrary usando a CreateRemoteThread 'Criar uma thread (merda nenhuma) que funciona no espaço de endereço de outro processo. "Em primeiro lugar encontramos a função de API LoadLibrary e armazená-lo LibAddress = GetProcAddress (GetModuleHandle ("kernel32.dll"), "LoadLibraryA") Se LibAddress = 0 Then Form1.Label1.Caption = "Não foi possível encontrar a partir de API LoadLibrary kernel32.dll": Exit Function "Em seguida, a parte que o maldito me levou perto de duas horas para descobrir - usando CreateRemoteThread "Nós estabelecemos um ponteiro para LoadLibrary (LibAddress) em nosso processo, em seguida, coloca LoadLibrary 'Nossa DLL (DLLVirtLoc) para o endereço do processo. Bastante simples certo? CreateThread = CreateRemoteThread (Prosh, vbNull, 0, LibAddress, DLLVirtLoc, 0, ThreadId) Se CreateThread = 0 Form1.Label1.Caption Então = "Falha ao criar thead!" Form1.Label1.Caption = "injeção de DLL com sucesso!" End Function
No "modGetHProcExe" Module2 Adicione o Código:
"Eu não criou este módulo! Im no amor com quem nunca fez isso Public Const PROCESS_ALL_ACCESS As Long = & H1F0FFF
Option Explicit Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (Classname ByVal As String, ByVal WindowName As String) As Long Public Declare Function GetWindowThreadProcessID Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long Private Declare Function Process32First Lib "kernel32" (ByVal hSnapShot As Long, uProcess Como PROCESSENTRY32) As Long Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapShot As Long, uProcess Como PROCESSENTRY32) As Long Private Declare Sub CloseHandle Lib "kernel32" (ByVal hPass As Long)
Tipo Privado PROCESSENTRY32 dwSize As Long cntUsage As Long th32ProcessID As Long th32DefaultHeapID As Long th32ModuleID As Long cntThreads As Long th32ParentProcessID As Long pcPriClassBase As Long dwFlags As Long szExeFile As String * 260 End Type
Função Pública GetHProcExe (strExeName As String) As Long As Long Dim hSnap 'Criar um instantâneo de todos os processos e informações 'Sobre eles (salvando o punho para que possamos percorrer os Dos processos) hSnap CreateToolhelpSnapshot = (2, 0)
Dim peProcess Como PROCESSENTRY32 peProcess.dwSize = LenB (peProcess)
As Long Dim nProcess nProcess = Process32First (peProcess hSnap)
'Loop através dos processos até encontrarmos o que queremos E retornar o seu processo de lidar com Do While nProcess Se StrComp (Trim $ (peProcess.szExeFile), strExeName, vbTextCompare) _ = 0 Then GetHProcExe = OpenProcess (PROCESS_ALL_ACCESS, Falso peProcess.th32ProcessID) Exit Function End If peProcess.szExeFile = vbNullString nProcess = Process32Next (hSnap, peProcess) Loop hSnap CloseHandle End Function Função Pública FindProc (procName As String) As Long Dim hWnd As Long As Long Dim ProcessID As Long Dim ProcessHandle hWnd = FindWindow (vbNullString, procName) GetWindowThreadProcessID hwnd, ProcessID ProcessHandle OpenProcess = (PROCESS_ALL_ACCESS, Falso ProcessID) FindProc ProcessHandle = End Function
Não module3 "SaveSets" Adicione:
Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lsString As Any, ByVal lplFilename As String) As Long Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Verifique Pública As String
Função Pública de Carga (Seção como String, Key As String) As String As Long Dim lngResult strFileName Dim Dim strResult As String * 300 App.Path strFileName = & "sets.ini \" lngResult = GetPrivateProfileString (Seção, Chave, strResult strFileName, Len (strResult), strFileName) Check = App.Path & "sets.ini \" Carga = Trim (strResult) End Function
Função Pública Save (Seção como String, Key As String, Conteúdo As String) As Long Dim lngResult strFileName Dim App.Path strFileName = & "sets.ini \" lngResult = WritePrivateProfileString (Seção, Chave, strFileName Content ) End Function | |
|