Pages

Sunday, 10 January 2010

Read ID3 Tag of an mp3 File using ActionScript 3.0

ID3 tags are embedded within an mp3 file that stores the metadata. It contains various information such as the title, artist, album, track number, and other information about the file.
Here we will see how to read those information using ActionScript 3.0 and Flex Builder 3.0 as the IDE.
Source:
package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.media.Sound;
    import flash.net.URLRequest;
    import flash.text.TextField;

    public class ID3Tag extends Sprite {
        private var _sound:Sound;

        public function ID3Tag() 
        {
            _sound = new Sound();
            var _soundURL:URLRequest = new URLRequest("sound/4one-Surrealism.mp3");
            _sound.load(_soundURL);
            _sound.addEventListener(Event.ID3, readID3);
        }

        private function readID3(event:Event):void
        {
            var tf:TextField = new TextField();
            stage.addChild(tf);
            tf.appendText("\nArtist: "+_sound.id3.artist);
            tf.appendText("\nAlbum: "+_sound.id3.album);
        }
    }
}

Now I shall explain the above.
The folder organisation is as below.


public function ID3Tag()
{
    _sound = new Sound();
    var _soundURL:URLRequest = new URLRequest("sound/4one-Surrealism.mp3");
    _sound.load(_soundURL);
    _sound.addEventListener(Event.ID3, readID3);
}
ID3Tag() is the constructor. We need to load the mp3 which is inside the sound folder. URLRequest is used to point to the file which inturn is loaded using the load method.
We now add an eventlistener which listens to Event.ID3. What this does is if there is an ID3 tag present for the loaded mp3 file, then the corresponding readID3 function will be called.
private function readID3(event:Event):void
{
    var tf:TextField = new TextField();
    stage.addChild(tf);
    tf.appendText("\nAlbum: "+_sound.id3.album);
    tf.appendText("\nArtist: "+_sound.id3.artist);
}
We create an new TextField tf which is added to the stage. tf.appendText() method is used to display the tags. _sound.id3 is the method that parses the ID3 tag for us. And the _sound.id3 method contains various properties like album, artist, comment, genre etc. The _sound.id3.album will show the name of the album and likewise.

An updated version of this tutorial can be found at Kirupa.com

Tuesday, 5 January 2010

Crack your Windows Password

Here I'll explain how to audit the windows password using Backtrack GNU/Linux and John The Ripper. This case study will be using windows xp professional. However the procedure is same for newer versions.
This method is purely brute-force and will take time depending on the password complexity and the system configuration.

1. Equip yourself with the BackTrack live Cd.
2. Boot your system with the BackTrack Live Cd.
3. Start the x-server (i.e, GUI mode)
startx
4. Fire up your terminal.
5. Type in at the prompt:
bkhive /mnt/sda1/windows/system32/config/system sys.txt
You'll see some data given out to the terminal like Bootkey..
samdump2 /mnt/sda1/windows/system32/config/sam sys.txt > pass.txt
In the above code, samdump2 dumps the SAM (System Accounts Manager) file that contains the user information to a file called pass.txt
sda is used assuming that the hard disk is a SATA. sda1 is used assuming windows is installed to the first partition of the hard disk. hda is to be used if its an IDE hard disk.
6. Open John The Ripper from the Backtrack KDE menu (analogues to start button in windows) and run the command:
john /root/pass.txt
Wait until John cracks the password.
If its finished cracking it will show a message. You can press any key to see the current progress, word combination, etc.
7. To show the cracked passwords type:
john show /root/pass.txt
And there you go!

Monday, 4 January 2010

No Shadow for Icons in XP

If there appears no shadows for icons in XP even after enabling the "Use drop shadows for icon labels on the desktop", then it implies that the problem is caused due to the wallpaper.


The reason is that the image is having more than 8 bits/Channel. And since XP doesn't have desktop compositions as like in the newer versions of Windows like Windows Vista, Windows 7, it cannot render images greater then 8 bit/Channel. Also some pngs can cause it as well. So the solution to this is to change the wallpaper or make it 8 bit/Channel.

Lisp Programming using Eclipse IDE

Eclipse IDE can be used for LISP programming, other than emacs, obviously.

1. Download Eclipse Classic IDE.
In order to run eclipse java runtime should be installed. There are both 32 and 64 bit versions of JRE and Eclipse. Choose them depending on the OS that you use. Extract the archive.
2. Download cusp plugin depending on the OS and extract it.

The folder structure is as below for windows version
cusp_win32
  \-- features
  \-- plugins


4. Copy the contents inside the features and plugins folder of the cusp_win32 to the corresponding features and plugins folder which is present inside the eclipse-SDK-3.5-win32\eclipse folder.

Now open the eclipse IDE and under the window->Open Prespective->other... we will see Lisp. Choose it, and now we have a full blown Lisp IDE.

Friday, 1 January 2010

USB 3.0

USB 3.0 also called as SuperSpeed USB will be available soon on ASUS and gigabyte motherboards. ASUS has also announced an add-in PCIe x4 card with USB 3.0 support, though it is compatible only with its P55 series of motherboards after a BIOS upgrade. Fujitsu is about to release laptops with USB 3.0 support. But Intel has announced that it will not include USB 3.0 in its chipsets until 2011. AMD may not support USB 3.0 until 2011 either. It may be available with Apple products in early 2010. GNU/Linux is the first Operating System with official USB 3.0 support.

Features
1. SuperSpeed - transfer mode at 4.8 Gbit/s
USB 3.0 achieves those speeds with a new plug and cable format, but it's all backward-compatible with USB 2.0 and USB 1.1.
2. Full-duplex: Devices can send and retrieve data simultaneously
3. Support for streaming
4. Improved power management - idle, sleep and suspend states.

There is a 127 device limitation per controller.