[Help] Loader don't Inject
My Code:
Code:
Private Sub Inject()
On Error GoTo 1
Timer1.Stop()
Dim TargetProcess As Process() = Process.GetProcessesByName("Engine")
TargetProcessHandle = OpenProcess(PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, False, TargetProcess(0).Id)
pfnStartAddr = GetProcAddress(GetModuleHandle("Kernel32"), "LoadLibraryA")
pszLibFileRemote = "Hack.dll"
TargetBufferSize = 1 + Len(pszLibFileRemote)
Dim Rtn As Integer
Dim LoadLibParamAdr As Integer
LoadLibParamAdr = VirtualAllocEx(TargetProcessHandle, 0, TargetBufferSize, MEM_COMMIT, PAGE_READWRITE)
Rtn = WriteProcessMemory(TargetProcessHandle, LoadLibParamAdr, pszLibFileRemote, TargetBufferSize, 0)
CreateRemoteThread(TargetProcessHandle, 0, 0, pfnStartAddr, LoadLibParamAdr, 0, 0)
CloseHandle(TargetProcessHandle)
1: Me.Close()
End Sub
Code:
Dim appdata As String = Environment.SpecialFolder.ApplicationData
Dim extractpath As String = appdata & "Hack.dll"
IO.File.WriteAllBytes(extractpath, My.Resources.Hack)
If System.IO.File.Exists(extractpath) = True Then
Dim TargetProcess As Process() = Process.GetProcessesByName("Engine")
If TargetProcess.Length = 0 Then
Me.Label1.Text = ("Waiting for PROCESS.exe")
Else
Timer1.Stop()
Me.Label1.Text = "Done..."
Call Inject()
End If
Else
Me.Label1.Text = ("" + ExeName + ".dll not found")
End If
End Sub
PS: Hack.dll in Resources!
But don't Injet...
How does your Inject code even inject the DLL when there is no full path or anything there, just 'Hack.dll'?
Learn to code before copying and pasting. If you observe your code properly you can see that it extracts to ApplicationData!
master, putting "Hack.dll" will simply make the application look for a file named "Hack.dll" in the startup path.
@ topic. If you have the .dll in resources simply do this:
[highlight=vb.net]
IO.File.WriteAllBytes("Hack.dll", My.Resources.Hack)
[/highlight]
THEN call Inject()
Read my post Goku. The pszLibFileRemote is the location so change you code to this:
[highlight=vb.net]
IO.File.WriteAllBytes("hack.dll", My.Resources.Hack)
pszLibFileRemote = "hack.dll"
[/highlight]
pl0x l2vb before leeching injectors.