How to Resolve ERROR_NOACCESS (0x3E6) When Injecting Assembly Code into a PE File Using CreateThread

I encountered an issue when injecting my assembly program asm.txt into a portable executable file to run a keylogger using CreateThread. CreateThread was failing with the error code 0x3E6 (ERROR_NOACCESS).
I've been suspecting it could be stack issues, memory protection issue, or me passing the wrong parameters to CreateThread, but I haven't been able to pinpoint the exact cause.
Where is the error in my assembly code? How can I resolve the ERROR_NOACCESS error and successfully create the thread to run my keylogger in the injected PE file?
file0.jpg
file1.jpg
file2.jpg
Was this page helpful?