Reverse engi­neer­ing a 10 year old java program

Recent­ly I start­ed to reverse engi­neer a ~10 year old java pro­gram (that means it was writ­ten at about the same time when I touched java the first and the last time at the uni­ver­si­ty – not because of an dis­like of java, but because oth­er pro­gram­ming lan­guages where more suit­able for the prob­lems at hand). Actu­al­ly I am just reverse engi­neer­ing the GUI applet (the fron­tend) of a ser­vice. The ven­dor does not exist any­more since about 10 years, the pro­gram was not tak­en over by some­one else, and the sys­tem where it it used from needs to be updat­ed. The prob­lem, it runs with JRE 1.3. With Java 5 we do not get error mes­sages, but it does not work as it is sup­posed to be. With Java 6 we get a pop­up about some val­ues being NULL or 0.

So, first step decom­pil­ing all class­es of the applet. Sec­ond step com­pil­ing the result for JRE 1.3 and test if it still works. Third step, mod­i­fy it to run with Java 6 or 7. Fourth step, be happy.

Well, after decom­pil­ing all class­es I have now about 1450 source files (~1100 java source code files, the rest are pic­tures, prop­er­ties files and maybe oth­er stuff). From ini­tial­ly more than 4000 com­pile errors I am down to about 600. Well, that are only the com­pile errors. Bugs in the code (either put there by the decom­pil­er, or by the pro­gram­mers which wrote this soft­ware) are still to be detect­ed. Unfor­tu­nate­ly I don’t know if I can just com­pile a sub­set of all class­es for Java 67 and let the rest be com­piled for Java 1.3, but I have a test envi­ron­ment where I can play around.

Plan B (search­ing for a replace­ment of the appli­ca­tion) regard­ing this is already in progress in par­al­lel. We will see which solu­tion is faster.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.