So based on this question and its answer :
Why can't you set the instruction pointer directly?
I always thought you cannot change the eip or rip of your process or another process
but when reading this source code from Metasploit framework :
https://github.com/rapid7/metasploit-framework/blob/master/data/templates/src/pe/dll/template.c
on line 66 and 68 its setting up the eip or rip of its child process :
ctx.Rip = (DWORD64)ep;
but i thought you cannot even change the IP of your own process let alone another process
so am i missing something here?
are we allowed to change the IP of our process and other processes or not? and if so, what is the limit, which processes can we change and which we can't? can we change our own process's IP using something like ctx.RIP or even another process which is not our child?