Monday, August 27, 2012

Jack of all trades, Master of [some]


My family got a shock when I first expressed my desire to buy a personal computer. They had been through this about five years back in 1994 when I asked for a video game console on my birthday but this was much bigger. A good branded PC use to cost anywhere between Rs. 50000 to Rs. 70000 at that time in the year 1999. I could have gone for an assembled one but being brand conscious I shortlisted the HP Pavilion 4450. I believe that brand consciousness is not about putting your finger on the costliest thing in the market, it about paying for quality and the effort put in by the company in their RnD activities and for maintaining the quality. I stick to good brands even though some people strongly disagree with me on this.

HP Pavilion 4450 Mario 8 bit
This great PC had a Celeron running at 366 MHz with 48 MB of RAM (yes its MB). Hard Disk was 4.3 GB and it came with Windows 98. Though now even my cellphone runs faster than this machine, it was a good configuration back in 1999. The Pentium II version was even more costlier.

Like any other Indian parents, mine too were a little skeptical about buying an expensive PC for me. And my job was to explain them what benefits it can bring for me and my brother. My brother wasn't fond of computers at all so there was no point asking him for help. He was happy with whatever exposure he got in school. After weeks of discussion, finally my dad asked me one day "You want a PC or a scooter?". I loved LML Select II scooter not just for the looks but the overall build quality. I wasn't a bike guy. My father was a die hard fan of Bajaj scooters (he still is) so we had a green Bajaj Super which I disliked. Even a Lambrette looked better than a Bajaj Super. So that was a tough question to answer, a choice between LML Select II and HP Pavilion PC. It made me gave thought to what I do and what I need or want. I had no girlfriends and the possibility of having one was bleak and roaming around the city alone didn't sound like a good idea to me. The other thing was that I use to travel to UPTEC everyday by bus just to spend a couple of hours in front of a computer. By having a computer at home, I could save this time and the bus travel which I hated. I hated it because these bus guys would never completely stop the bus to let passengers out and one has to literally jump out of the moving bus. As a do-it-the-right-way person, I never liked it and it was out of my control. Even if I waited or asked him to stop the bus completely, he would skip this one and stop at the next stop which had more people waiting to board. Finally I decided to get a PC. My father wasn't that happy with my decision as I couldn't explain what I'll do with it. All he had in mind about PC is that people can play games on it and Rs. 65000 for a video game did not sound like a good idea to him.

I got my first PC on 21st June 1999. It was a day of rejoicing which quickly turned sour after a major electricity breakdown in my colony. It was such a major breakdown that there was no electricity for almost four days. I remember watching movies with friends during this period to avoid the frustration of not being able to operate my new PC.

The first thing that I wanted to do was to format the Hard Drive and partition it the way I want. Being an HP PC, it was loaded with all sort of programs that I'll hardly use ever. I spent the next few days looking at each and every setting and file that computer had, installing whatever Free or Demo applications I can find on Digit CD, watching movies and listening to MP3 songs. I did not want to clutter the formatted PC with demo applications so I decided to try them all before cleaning it. The MP3 movement had started and it was everywhere. MP3 Rippers, MP3 To EXE converters, MP3 Tag Editors were popular apps and I tried them all. Trying out different applications gave me a lot of information about user interfaces and filled my mind with ideas.

My first completed application in Visual Basic was a calculator. Nothing special in it, just that it displayed colourful digits and the calculation steps can be saved in a text file. It also had a big logo on the right saying "INDIAN" in a fancy way, I did it using Ulead's PhotoImpact. Ulead was later bought by Corel (remember Corel Draw) and all its products are now on Corel's site. Paint Shop Pro was also a very popular image editing software. It sat between the bare-bone Microsoft Paint and the advance Adobe PhotoShop. All these were available as shareware on Digit CD. I don't have the calculator executable available with me, nor do I have the screenshot which I really miss. As I wrote in my earlier post, I use to update this calculator frequently and gave it to my friends for testing. This application taught me the basic of Visual Basic and Packaging.

Then I made a data Encryptor (see images below). The one thing I was very fond of was making splash and about screens because it always had my name and other details. The application only allowed text to be encrypted which can either be entered directly into the RichTextBox or can be loaded from a file. To encrypt the text, user needs to specify a key up to 40 characters. The same key would decrypt the text.

Encryptor 2001Encryptor 2001 - Encrypting Text

Encryptor 2001 Help FileEncryptor 2001 Help File Contents

If you encrypt the text "This is a test" with the key "123456", it would give you "Abhimanyu Sirohi - abhimanyusirohi@yahoo.com - 2001Ngas im X o]pn*+1+4.“/'++.270/(". Ya, that long string was the file signature. I packaged this application complete with a ReadMe and a Help file. The help file contents seems funny now. It was generated using the HTML Help Generator that came with Visual Studio and generated .HLP and .CNT files. .HLP files are not supported anymore and if you have Windows 7/Vista you'll need to download the WinHlp32 program to view these HLP files. A few weeks later I also packaged it as an ActiveX control that can be embedded in user applications.

As I dived deep into the Visual Basic world, I craved for advanced controls which were not available in the Visual Basic toolbox. VBAccelerator.com was an excellent site for all the advanced controls complete with their source code. The best part was that it was totally FREE. It provided all the nicely written and beautiful looking ListViews, Grids and ExplorerBars. The site has been updated and it now supports both VB and .NET.

The next I wanted to do was to create my own website. Hacking and cracking was quite popular those days and sites providing serials, keys and key generators (with free p@rn  of-course) were all over the Internet. It was very easy to find serials and key generators for any software you like. I always wondered how these smart hackers\crackers override the limitations in a software. How is it possible to make changes to an executable. I started reading about it and found SoftICE. SoftICE was a kernel level debugging tool but because of its capabilities it was used by crackers to break application limitations. Digit CD was full of shareware applications with either a 30-day trial period or a nag screen that pops up every now and then while you are using it. I browsed it and found my first target, WinZip. Let me tell you that it was totally for educational purpose only and not to use or distribute the cracked version. The idea behind cracking WinZip was to bring up the WinZip registration dialog, enter and key and put a break-point in SoftICE for the GetDlgItemText API. The API gets called when we press OK to get the text entered in the registration key textbox. Then we step into the code looking for a place in assembly language where WinZip processes the entered code and decides whether its valid or invalid. That's where we need to trick it into believing that the entered code is valid. WinZip was cracked in a day by following the instructions on a hacker site.

Playing Half-Life was a regular affair between all these cracking and development activities. Everything was excellent about this game. The story, scientists, head crabs, Gordon Freeman and his crowbar. I found it on the Digit CD and became a hardcore fan. Sarvjeet was also a big fan of this game which became very popular. I still play it on my Xbox 360. The other one I use to play at that time was Virtua Cop. A First-Person-Shooter, it was fast but only had 3 stages. 


Hard work goes both in making a software and cracking it. Back then there were no IT laws in India and I did not have much idea about the legal aspects of cracking and distributing software so I decided to make my first website loaded with my small applications along with hacking and cracking stuff. The first one I hosted on Fortunecity which provided 100MB of space for personal websites. The downside was the big ad banner that got attached to every page in your site. Then I switched to Geosities (now closed), a Yahoo service. It provided 15MB of web space and a small ad banner. I use to update my site frequently and in three years I uploaded three different websites. I stopped updating when I got a BANNED notice from Yahoo for the hacks and cracks stuff that I had published.




All of these websites had a common profile section which I filled with anything and everything related to me. As the Java fever caught me, I got myself a big fat Java 2.0 book. I started working on Java because it was part of my 'A' Level course. I wrote a small desktop application in Java but it wasn't fun because there was no good IDE available. Being a Visual Basic developer, I had the privilege of using Microsoft's Visual Form Editor and I could not find a similar product targeting the Java platform. It was boring and frustrating to write down the initialization statements for each and every control on Form (which Visual Studio .NET hides inside the InitializeComponent method). Despite of all these things, I really liked writing Java Applets for fun. Below are some of the applets I wrote - KissMe, Digital Clock and Radar. Try clicking on my picture below (No it won't send me the email address of person who clicked and kissed me). The Radar applet makes a lot of annoying sound, you might have to lower down your system's volume.

   

(You'll need to allow Java to run in order to see the above applets)

In the next part, I plan to write about my experiences during my college days, about the people I met and the projects I developed. I'll also write about the project I am particularly proud of: The MS-DOS Explorer.

As always, all third-party images used here are for illustration purpose only.

Monday, August 20, 2012

The Wonder Years in Lucknow

It has been 14 years since I was first introduced to computers and the introduction was purely by chance. A few days back, as I was browsing through the old stuff I have gathered over the years, I thought why not write about those wonder years that I spent in Lucknow - 1998-2000. Though I spent four years in Lucknow only the last two were worth remembering.

It was a hot afternoon of June 1998 when I saw Gautam leaving Sanjay's house on his Hero Puch bike. He stopped outside my house and we started a conversation on what he is doing and what I am doing these days. That's when he mentioned about a computer diploma course from UPTEC. The diploma was the 'O' Level Diploma by Department of Electronics, Govt. of India. I had no idea what he was talking about. Computers? What do you do with them? Oh Yes, I have seen computers at school and I've done a bit of programming in LOGO and I've also seen the railway clerk booking a ticket but how can you make career in computers. I went to government schools (Kendriya Vidyalaya) for the last four years of my school education. Computers was a subject there but I never got a chance to even touch one. It was all about reading the basics (Input and Output devices, CPU, Storage devices) and taking the exam but computers always fascinated me.

We all were out of the school but nobody had anything in mind about the future. Engineering, Merchant Navy, Bank Job, Railways, Army there were so many different things. I had nothing else to do besides preparing for Army and Bank papers so I asked Gautam to get me a prospectus for this course. The next day he came with a prospectus and I gave him Rs. 50. The prospectus was for one year diploma course at UPTEC that would prepare us to get a 'O' Level Diploma. The prospectus mentioned that UPTEC will provide their own diploma for the course undertaken but the course does not guarantee an 'O' Level Diploma. We were supposed to pass four different national level exams to get the real diploma. The main thing I had in mind was that I'll get a chance to study computers so I filled in the details and submitted the form. An entrance test was held a couple of weeks later and I passed it. The longest and the most enjoyable journey of my life had started as I stepped into this virtual world.

The course covered mainly the fundamentals of computers, batch programming and the 'C' language. The first day I entered the computer lab was the first day I grabbed the mouse in my hand. We were asked to boot the computer. I heard a few beeps and then saw some numbers running the screen. Wow! Computer! felt on top of the world. Everything settled a few minutes later and all I can see was a black screen with a "C:\" and something blinking and blinking and blinking. "What do we do now?" I asked Ashish who was my batch-mate  He knew nothing so I kept waiting and looking at other people's screen. It was my first day so I avoided any kind of experiment with it. I thought of typing something in but then changed my mind. "Type win" heard someone saying "and press enter then". I typed in the three magic letters and pressed enter. Windows 3.1 splash appeared on the screen. The next few minutes passed looking and admiring the beauty of things on screen. Changing colours and dimensions and then finally settling for a "Program Manager" window with a few pictures inside it. It was truly an amazing experience for me and I hope for the entire class too. Though some of them were not so amazed probably because they already had a PC at home or computers wasn't something they liked. "Now what?" I asked my teacher. "Grab that mouse and open Paint progam" he replied. I grabbed that funny looking thing and moved it. "Yo, did you see that? when I move that funny thing something even more funny happens... see that small pointer, it moves" excitement grew to a new level. The teacher showed us how to 'click' and 'double-click' using that funny thing in hand and finally I was able to open Microsoft Paint. "OMG this is such a useful piece of machine" I thought to myself. That day I spent the remaining time in the lab to draw the blue-red PEPSI logo with of course my name at the bottom.


The first big thing for me was "MS-DOS Batch Programming". It gave me the first feel of how you can program a computer and make him follow your commands in an ordered way. Do this, then this, if this is that then do that and so on. Thursday and Friday were the only days we were allowed to use the machines, that too for only two hours per day. Two hours were too less for me to develop something so to cut down on the application design time (like I knew what application design meant?), I would write batch program at home in my notebook and dry run them for hours. This was to make sure that the program will run in the first go and to avoid any debugging delays in the two hours session. I made a lot of batch programs. I thought the only programming one could do is the batch programming till I met 'C' and soon realized the power of this new language and started writing all sort of programs from 200 years calendar (found at the back of some notebooks) to personal diaries with its own record management system (obviously I had no experience with databases). Schaum's Programming with C was my first 'C' programming book -- actually my first programming book. I never studied for the 'C' exam but working on these small projects paid off and I got an "A" in the 'C' programming paper of 'O' Level. Programming and computers were now an addition and I enrolled for the advanced level diploma ('A' Level) after clearing 'O' Level.

I always wondered how people make nice looking Window interfaces with buttons and lists and the colourful backgrounds. The Digit Magazine use to have a dedicated folder in their CD for small applications developed by Indian programmers. It had many interesting application all with nice looking user interfaces. I asked my teacher Mr. Rahul Navneet Singh about it. "Try Clipper or FoxPro, you can create user interface in them" he said. I and Sarvjeet went straight to the computer market that day which was in Hazratganj lane, near Mayfair Cinema (now closed). I got a CD with both Clipper and FoxPro 2.6 (or maybe Visual FoxPro 5). FoxPro turned out be an entertainer and I made a few database projects in it including my 'O' Level project. I remember the login screen I made for a test project, it was inspired by Boris's Hack program in the movie Golden Eye. and I also remember how I saved myself from embarrassment by quickly turning off the computer monitor when this login screen jammed while I was testing it and a neighborhood lady came in at that very moment (Murphy's law I guess -- If there is a worse time for something to go wrong, it will happen then).


Browsing Internet was considered a luxury. The shop close to UPTEC would charge Rs. 120 for an hour of browsing. Rs. 120 was big part of my monthly pocket money and so does for my friends. There was this guy who worked in a cyber cafe. He use to sell internet username and passwords for Rs. 50. The passwords belonged to some government offices having a part of their budget set aside for internet but never used it. It was expensive even after getting the passwords because it consumed local calls (Rs. 1.5 or Rs 2 per 3 minutes).

Computers and classes were not the only thing we did during these two years at UPTEC. As a foodie, I and Sarvjeet use to roam around the city looking for good (and cheap) street food. Entering a restaurant was a luxury only to be enjoyed on someone else's expense so we waited for birthdays (of course not ours). The dhaba just in front of UPTEC served great samosa-chole for Rs. 5 per plate. It was perfect for a quick lunch break from our 'A' level classes. When we had a little more time (and money), we use to have biryani which was Rs. 25 per plate that time, so we shared it. It was an amazing biryani with white, green and saffron rice. It was so tasty that we often had to go for "Biryani Part II". "Biryani Part II" was when we had a plate of biryani, went back to the class but could not resist coming back and having the second plate. Then there was Rovers, near GPO in Hazratganj. Rovers was famous for fast foods such as burgers and rolls, mainly the Chicken Kathi Roll and Paneer rolls.

Samosa-Chole


A few months later, someone told me about Visual Basic and how easy it is to design an application using its visual designer. I called up Sarvjeet and we again went to the computer market. I bought a CD with Visual Basic 6.0. It was damn expensive, Rs 150 for a single CD. Visual Basic was a star, I was up and running in no time. It was exactly the kind of stuff I was looking for - Fast, Easy and Powerful so I dived deep into it, often finding myself awake till 3 AM. Calculator, NoteKeeper, Encryptor, I made them all. The real fun was distributing these small applications among friends and getting their WOWs (which actually never happened). A 1.44 MB Floppy Disk was the popular media those day. I remember packing my first VB calculator on it for Sarvjeet and Koshika, they both had PCs at home. Both came back saying that it did not work on their system, some error message was displayed and then took two days to tell me the exact message. A few days of research taught me the basics of Dependencies and this time I used Visual Basic Package and Deployment Wizard to pack the application. It was a weekly affair to ask close friends to test my programs.


In my next post (which I hope I'll publish in the next few days), I plan to write about all the small applications I developed during these wonder years. Encryptor, KissMe Java Applet, MS-DOS Explorer, my software cracking experience and some of my hacker friendly web sites which were banned.


(All the images used in the blog belong to their respective owners and are used here for illustration purpose only)

We are Robots

I've always been fascinated by UFOs ( Unidentified Flying Objects ) and stories related to these alien objects. The first story that I ...