If a program could program itself?.... (AI)

After thinking about this some more... a human could write a routine that over-writes a memory address leading to a crash, in this case the human has a finger and hits the reset button, the computer program running on the computer can't do that, unless it's somehow able to protect itself from any kind of crash, and after reading all these comments, it made me think and, it's the human drive to achieve something that's not been done before (or in some cases, has many many countless times) giving a program a self consciousness would be the difficult part :smiley: - because it could rewrite it's own memory space, it could search and explorer resources on the computer to 'find things to do' oh what's this new binary file? is it executable? what's in it, unless a computer develops the ability of a curiosity as we humans do, I can't quite see AI taking off..

but hypothetically speaking.. if it did? and someone managed to write a program that got hell bent on being better than any human and just to prove who's really the best it develops some kind of virus to teach us all a lesson how far could the thing go?