Problem:
run a non-trivial c program stored on the heap or data section of another c program as asm instructions.
My progress:
Ran a set of simple instructions that print something to stdout. The instructions are stored on the heap and I allowed the page containing the instructions to be executed and then calling into the raw data as though it was a function. This worked fine.
Next up, I want given any statically linked c program, to just read it's binary and be able to run it's main function while it is in memory from another c program.
I believe the issues are: * jumping to where the main function code is * changing the binary file's addresses which were created when linking so they are relative to where the code lies now in memory
Please let me know if my approach is good or whether I missed something important and what is the best way to go about it.
Thank you