Another automated framework approach involves tools like pe2shc (PE to Shellcode). This approach modifies the executable itself so that the very beginning of the file contains a small piece of valid redirector shellcode, making the file structurally both a valid PE file and valid raw shellcode.
The stub supports relocations, imports, and TLS callbacks. However, not every PE can be successfully converted—exceptions, delay-load imports, and MUI-dependent files may cause failures. convert exe to shellcode
Further reading (tools to search)