code

How can i produce a small peace of code and execute it at _run time_?
Is it possible at all?
But i think it must be possible. Assembler compiler do nearly the same thing i think.

Thanx for answers!

Comments

  • : How can i produce a small peace of code and execute it at _run time_?
    : Is it possible at all?
    : But i think it must be possible. Assembler compiler do nearly the
    : same thing i think.
    I think what you are referring to is doing something similar to a JIT compiler. I've seen the source for one (in C) and it's scary. :-D

    Try having a look around for one of those anyway. They seemed to be creating the code in memory somewhere, then moving the current program counter for that particular proccess to the start of there, where the generated machine code was.

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • Thank you.

    Yes its scary :-D.
    Ill try to find what im searching for. But its not easy. The code is poorly documented. Perhaps i find a better JIT.
  • : Thank you.
    :
    : Yes its scary :-D.
    : Ill try to find what im searching for. But its not easy. The code
    : is poorly documented. Perhaps i find a better JIT.
    The code in Parrot (runtime engine) is fairly well documented, I just haven't looked over it too greatly (I only put various casts in place so that it would compile in Win32 without giving out over 2500 warnings!) Take a look at:-

    http://www.parrotcode.org/

    There is a document somewhere that describes how it all works.

    Hope this helps,

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories