enter.exe
Code: Select all
#PROCESS_VM_OPERATION = $8
#PROCESS_VM_READ = $10
#PROCESS_VM_WRITE = $20
#PAGE_READWRITE = $4
#MEM_COMMIT = $1000
Procedure FindPID(process.s)
For i=1 To 2000
If FindString(LCase(GetProcessName(i)),process,0)>0
Break
EndIf
Next
ProcedureReturn i
EndProcedure
hProcess=OpenProcess_(#PROCESS_CREATE_THREAD | #PROCESS_VM_OPERATION | #PROCESS_VM_WRITE,#False,FindPID("taskmgr.exe"))
dllfilename.s="E:\LibraryDesigner\test.dll"
dllsize.l=Len(dllfilename)+1
lpbuf=VirtualAllocEx_(hProcess,#Null,dllsize,#MEM_COMMIT,#PAGE_READWRITE)
myreturn=WriteProcessMemory_(hProcess,lpbuf,dllfilename,dllsize,temp)
pFunc=GetProcAddress_(LoadLibrary_("kernel32.dll"),"LoadLibraryA")
myresult=CreateRemoteThread_(hProcess,#Null,0,pFunc,lpbuf,0,temp32)
CloseHandle_(myresult)
CloseHandle_(hProcess)
test.dll
Code: Select all
ProcedureDLL AttachProcess(Instance)
OpenWindow(1, 257, 0, 600, 300, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar ,PeekS(GetCommandLine_()))
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
EndProcedure
when I use loop keywords To wait the messages
The target Process (taskmgr.exe) will be uncontrol
How can I write the code with loop keywords?
I turn the code from C++,thanks For correct
