Posted November 22, 20168 yr i create a loader in vb6 and it work but in purebasic not working this in vb6 Dim ProcExecS As Long ProcExecS = CreateProcess("File.exe", ByVal 0&, ByVal 0&, ByVal 0&, 1&, NORMAL_PRIORITY_CLASS, ByVal 0&, sNull, sInfo, pInfo) If ProcExecS Then WriteProcessMemory pInfo.hProcess, &H47DBF4, &HEB19, 2, 0& WriteProcessMemory pInfo.hProcess, &H47DBF4 + 2, &H9090, 2, 0& WriteProcessMemory pInfo.hProcess, &H47DBF4 + 4, &H9090, 2, 0& CloseHandle pInfo.hProcess End If this in PB ProcExecS = CreateProcess_("File.exe", $0, #NUL, #NUL, #False, NORMAL_PRIORITY_CLASS, #NUL, #NUL, @StartInfo, @ProcessInfo) If ProcExecS WriteProcessMemory_(ProcessInfo\hProcess, $47DBF4, $EB19, 2, $0) WriteProcessMemory_(ProcessInfo\hProcess, $47DBF4 + 2, $9090, 2, $0) WriteProcessMemory_(ProcessInfo\hProcess, $47DBF4 + 4, $9090, 2, $0) CloseHandle_(ProcessInfo\hProcess) EndIf
November 22, 20168 yr Not much to work off from your code snippet. Are you sure you have write access? ProcessInfo.PROCESS_INFORMATION StartInfo.STARTUPINFO If CreateProcess_("C:\upx.exe", #Null, #Null, #Null, #False, #CREATE_SUSPENDED, #Null, #Null, @StartInfo, @ProcessInfo) If ReadProcessMemory_(ProcessInfo\hProcess, $400000, @lpBuffer1.w, 2, #Null) If WriteProcessMemory_(ProcessInfo\hProcess, $410000, @lpBuffer1.w, 2, #Null) ; Verify we have written the read bytes to the destination address... If ReadProcessMemory_(ProcessInfo\hProcess, $410000, @lpBuffer2.w, 2, #Null) Debug "Read Bytes : $" + lpBuffer1 Debug "Write Bytes : $" + lpBuffer2 EndIf EndIf EndIf If lpBuffer2 ResumeThread_(ProcessInfo\hThread) Else TerminateProcess_(ProcessInfo\hProcess, #Null) EndIf CloseHandle_(ProcessInfo\hProcess) EndIf Ted.
Create an account or sign in to comment