Somewhat related, I am curious if anybody knows how power packer and similar crunchers work. From what I understand, they compress an executable and attach the compressed binary to program that decompresses and then *executes* the decompressed contents.
There are clearly several things happening here, but ultimately, the code from the cruncher needs to kick off the uncompressed binary. Since the compressed executable contents are attached to the decompressor binary, it would make sense that the binary needs to read itself and extract some code to memory.
My question is how does one execute arbitrary binary from within one's program.