Dalla documentazione MSDN per OpenProcess
dwDesiredAccess [in]
The access to the process object. This access right is checked against
the security descriptor for the process. This parameter can be
one or more of the process access rights.
If the caller has enabled the SeDebugPrivilege privilege, the
requested access is granted regardless of the contents of the security
descriptor.
E poi se guardi l'accesso al processo diritti documentazione vedrai che uno dei diritti di accesso che puoi richiedere è PROCESS_VM_WRITE
che è necessario per chiamare WriteProcessMemory
.
Sempre dalla documentazione MSDN per CreateRemoteThread
A common use of this function is to inject a thread into a process
that is being debugged to issue a break. However, this use is not
recommended, because the extra thread is confusing to the person
debugging the application and there are several side effects to using
this technique:
It converts single-threaded applications into multithreaded applications.
It changes the timing and memory layout of the process.
It results in a call to the entry point of each DLL in the process.
Another common use of this function is to inject a thread into a
process to query heap or other process information. This can cause the
same side effects mentioned in the previous paragraph. Also, the
application can deadlock if the thread attempts to obtain ownership of
locks that another thread is using.
Anche se la documentazione raccomanda contro di essa. Ho visto più spesso CreateRemoteThread
utilizzato nei debugger o in altri tipi di applicazioni di profiling / api logging.