C# code to use CreateThread to run position independent code in the running process. This code is provided AS IS, and will not be supported.
Binary to encrypt PIC using a sample key.
.\XOREncrypt.exe path\to\pic.bin
Binary to run encrypted PIC from the XOREncrypt binary using CreateThread. To use, must embed encrypted.bin as a resource file in the project and select "Embedded Resource" as the build action.
.\CreateThreadExample.bin