My client asked me to write my own encrypted executable file to prevent an easy crack of the licensing system. Now I understand that this is a false sense of security, but despite this, he insisted on it.
So, I dug up my knowledge of portable executables and came up with this idea:
- Encrypt executable file
- Stick to this end of the bootloader executable along with its size
- Loader decrypts data
- It copies the code to the page allocated by VirtualAlloc, which has execute rights.
- He finds the entry point of the application
- Jumps over there, and we're all set.
I have a problem with jumping there. How can i do this? If I needed to set a pointer to a function, what would be the signature? Signature of loaded main () executable? Or do I need to resort to assembly?
I understand that it may be necessary to fix absolute addresses after downloading the code. How can I check if I need to and how to do it?
Edit: Working with windows and compiling with GCC. I can switch the Microsoft compiler if necessary.
Edit2: Clarify: I KNOW this is basically pointless. I believe this means any type of DRM. It depends on my client, and he still wants him, even though I warn him about it.
Thanks in advance.