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
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
pszLibFileRemote = "Hack.dll"
pszLibFileRemote = Application.StartupPath & "\" & "Hack.dll"
pszLibFileRemote = My.Resources.Hack_dll

Dim extractpath As String = appdata & "Hack.dll"
Dim extractpath As String = appdata & "\Hack.dll"
pszLibFileRemote = "Hack.dll"
pszLibFileRemote = Environment.SpecialFolder.ApplicationData & "\Hack.dll"
pszLibFileRemote = System.Text.Encoding.ASCII.GetString(My.Resources.Hack)
IO.File.WriteAllBytes("Hack.dll", My.Resources.Hack)
Dim TargetProcess As Process() = Process.GetProcessesByName("HSUpdate")
If TargetProcess.Length = 0 Then
Me.Label1.Text = ("Waiting for PROCESS.exe")
Else
Timer1.Stop()
Me.Label1.Text = "Done..."
Call Inject()
End If
End Sub

Private pszLibFileRemote As String