RE: A83: Self Executing Programs


[Prev][Next][Index][Thread]

RE: A83: Self Executing Programs





--- Sebastiaan Roodenburg <sebastiaan@rimsystems.nl>
wrote:
> I've tried a few things...
> first i tried:
> 
> --- prgmB
> :prmgB
> ---
> and this worked "fine" (got a "Memory" error after a
> while)

Yes ofcourse this would work.  And the memory leak
comes from doing an infinite loop basically :)

> 
> then i tried to exec prgmA from the tios
> ("Send(9prgmA"), and i got an
> syntax-error...

This ofcourse would happen since, the last tokens are
not End:0000:End for one thing.  
> 
> I think that unsquished asmprograms cannot contain
> tokens other than 0..F
> 

Not quite true but I will get to that.

Now that I look at the source for _exec_assembly, I
can see that it has to have a 0-F, they loop through
the *whole* program and check.  But actually, I found
a flaw in _exec_assembly.  They don't actaully check
the whole program.  If you look at the source closely,
you can see that they assume too much.  They check the
last 8 bytes to make sure they are End:####:End (: =
Enter, #=any number), then they start from the
beginning, check the tokens to make sure they are good
0-F tokens, once they hit a Enter and a End, they
assume that this is the first END so they say that the
program is good.  Then they use the next 4 bytes to
add extra data at the end of they file.  So in
actuality you could play by their rules, throw a
little useless data in there, and it will still run
the program.  By doing this...

C9
End
0000
THIS IS USELESS GARBAGE THAT GETS PAST THE CHECKER
End
0000
End

Now I haven't found a way to exploit this to make it
execute itself, but the night is young.  Putting stuff
here is realitively harmless since it is not copied
before it is ran, but I believe it might have its
uses.  Some sort of protection?   High Scores?  Who
knows...

But it might be good for a storage space.  Since it is
not copied when it is ran, it should take less ram to
actually run your program.  You just have to get the
address for the data manually. (Or so I believe)

Well it isnt the self executor that I wanted (damn End
screws up its chances for basic) but I might be able
to find some uses for it.

This is yet another bloated piece of code.  There are
several ways to make this smaller and more secure at
the same time.

Let me know if you have any thoughts on the subject. 
Now on to my other (better) ideas.

Jimmy Conner

=====
»»»»»»»»»»»»»»»«««««««««««««««
»      TIMagic@goatse.cx     «
»  http://www.zed80asm.org   «
» http://www.timagic.cjb.net «
»»»»»»»»»»»»»»»«««««««««««««««

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/