• Yes you can!
    A simple compiled JavaScript function:

    function foo() {
      "compiled";
      console.log("hello world");
      return 0;
    }
    
    foo();
    
    /* Using up arrow several times in left pane one finds the code below
    var foo=E.nativeCall(1,'JsVar()',atob('Len/Q­R1IGUt4RJhHBK5G+AQNB0YaSEzy/WN4RJhHFEuAR­phHBUYTTEBGoEcVSShGeUQAIkz2eTOYRwAhASMqR­o3oSAALRk3yDVaARrBHBkZARqBHKEagRzhGoEcwR­qBHBUsAIJhHBLC96PCBsbACAHU9AQChqwIAhS8BA­HwAAAB2AAAAaAAAAGhlbGxvIHdvcmxkAGNvbnNvb­GUAbG9nAA=='));
    */
    

    Run the program and use the up arrow in the left pane a couple of times to get the native call string.
    Using that string one can load it as thumb code in spare memory and call it.

    fooHelloThmbcode.js

    //used foohello.js to get the string
    /* Using up arrow several times in left pane one finds the code below
    var foo=E.nativeCall(1,'JsVar()',atob('Len/Q­R1IGUt4RJhHBK5G+AQNB0YaSEzy/WN4RJhHFEuAR­phHBUYTTEBGoEcVSShGeUQAIkz2eTOYRwAhASMqR­o3oSAALRk3yDVaARrBHBkZARqBHKEagRzhGoEcwR­qBHBUsAIJhHBLC96PCBsbACAHU9AQChqwIAhS8BA­HwAAAB2AAAAaAAAAGhlbGxvIHdvcmxkAGNvbnNvb­GUAbG9nAA=='));
    */
    
    
    var data = atob('Len/QR1IGUt4RJhHBK5G+AQNB0YaSEzy/W­N4RJhHFEuARphHBUYTTEBGoEcVSShGeUQAIkz2eT­OYRwAhASMqRo3oSAALRk3yDVaARrBHBkZARqBHKE­agRzhGoEcwRqBHBUsAIJhHBLC96PCBsbACAHU9AQ­ChqwIAhS8BAHwAAAB2AAAAaAAAAGhlbGxvIHdvcm­xkAGNvbnNvbGUAbG9nAA==');
    
    
    //var addr = process.memory().stackEndAddress-data.le­ngth;
    var addr = process.memory().stackEndAddress;
    for(var i=0;i<data.length;i++){
    poke8(addr+i,data.charCodeAt(i));
    console.log((addr+i).toString(16)+","+pe­ek8(addr+i).toString(16));
    }
    
    addr++;
    
    var foo= E.nativeCall(addr, 'JsVar()');
    
    foo();
    foo();
    

    and the output

    20009bda,67
    20009bdb,0
    hello world
    =undefined
    >echo(1)
    =undefined
    >foo();
    hello world
    =0
    >foo();
    hello world
    =0
    >foo();
    hello world
    =0
    >foo();
    hello world
    =0
    > 
    

    2 Attachments

About