Cheating an application

I have contact with lots of different software. However yesterday I came across an application, that completely blew my mind… in a negative sense. This particular application uses its own custom file format, that is basically zip, with special files and folders inside, much like Open XML and Open Office file formats work. What’s different however, is that it requires you to have WinZip installed in order for it to work. And by WinZip, I mean WinZip, not just some generic compressing/decompressing program that supports zip format. This thing is so ridiculous that I just don’t know what to say. ANY software that requires the user to use some other specific tool is broken by design, but requiring your users to buy other commercial tool to do such basic thing as compression/decompression… it’s just rude.

Well, anyway, as I really had no other choice but to use it, I decided not to give up and see how much it really needs actual WinZip. To do this I took invaluable tool from SysInternals (now part of Microsoft) called Process Monitor. With it you can see how processes on your system interact with each other and with the system. So I set it up, ran the evil program, made it do its thing, and then I could analyze what showed up in Process Monitor.

There were two important things to notice in the log:

  1. How the program identified WinZip’s exeprocmon1
    When you install it, you have to point it to a directory, where you have your WnZip installed. Important thing to see here, is ‘filter’ attribute in Details column. The way I understand it, it tells us, that the program was looking exactly for “winzip32.exe”. So it seemed like it doesn’t use WinZip’s libraries, nor it’s (if WinZip actually has one) automation model, but it just call winzip32.exe with command line parameters.
  2. What are command line parameters it passes to WinZip32.exe
    procmon2 Few (hundred) lines below I found out answer, when I looked at command line WinZip was actually called with: -a -x ‘path to where it wanted zip file to be saved’ ‘path to files it wants to compress’. (it called WinZip in few other places, with other commands, like when extracting files, but the general way to do this stayed the same)

It seems, that WinZip’s command line parameters are not public, but this little site, helped me with that. At this point, it looked like all this application really needs, is a executable called winzip32.exe that supports few of WinZip’s command line parameters. All I needed to do, was to find one. Unfortunately, after checking out few free compression/decompression tools I wasn’t any closer to the solution, as none of them would interpret those parameters the way WinZip does.

Then I decided to write my own using some free library. The actual code is not interesting, only interesting thing about it is that it was less than 30 LOC long and took me 15 minutes to implement (including time spent on learning the library). Now, you can look at it from two perspectives. One is, that with 30 lines of code, I saved my company quite an amount of money, it would have to spend on several WinZip licenses. The other is, makers of that tool required you to buy 3rd party tool to do something that can be done in few lines of code. I won’t comment on that…

Technorati Tags: ,


g morley says: