Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I think you should consider the GetThreadContext, get the important values or registers, use SetThreadContext to set the values then ResumeThread by assigning the address to EIP.. Copying the stack might not work.
Why do you need to change an specific byte (JE) without knowing what could happen in both ways? The application might have a CRC Checking to determine if it is modified.
Im sorry for not adding the further explanation in the screenshot, I just want to show you that the OpenProcess in kernel32.dll is actually points to the OpenProcess of kernelbase.dll that calls the NtOpenProcess.