A VB Question

Posts 1–6 of 6 · Page 1 of 1
A VB Question
The tradicional way to writeprocess is using api(kernel32), is there other way to writeprocess?



ThankFull
Whats wrong with traditional one?
Im trying to use the module to crate a trainer for Warrock and Gunbound(two in one), the game hide the process,i can get the pid, but i cant get the phandle(processhandle), i need other code to get phandle, or i new way to writerprocess, write from the pid and not from the Phandle.

now i use this code to get phandle
(phandle = openprocess(PROCESS_ALL_ACESS,False, pid)
but when the process hide, i cant get more.

Thankfull
I'm not 100% what you mean but you could try to modify this so it would serve your needs. I haven't tried it myself but here you go

Declare API's
[php]
Option Explicit

Const SYNCHRONIZE = &H100000
Const INFINITE = &HFFFF 'Wait forever
Const WAIT_OBJECT_0 = 0 'The state of the specified object is signaled.
Const WAIT_TIMEOUT = &H102 'The time-out interval elapsed, and the object’s state is nonsignaled.

Private Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) _
As Long
Private Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) _
As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) _
As Long

Dim ProcessID As Long
Dim hProcess As Long
[/php]

Example of a function that executes a command:

[php]
Function ShellWait(CommandLine As String, _
TimeOut As Long, _
WindowState As VbAppWinStyle) As Boolean

Dim ProcessID As Long
Dim hProcess As Long

ProcessID = Shell(CommandLine,WindowState)
If ProcessID <> 0 Then
'non-zero (True) so Shell worked
' Get a process handle for the PID (Wait takes a handle)
hProcess = OpenProcess(SYNCHRONIZE, False, ProcessID)
If hProcess <> 0 Then
' Got process handle
' Wait until process finishes before going on
If WaitForSingleObject(hProcess, TimeOut) = WAIT_OBJECT_0 Then
ShellWait = True
Else
ShellWait = False
End If
Else
'Failed to get process handle.
'Perhaps the process terminated very quickly
'or it might not really have executed at all even though Windows
' started a process.
ShellWait = False
End If
Else
' PID zero (False) so Shell failed
ShellWait = False
End If
End Function
[/php]

Call it:
[php]
If ShellWait("warrock.exe") then

Else

End If
[/php]

As I said, it may not be any help but it's worth of trying (I guess)
Im doing a trainer for warrock and gunbound, The tradicional way to writeprocessmem is from the hprocess, but i cant get the hprocess because the process hide nad the hprocess became 0 , i just need a code that get the hprocess of the hidden process,or another code to writeprocessmem the traditional doesn't work

the code that i use is:

hprocess = OPENPROCESS(PROCESS_ALL_ACESS, false,pid)
writeprocessmem hprocess,adress,valbuffer

it doesn't work


And , There is an error in your code
Is there anyway?
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us