Home-made Annoying Apps
thematrixeatsyou

Feel free to send in some code that may turn out to be annoying. Please, ONLY test them on yourself or on people who you KNOW can crack a joke or people who you tell what it is.

I'll start with an app that gives you a low-friction mouse:

1#include <stdio.h> // is this needed?
2#include <windows.h> // this is
3#include <time.h> // is this needed for the sleep() function to work?
4 
5POINT woo;
6 
7int main(void){
8 long x,y,nx,ny,xs=0,ys=0;
9 GetCursorPos(&woo);
10 x=woo.x;
11 y=woo.y;
12 while(1){
13 GetCursorPos(&woo);
14 nx=woo.x;ny=woo.y;
15 if(nx!=x || ny!=y){
16 xs+=nx-x;
17 ys+=ny-y;
18 }
19 x=nx;y=ny;
20 x+=xs;y+=ys;
21 SetCursorPos(x,y);
22 xs=xs/1.2;ys=ys/1.2;
23 sleep(1);
24 }
25 return 0;
26}

Billybob
<script>
while(1) alert(1);
</script>

LennyLen
Quote:

#include <stdio.h> // is this needed?

Why don't you just remove the line and find out for yourself? ;)

Quote:

#include <time.h> // is this needed for the sleep() function to work?

I alwys thought sleep() was declared in unistd.h.

Dennis

int main(){int*eat_mem=NULL;while(1){eat_mem=new int[256000];eat_mem=NULL;}}

Marcello

Why set it to null?

Billybob

To annoy you.

Archon

Don't post those else you'll breed script-kiddies...

miran

@thematrixeatsyou: Doesn't compile.

Simon Parzer

Nasty Windows NT batch files!

rem -- Gets rid of the paper inside your printer
@echo off
:endless
  echo "This is an empty page!" >prn
goto endless

rem -- Network overkill
@echo off
:e
  net send * "Hello" >nul
goto e

rem -- Will open >100 Internet Explorers
@echo off
:e
  start iexplore.exe "http://www.porno.com"
goto e

BAF

matrixdude: use Sleep instead of sleep which is in the windows API.

Evert

I'll give you something that'll nuke your computer if you haven't taken proper precaution (possibly doesn't work on Windows though):

#include <unistd.h>
#include <stdio.h>

int main(void)
{
   while(fork()) printf ("Goodbye, Cruel World!\n");
}

Can't really think of anything else at the moment...

Onewing
void draw_screen(BITMAP *bBuffer)
{
    // Initiate seizure-procedure
    rectfill(screen, 0, 0, screen->w, screen->h, makecol(255,255,255));
    draw_sprite(screen, bBuffer, 0, 0);
}

Arthur Kalliokoski
Quote:

rem -- Gets rid of the paper inside your printer
@echo off
:endless
echo "This is an empty page!" >prn
goto endless

The IBM version:

echo "This page intentionally left blank"

Peter Hull

It's not an app, but if you sneak on someone's PC, open an explorer window, make a screenshot and set that as their wallpaper, you will annoy them for ages as they try to close a window that doesn't exist.

Pete

[edit] Does anyone remember, there used to be a little snippet of HTML that would crash IE, which meant that you couldn't even browse to it because the act of generating the thumbnail would bring down Explorer with it.

[edit2]
Here's the Windows equivalent of Evert's program ;)

#include <stdio.h>

int main(void)
{
   printf ("Goodbye, Cruel World!\n");
}

OICW

I used this program when my class-mates spammed the network on CS class.

#include <stdlib.h>

int main(){
  while(1)
    system("net send blah This is a spam!");
}

jhuuskon

Back in the day when monitors didn't have that fade in when changing mode, you could blow a monitor with five assembly instructions. I did it once at school. Got new monitors to the school that way. :)

mov ax,13h
int 10
mov ax, 3h
int 10
repeat previous steps

OICW

It could be good to post explanation what it does to those who don't know assembly. It seems that you were bad boy at school ;)

Pedro Avelar Gontijo
int main ()
{
 somefunc_to_takeover_the_keyboard ();
 while (1)
 {
  sleep (1);
 }
 return 1289741;
}

Matthew Leverton
Quote:

It's not an app, but if you sneak on someone's PC, open an explorer window, make a screenshot and set that as their wallpaper, you will annoy them for ages as they try to close a window that doesn't exist.

;D I did that to someone. I took a screenshot of the desktop and hid all his icons and the taskbar. When he came back from break, I heard him from the other side of the cubicle, cursing at his computer. After a reboot failed to "fix" the problem, he called me over, but of course I didn't know what was going on. ;)

Jakub Wasilewski
Quote:

you could blow a monitor

Now, that is what classifies as annoying :).

Quote:

It could be good to post explanation what it does to those who don't know assembly. It seems that you were bad boy at school ;)

It switches the monitor between graphic modes as fast as possible - or in case of the older monitors without safeguards, faster than possible ;).

CGamesPlay

Or play Solitaire until there's one move until you win, and then take a screenshot and set that as the desktop :)

Onewing
Quote:

It's not an app, but if you sneak on someone's PC, open an explorer window, make a screenshot and set that as their wallpaper, you will annoy them for ages as they try to close a window that doesn't exist.

I can't wait till April Fool's day. ;D

Samuel Henderson

If supported, you can make the desktop wallpaper switch even more confusing by switching the view angle from 0 to 90 (fipped sideways). That depends on if the video card supports it.

We did that to someone. We took a screenshot of his desktop, switched the viewing angle to 180, went into paint and rotated the screenshot so it looked like his normal desktop, we then hid the taskbar and cleared the icons off his desktop and locked his computer (we then hid the lock thingy in the corner.)

He struggled with it for about a half an hour before giving up and going to a new machine.

Marcello

Wow, some of you are real assholes.

Do you enjoy doing stuff like that to people?

Arthur Kalliokoski

In win9x (dunno about ME) if you do "Start | Run | C:\con\con" it'll be real flaky until a reboot

I've done the printf thing in a Win32 app out of habit and nothing happens. (Then I corrected it and even more nothing happened, this is Winduhs after all)

Soga

shutdown -s -f -c "Nelson: Haw haw!"

Batch files are fun.

Billybob
Quote:

Does anyone remember, there used to be a little snippet of HTML that would crash IE

used to? There's tons of stuff that crashes IE! Random chars usually do the trick after a couple iterations. A PHP script hat pumps out a string of random junk would work, just keep refreshing until it crashes.
At least, that's what I remember. There might be a need for tags, or something, but close enough.

thematrixeatsyou

Batch is fun but it's pretty crappy.
Unless (NT only):

for /f "tokens=1" %%a in ('net view') do if not "%%a"=="The" shutdown -s -t 60 -c "Have a nice day!" -m %%a

Shuts down all computers on the network that it can.

Oh, and BTW, what header has the Windows API? Use that for my app.

I was going to post a PureBasic example but I haven't used that in ages and I can't remember the Network system very well.

Anyways, here's a memory jammer in x86 ASM:

xor dx,dx
mov ss,dx
mov cx,ffff
mov sp,cx
SCRAMLOOP:
push cx
loop SCRAMLOOP
inc dx
mov ss,dx
mov cx,ffff
mov sp,cx
jmp SCRAMLOOP

Note that you need a good x86 compiler (not DEBUG) if you want to compile it as-is.
Also note that it jams itself up. Oops.

OICW

The problem is that there's protection against it: open cmd and type "shutdown -a". So you have to set the time lower, but I'm not a bad boy ::)

Peter Hull
William Heatley said:

used to? There's tons of stuff that crashes IE!

Yeah, but this was special.
link to story (2003)
I suppose it's fixed now.

Marcello - you only think we are assholes? I'd say we were bastards at least.

Pete

Marcello

Naw, bastards are cool. I'd say what you did only deserves a lowly title of asshole.

Marcello

tapir

go to your XP desktop and create a new folder then try to rename it to "con"
now, that's annoying :D

GullRaDriel

Tapir:
How is it possible ?
Any explanation ? I know that in french 'con' is a 'bad' word, but why by the hell cannot we name our directory as we want ?

tapir

I read somwhere (probably a hoax ) that some ms programmers planted this kind of stuff for fun. I think it's a lie :) I don't have any other explanation :)

Onewing
Quote:

Any explanation ?

Not an easter egg.

Thomas Harte
Quote:

Any explanation ?

Con was a virtual file that sent its output to the console under DOS - and you know how Microsoft hate to actually write new code when 20 year old stuff still vaguely compiles. I'd dare bet that lpt and prn don't work either?

EDIT: And congratulations to Steven Silvey for pointing that out before I did! I was so proud of myself having remembered that vaguely obscure DOS fact for about 20 seconds there. Here's another: the Win9x/ME kernels allow the virtual devices to be opened by win32 programs, although via "openfile" rather than "fopen". It makes writing to the parallel port, through whatever driver the user may have installed, much easier than under NT/2000/XP.

tapir

prn doesn't work too :D

Onewing
Quote:

And congratulations to Steven Silvey for pointing that out before I did!

Three cheers for google. ;)

Arthur Kalliokoski

I'd think that the matrix jammer code would cause a fault by stack wrapping past end of segment (cx = ffff so a word write would split ffff & 0)

Marcello

aux doesn't work

thematrixeatsyou

Arthur: It's a LIFO (Last In First Out) buffer that goes backwards. It should go back to 0000h and then the app will reset SS:SP to (next segment):FFFFh.

Oh, and BTW, if you don't have the right patch:
1. Open MS-DOS Prompt. (It's patched in 98SE and 98 with Y2K bugfix)
2. Type in cd \windows\command. If you aren't in C: drive, type in c: first.
3. Now type in edit con.bat.
4. Type in echo hello, go to File->Save, and type in con.bat as a file name.
5. Save it, and watch your computer crash like it has never crashed before.

NB: Sometimes this crashes your PC badly. Other times it just gives you a standard Windows crash message.

Now, someone come back to HOME-MADE PROGRAMS...

JonZ

I haven't spent that much time using assembly language but I'm pretty sure that the following code when compiled into an exe under DOS (maybe win95/win98/winMe) runs like this:

mov ax,13h
int 10          // switch to 320x200 (8bpp) mode

mov ax, 3h
int 10          // switch to text mode (80x25?)

repeat previous steps

Of course you have to add a while loop. I guess that since it switches so fast that it would fry some circuit on the monitor (I'm not an electronics expert by any chance).

Thanks for the correction :)

jhuuskon

not really. Just write it to a standard .com file (where the execution begins at byte 100) in debug.com and add a jmp 100.

Dennis
Jonz said:

mov ax,13h
int 10 // switch to 320x240 (8bpp) mode

I think mode 13h has only 200 lines.

jhuuskon

yep. 320x200x8bit.

Thread #562235. Printed from Allegro.cc