Trickster Mouse Emulator – April Fools Day Practical Joke

Trickster is a simple application built on UsbThumb platform. It tricks your victim into thinking they have a virus on their computer, by hardware emulating and moving their mouse in circles on intermittent intervals.

It is basically a customization of Mouse emulation demo that Microchip bundles with their USB Framework.

The code responsible for enabling/disabling mouse emulation is triggered by a timer interrupt like so:

        OpenTimer0( TIMER_INT_ON &
                 T0_16BIT              &
                 T0_SOURCE_INT         &
                T0_PS_1_256);

                     ………….

        //These are your actual interrupt handling routines.

 

        #pragma interrupt YourHighPriorityISRCode
        void YourHighPriorityISRCode()
        {
                //Check which interrupt flag caused the interrupt.
                //Service the interrupt
                //Clear the interrupt flag
                //Etc.
        #if defined(USB_INTERRUPT)
                USBDeviceTasks();
        #endif
       
                if(INTCONbits.TMR0IF){
                        counter_s++;
                        //to interrupt every 1s we need to count FOSC / 4/ 256  = 46875 ticks (0xB71B)
                        //to count these ticks till overflow we need to set TMR0 to  0xFFFF – 0xB71B = 0x48E4
                       
                        TMR0H = 0x48; //will write to TMR0H buffer
                        TMR0L = 0xE4; //will write actual TMR0L / TMR0H 

                        INTCONbits.TMR0IF = 0;
                }

        }       //This return will be a "retfie fast", since this is in a #pragma interrupt section

       ……………..

       INTCONbits.TMR0IE = 0;  //disable Timer0 interrupt
        if(emulate_mode && counter_s > 3){      // seconds on
                counter_s = 0;
                emulate_mode = 0;
        }else if (!emulate_mode && counter_s > 60){     //seconds off
                counter_s = 0;
                emulate_mode = 1;
        }
        INTCONbits.TMR0IE = 1;

 


For full source code see:

http://code.google.com/p/usbthumb/source/browse/#svn/trunk/UsbThumbMousePrank

UsbThumb is an open-hardware platform, anyone can build their own:

http://code.google.com/p/usbthumb/source/browse/#svn/trunk/Hardware

or pick up a prebuilt SMT version of UsbThumb here: http://www.gadgetgangster.com/303

2 thoughts on “Trickster Mouse Emulator – April Fools Day Practical Joke

Leave a Reply

Your email address will not be published. Required fields are marked *