title: C++ execute function from memory
body: <p>I recently thought about precompilable scripting language, which would be translated to machine code during program loading.</p>
  
  <p>Lets say that I can generate this binary function myself. Now I need to somehow execute it. The general scheme would look like that:</p>
  
  <pre><code>char* binary = compile("script.sc");
  pushArgsToStack(1,7);
  memexec(binary);
  int ret = getEax();
  </code></pre>
  
  <p>Is there any chance to get it working?</p>
  
  <p>Also, would calling jmp to c++ funcion address work like planned? I mean, after pushing args, returnAddr and so on, I want to somehow call that function from my compiled script.</p>
  
  <p>Thanks for any answers</p>