I am trying to malloc some heap space (size of the file bytes) and copy the contents of a binary file into the allocated memory. Once the binary is copied, I would like to execute that piece of code.
So as a part of this, I tried to write some assembly code to jump to that location(virt address returned from malloc). I am facing a seg fault, I am not sure is this the correct way to do it??
can someone help me in this scenario?
any help/pointers is appreciated! P.S: I don't want to do exec calls to run those binaries.