Wednesday, March 31, 2010

Solutions: newfolder.exe & regsvr.exe viruses

I want to tell you a story, two days back i got affected by this virus very badly as it eat up all my empty hard disk space of around 700 MB .

I was surprised that my most reliable friend Kaspersky, for the first time failed me in this war against viruses but then again avg and bitdiffender also failed against it. This virus is know popularly as regsvr.exe virus, or as new folder.exe virus and most people identify this one by seeing autorun.inf file on their pen drives, But trend micro identified it as WORM_DELF.FKZ. It is spreading mostly using pen drives as the medium.

Well, so here is the story of how i was able to kill the monster and reclaim my hard disk space.

Manual Process of removal

I prefer manual process simply because it gives me option to learn new things in the process.

So let’s start the process off reclaiming the turf that virus took over from us.

1. Cut The Supply Line

a. Search for autorun.inf file. It is a read only file so you will have to change it to normal by right clicking the file , selecting the properties and un-check the read only option
b. Open the file in notepad and delete everything and save the file.
c. Now change the file status back to read only mode so that the virus could not get access again.
d.
e. Click start->run and type msconfig and click ok
f. Go to startup tab look for regsvr and uncheck the option click OK.
g. Click on Exit without Restart, cause there are still few things we need to do before we can restart the PC.
h. Now go to control panel -> scheduled tasks, and delete the At1 task listed their.

2. Open The Gates Of Castle
a. Click on start -> run and type gpedit.msc and click Ok.
b.
c. If you are Windows XP Home Edition user you might not have gpedit.msc in that case download and install it from Windows XP Home Edition: gpedit.msc and then follow these steps.

d. Go to users configuration->Administrative templates->system
e. Find “prevent access to registry editing tools” and change the option to disable.
f.
g. Once you do this you have registry access back.
3. Launch The Attack At Heart Of Castle
a. Click on start->run and type regedit and click ok
b. Go to edit->find and start the search for regsvr.exe,
c.
d. Delete all the occurrence of regsvr.exe; remember to take a backup before deleting. KEEP IN MIND regsvr32.exe is not to be deleted. Delete regsvr.exe occurrences only.
e. At one ore two places you will find it after explorer.exe in theses cases only delete the regsvr.exe part and not the whole part. E.g. Shell = “Explorer.exe regsvr.exe” the just delete the regsvr.exe and leave the explorer.exe

4. Seek And Destroy the enemy soldiers, no one should be left behind
a. Click on start->search->for files and folders.
b. Their click all files and folders
c. Type “*.exe” as filename to search for
d. Click on ‘when was it modified ‘ option and select the specify date option
e. Type from date as 1/31/2008 and also type To date as 1/31/2008
f.
g. Now hit search and wait for all the exe’s to show up.
h. Once search is over select all the exe files and shift+delete the files, caution must be taken so that you don’t delete the legitimate exe file that you have installed on 31st January.
i. Also selecting lot of files together might make your computer unresponsive so delete them in small bunches.
j. Also find and delete regsvr.exe, svchost .exe( notice an extra space between the svchost and .exe)

5. Time For Celebrations
1. Now do a cold reboot (ie press the reboot button instead) and you are done.
I hope this information helps you win your own battle against this virus. Soon all antivirus programs will be able to automatically detect and clean this virus.

Thursday, March 11, 2010

Working with....

ActionScript3: Changing mouse pointer

Simple example shows how to change Mouse-Pointer in Action-Script3

package



{


import flash.display.Sprite;


import flash.events.MouseEvent;


import flash.ui.Mouse;


public class SwitchOutPointer extends Sprite


{


private var circleMouse:Sprite;


private var squareMouse:Sprite;


private var currentMouse:Sprite;


private var useSquareField:Sprite;


private var useCircleField:Sprite;






public function SwitchOutPointer()


{


super();


useSquareField = new Sprite();


useSquareField.graphics.beginFill(0xFAAAAF, 1);


useSquareField.graphics.drawRect(0, 0, 100, 100);


useSquareField.graphics.endFill();


useSquareField.name = "square";


useSquareField.x = 200;


useCircleField = new Sprite();


useCircleField.graphics.beginFill(0x543454, 1);


useCircleField.graphics.drawRect(0, 0, 100, 100);


useCircleField.name = "circle";


useCircleField.graphics.endFill();


addChild(useCircleField);


addChild(useSquareField);


//here I add my event listeners to the respective sprites


useCircleField.addEventListener(MouseEvent.ROLL_OVER, useCircle);


useSquareField.addEventListener(MouseEvent.ROLL_OVER, useSquare);


useCircleField.addEventListener(MouseEvent.ROLL_OUT, showMouse);


useSquareField.addEventListener(MouseEvent.ROLL_OUT, showMouse);


//now I'm creating the object thats going to replace


//my mouse when we're over certain sprites


circleMouse = new Sprite();


circleMouse.graphics.beginFill(0x00ff00, 1);


circleMouse.graphics.drawCircle(0, 0, 5);


circleMouse.graphics.endFill();


currentMouse = new Sprite();






squareMouse = new Sprite();


squareMouse.graphics.beginFill(0xff0000, 1);


squareMouse.graphics.drawRect(0, 0, 10, 10);


squareMouse.graphics.endFill();


//now I want to listen to ALL mouse movement events


//so that I can reposition the mouse


this.stage.addEventListener(MouseEvent.MOUSE_MOVE, moveNewMouse);


}






/* move whatever mouse is the current mouse to the mouse's stage


* position. note how I offset the position slightly this is because


* the rollOff event of the useSquareField and useCircleField will be


* fired if the circleMouse or squareMouse object is in between the


* mouse and the useSquareField or useCircleField object. */


private function moveNewMouse(mouseEvent:MouseEvent):void


{


currentMouse.x = mouseEvent.stageX + 5;


currentMouse.y = mouseEvent.stageY + 5;


mouseEvent.updateAfterEvent();


}






private function useSquare(mouseEvent:MouseEvent):void


{


Mouse.hide();


addChild(squareMouse);


currentMouse = squareMouse;


}






private function useCircle(mouseEvent:MouseEvent):void


{


Mouse.hide();


addChild(circleMouse);


currentMouse = circleMouse;


}






/* if we roll off, then go ahead and remove respective icon


* for the mouse using the target property to figure out which


* one it was and show the normal mouse icon. */


private function showMouse(mouseEvent:MouseEvent):void


{


if((mouseEvent.target as Sprite) == useSquareField)


{


removeChild(squareMouse);


}


else {


removeChild(circleMouse);


}


currentMouse = new Sprite();


Mouse.show();


}


}
}

Wednesday, March 10, 2010

AS#: MouseEvents (Basics)

Basic sample code, to illustrate how MouseEvent works in flash-player.


package
{
    import flash.display.Sprite;
    import flash.events.MouseEvent;
   
    public class MouseEventExample extends Sprite
    {
            public function MouseEventExample () {
            var listner:Sprite = new Sprite();
            listner.graphics.beginFill(0x0000ff, 1);
            listner.graphics.drawRect(0, 0, 200, 200);
            listner.graphics.endFill();
           
            listner.doubleClickEnabled = true;
            addChild(listner);
           
            listner.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler)
            listner.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler)
            listner.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler)
            listner.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler)
            listner.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler)
            listner.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler)
            listner.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler)
            }
       
            private function mouseDownHandler(mouseEvent:MouseEvent):void {
                trace("mouseDownHandler");
            }
            private function mouseMoveHandler(mouseEvent:MouseEvent):void {
                trace("mouseMoveHandler");
            }
            private function mouseOutHandler(mouseEvent:MouseEvent):void {
                trace("mouseOutHandler");
            }
            private function mouseUpHandler(mouseEvent:MouseEvent):void {
                trace("mouseUpHandler");
            }
            private function mouseWheelHandler(mouseEvent:MouseEvent):void {
                trace("mouseWheelHandler");
            }
            private function mouseOverHandler(mouseEvent:MouseEvent):void {
                trace("mouseOverHandler");
            }
            private function doubleClickHandler(mouseEvent:MouseEvent):void {
                trace("doubleClickHandler");
            }
            public override function toString():String {
                return "";
            }
    }
}

ActionScript3: EventFlow

Guys welcome back....
The below code will illustrate, how EVENT-FLOW mechanism works in AS3.


Just make two files naming -
 EventFlow.as and
 Button.as


Copy-paste the below written code, execute the EventFlow.swf, and watch the trace() results in debugger. You will surely get an-practical idea, how the event-flow works in ActionScript3.

EventFlow.as
package
{
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.events.MouseEvent;
    import flash.display.DisplayObject;
   
    public class EventFlow extends Sprite
    {
            private var uiContainer:Sprite;
            private var buttonContainer:Sprite;
            private var uiLabel:TextField;
            private var stopButton:Button;
            private var playButton:Button;
            private var pauseButton:Button;
           
            public function EventFlow () {
                uiContainer = new Sprite();
                uiContainer.name = "uiContainer";
                addChild(uiContainer);
               
                buttonContainer = new Sprite();
                 buttonContainer.graphics.beginFill(0x666666);
                 buttonContainer.graphics.drawRect(0, 0, 420, 50);
                 buttonContainer.name = "buttonContainer";
                 buttonContainer.y = 20;
                 uiContainer.addChild(buttonContainer);
               
                uiLabel = new TextField();
                uiLabel.name = "uiLabel";
                uiLabel.text = "Audio Controls";
                uiLabel.width = 80;
                uiLabel.height = 15;
                uiContainer.addChild(uiLabel);
               
                stopButton = new Button("Stop");
                stopButton.x = 10;
                stopButton.y = 10;
                buttonContainer.addChild(stopButton);
               
                playButton = new Button("Play");
                playButton.x = 160;
                playButton.y = 10;
                buttonContainer.addChild(playButton);
               
                pauseButton = new Button("Pause");
                pauseButton.x = 310;
                pauseButton.y = 10;
                buttonContainer.addChild(pauseButton);
               
                uiContainer.addEventListener(MouseEvent.CLICK, onClick);
            }
       
            private function onClick(event:MouseEvent):void {
                trace ("Click Received");
                trace ("Event Target: ", DisplayObject(event.target).name);
                trace ("Current Target: ", DisplayObject(event.currentTarget).name);
            }
           
            public override function toString():String {
                return "";
            }
    }
}



Button.as
package
{
    import flash.display.Sprite;
    import flash.text.TextField;
   
    public class Button extends Sprite
    {
        private var labelField:TextField;
       
        public function Button (label:String = "button") {
            graphics.beginFill(0x3366CC);
            graphics.drawRect(0, 0, 100, 30);
           
            labelField = new TextField();
            labelField.mouseEnabled = false;
            labelField.selectable = false;
            labelField.text = label;
            labelField.x = 10;
            labelField.y = 10;
            labelField.width = 80;
            labelField.height = 20;
            addChild(labelField);
        }
    }
}

ActionScript3: EventDispatcher with simple example

package
{
    import flash.display.Sprite;
    import flash.events.*;

    public class App1 extends Sprite{
        public function App1() {
            var x:Thermometer = new Thermometer();
            x.addEventListener(Thermometer.TEMP_CHANGED, onTempChanged);
            trace (" Value: ");
            x.temp=10;
        }
       
        private function onTempChanged(event:Event):void {
            var thermometer:Thermometer = Thermometer(event.target);
            trace (thermometer.temp + "F");
        }
    }
}


import flash.events.*;

class Thermometer extends EventDispatcher
{
    private var _temp:Number = 32;
    public static const TEMP_CHANGED:String = "temChanged";
   
    public function set temp(newTemp:Number):void {
        _temp = newTemp;
        trace ("Fired TEMP_CHANGED");
        dispatchEvent(new Event(TEMP_CHANGED));
    }
   
    public function get temp():Number {
        return _temp;
    }
   
    public function Thermometer() {
       
    }
}

Nuts and bolts to ActionScript3: Bouncing Ball

package
{
    import flash.display.Sprite;
    import flash.events.*;
    public class App1 extends Sprite
    {
            private var ballOne:Sprite;
            private var ballTwo:Sprite;
            private var direction:int =1;
           
            public function App1 () {
                ballOne = new Sprite();
                 ballOne.graphics.beginFill(0xff0000, 1);
                 ballOne.graphics.drawCircle(0, 0, 30);
                 ballOne.graphics.endFill();
                ballTwo = new Sprite();
                 ballTwo.graphics.beginFill(0xff0000, 1);
                 ballTwo.graphics.drawCircle(0, 0, 30);
                 ballTwo.graphics.endFill();
               
                addChild(ballOne);
                addChild(ballTwo);
               
                ballOne.x = 300;
                ballTwo.x = 200;
                ballOne.y = 5;
                ballTwo.y = 5;
               
                ballOne.addEventListener(Event.ENTER_FRAME, bounce);
                ballTwo.addEventListener(Event.ENTER_FRAME, bounce);
            }
           
            private function bounce(event:Event):void {
                var target:Sprite = event.target as Sprite;
               
                try {
                    if (target.y == 400) {
                        direction = -10;
                    }
                    if (target.y == 40) {
                        direction = 10;
                    }
                    if (target.y < 500 && target.y > 0) {
                        trace (target.y + " : " + direction);
                        target.y += direction;
                    }
                }
                catch (err:Error) {
                    trace ("opppps...");
                }
            }
            public override function toString():String {
                return "";
            }
    }
}

Wednesday, March 3, 2010

Make your notepad more exciting....!

A Notepad
that writes on it own is for sure a very weird thing but very funny in the same time. And if you change the icon
of the file you create with the Notepad's, and replace the Notepad icon from your friend's computer with this file for sure you will create a great prank.

1. Open Notepad.

2. Copy this script in Notepad:

[PHP]set wshshell = wscript.CreateObject("wscript.shell")
wshshell.run "Notepad"
wscript.sleep 2000
wshshell.AppActivate "Notepad"
WshShell.SendKeys "H"
WScript.Sleep 500
WshShell.SendKeys "ell"
WScript.Sleep 500
WshShell.SendKeys "o "[/PHP]

The little program will make your Notepad type "Hello". You can always make your custom message by replacing the letters between the " " signs with the ones you want.

You can add more lines like the following ones for more letters:

WScript.Sleep 500
WshShell.SendKeys "insert here your letter of group of letters "



3. Now save the file. Go to File->Save as. Type the name of the file with the extension .vbs. For example if you want to choose the name Notepad, type Notepad.vbs. Also be sure that File type is All files not Text file!

The file will look like this.


4. When you doubleclick on it, Notepad will start typing letters.