Script Language Threading

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

Iam writing an assembler for some sort of Script language. Now I want to
create some sort of sandbox for the script, meaning that it runs for some
time, and if it doesn't terminate on its own, its supposed to be terminated
from outside.
My idea was to have a Thread do this:
-Receive some pointer to the program in memory
-Perform a Far Jump ( using push adr; ret; } to the adress
-When the Script finished, signal this with a SetEvent call

Now the observing Thread waits X ms for this Event to be signaled, if it
gets signaled, it should restart the thread with another script. If it
doesnt get signaled, restart as well.

Now simply restarting the thread would be kinda easy. Since I dont want to
take the performance hit of recreating the thread for each script, I thought
of some other way to reset the Thread.

The idea was that after the Signaling of the event, go into some while(1);
loop, and wait for the other observer Thread to suspend it. Then set the EIP
Register of the Worker Thread to the start again, write a new program to the
memory and resume the thread. The problem with this is that sometimes the
thread gets suspended while its still inside SetEvent. Writing a new EIP
does in that case destroy the stack etc. and cause an exception.

Now basically what I need is some method to synchronize the threads without
Win32 commands, or a better method to achieve what I want :-)

Btw: Iam fully aware this is not portable, secure or anything.

Thanks alot in advance


.



Relevant Pages

  • Re: Linux script to identify visitors to my website
    ... does anyone have a Linux script or bash one-liner that would sort ... I am more interested in people who find my website without a search ... all with the referer set to nothing. ...
    (comp.os.linux.misc)
  • Re: Linux script to identify visitors to my website
    ... does anyone have a Linux script or bash one-liner that would sort ... I am more interested in people who find my website without a search ... all with the referer set to nothing. ...
    (comp.os.linux.misc)
  • Love And Monsters - some spoilers
    ... apart from the final chase and showdown with the Absorbaloff I'd ... that's when you get the sort of extremism and anti-fun that I've been ... represent the scary bits with off-screen screams, ... 8/10 but more for the script than the on-screen result. ...
    (rec.arts.drwho)
  • Love And Monsters - some spoilers
    ... apart from the final chase and showdown with the Absorbaloff I'd ... that's when you get the sort of extremism and anti-fun that I've been ... represent the scary bits with off-screen screams, ... 8/10 but more for the script than the on-screen result. ...
    (rec.arts.drwho.moderated)
  • Re: Love And Monsters - some spoilers
    ... apart from the final chase and showdown with the Absorbaloff I'd ... that's when you get the sort of extremism and anti-fun that I've been ... represent the scary bits with off-screen screams, ... 8/10 but more for the script than the on-screen result. ...
    (rec.arts.drwho)