Jump to content

Another reason to switch to XP instead of Win9x


Zxian

Recommended Posts

Hey everyone,

In class yesterday, we were going over operating systems in my computer science class, and the prof put up some code that would cause a Win9x computer to crash and burn, while a Win2K or XP computer would simply throw an error at you.

while(1) { *( (char *) random() ) = 62; }

The code is in C. For those of you who don't understand what it's doing, is...

while(1) = loop forever

random() = generates a random number between 0 and 2^31-1

(char *) random() = tells the program that the random number is now an address in memory.

*( (char *) random() ) = 62;

===> Finds that address in memory and stores the 8-bit representation of 62 there.

No compiler or anti-virus program would catch this problem, ever...

Link to comment
Share on other sites


But isn't a virus bad code? Chernoble (sp?) from what I have read would take your computer running Win95 and zero it out completely, including your bios.

All someone who writes code for an OS can do is try to get the OS to catch and stop mistakes. If the OS ever gets to the point where it can catch all mistakes, it will probably start writing itself with no help from us. Addapt to us. You start to play a game and the OS recognizes that it is not optimally configured, a mistake, and makes adjustments.

Just talking.

DL

Link to comment
Share on other sites

If the OS ever gets to the point where it can catch all mistakes, it will probably start writing itself with no help from us.

The only problem here is that you're starting to talk about AI, and I don't think that any company is ready to start deveolping that. Just look at all the movies with that theme. They're there for a reason. Asimov imagined that type of thing happening 50 years ago...

Oh, and yeah, it's just stupid code, but a good example of what a good OS should be able to deal with. The UNIX machines that we have in the computer labs at UBC have been able to deal with that type of code for years... :P

And un4given1, just because no anti-virus program would ever catch "del C:\ /s /q /f" doesn't mean that it's not harmful. A virus could be as simple as that... to simply delete vital files and cripple the OS, or corrupt the memory as in my example.

Link to comment
Share on other sites

No compiler or anti-virus program would catch this problem, ever...

i did tried simillar code few years ago in lab.... changing a value in memory location directly.

While McAfee and Norton were not able to catch it, AntiViru Personal Edition (Free Antivirus.. may be some typo in name ;) ) catch the code and gave an error of virus like code

After that i used that antivirus to check my C code for accessing memory that is not declared. ;)

Link to comment
Share on other sites

How to crash win98 - (Note: this is not illegal in any way)

It is not difficult to crash windows 98. You could do this in win95 as well.

Make sure no open files or important apps are running, close all windows.

Run command.exe

type DEBUG to start the debugging utility that came with DOS

The C prompt now becomes a hyphen.

at the hyphen, key in he following line

- f 0:0 ffff 0

Press <Enter> and your screen will go haywire and computer hangs. You will have to do a restart manually to get back to booting windows again.

What has happened is you filled the first megabyte of your memory with zeroes (thereby "kicking" the OS kernel) which should not really have happened if the VMM was monitoring what was done.

Today windows 98 is mostly being used in commercial, public-access PCs (like in internet access centres). I happen to know some people who go to those places and put the the above in a batch-file, compile it to EXE and get task scheduler to run it every 60 minutes. Its not a surprise that within a week the owner wants to upgrade to a newer version (giving up win98 for good) - and these guys get good money to do the upgrade. :P

Post the above info everywhere you want - spread the gospel. :lol:

Crap, if nothing else, atleast the above should scare you (I mean, any win98 lover) to move to win2k/XP.

Link to comment
Share on other sites

How to crash win98 -  (Note: this is not illegal in any way)

It is not difficult to crash windows 98.  You could do this in win95 as well.

Make sure no open files or important apps are running, close all windows.

Run command.exe

type DEBUG to start the debugging utility that came with DOS

The C prompt now becomes a hyphen.

at the hyphen, key in he following line

- f 0:0 ffff 0

Press <Enter> and your screen will go haywire and computer hangs. You will have to do a restart manually to get back to booting windows again.

What has happened is you filled the first megabyte of your memory with zeroes (thereby "kicking" the OS kernel) which should not really have happened if the VMM was monitoring what was done.

Today windows 98 is mostly being used in commercial, public-access PCs (like in internet access centres). I happen to know some people who go to those places and put the the above in a batch-file, compile it to EXE and get task scheduler to run it every 60 minutes. Its not a surprise that within a week the owner wants to upgrade to a newer version (giving up win98 for good) - and these guys get good money to do the upgrade. :P

Post the above info everywhere you want - spread the gospel. :lol:

Crap, if nothing else, atleast the above should scare you (I mean, any win98 lover) to move to win2k/XP.

Thts a good piece of knowledge prathapml..I didnt know it was that simple!

Link to comment
Share on other sites

Thts a good piece of knowledge prathapml..I didnt know it was that simple!
hehe, another piece then...

quote as less as you can - or avoid quoting if possible. While quoting dlete all lines and keep only the exact part you're responding to. When you're replying to the last post in a thread, its almost unnecessary to quote the post just above yours.

(no offense meant, this is just to keep the forum tidy)

MSFN - Where People Go to Know! B)

Link to comment
Share on other sites

That's pretty hilarious...

It's just really funny to see stuff like this happen. I guess this is why the computers at my university are all UNIX based, since when they got the computers, Win98 couldn't handle situations like these.

It's just really funny to see stupid code like this...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...