It's just a curiosity that I have, I know that there are tools/utilities available in the market (also for free). But i want to know how it is done.

I just want to learn it......