Clandestiny
June 28th, 2001, 22:24
Hi All,
I stumbled across this Java target recently and (to my untrained Java eye) it appears to be a bit unique. The target is called VisualRoute5.1c and it is available to be downloaded from:
http://download.cnet.com/downloads/0-10145-100-5197284.html?tag=st.dl.10145-106-1.lst-3-13.5197284
First off, I'll be upfront here and admit this is the very first Java protection I've attempted, but I think I can honestly say I've investigated it pretty thouroughly for someone who's never composed a Java bytecode in their life
Here are my findings so far:
The protection seems to consist of 3 main parts:
1) An .exe loader which loads the main .class file via the MS wjview commandline Java class loader.
2) The main class file named vr.class
3) An encrypted vr.bin file
Using JAD to decompile the vr.class file, I discovered that it functions as a loader itself, decrypting and dynamically loading a portion of the vr.bin file as a new class. This appears to be the sole purpose of vr.class and there are no other references to the protection at this point.
Realizing this, I inserted a couple of lines of code to write out the decrypted portion of the vr.bin to disk. Now, I have a new class file which is fully decompilable with JAD. Decompiling my new class, I soon discover that it too possesses loader functionality. Like the original class, it too appears to decrypt a part of that .bin file and dynamically load a new class. ...And here is where I've become stuck....
A couple of ideas have crossed my mind, but I haven't been able to successfully implement them yet (even assuming they would be worthwhile approaches)... Here they are anyway though:
1) First, I thought to rewrite the original class such that it would load the new class from my decrypted disk image. If it was reading the class from my decrypted version, I figured I could make another patch which would write out the next decrypted class to disk before it was loaded just like I did for the first one. So far I haven't managed to successfully rewrite the original loader - probably due to the fact that I've never coded in Java before and many of its "object oriented" intracicies seem to elude my "procedural programming" background.
2) Secondly, I thought to piggyback some of the code where it reads / decrypts the .bin in the second loader, into my original loader and recompile it. For this idea, all I can say is that it recompiled and wrote an empty file... Of course I could have easily done something wrong / overlooked something here too.
After having worked on this for some days now and read quite a few of the (quite scarce) Java Reversing tuts, I have to admit I'm stumped. I'm not sure what the next attack should be or indeed if I am even approaching this protection from the right direction. It would seem that the only tools at my disposal are my JAD decompiler and Filemon. I downloaded a *rudimentary* Java debugger, but it has proved all but worthless for these dynamically loaded classes.
At this point my brain is melting :'( and I'll REALLY appreciate any insight / help / tips anyone can provide.
BTW, in case you just want to take a quick look w/o downloading the target, I'm attaching my 2 decompiled .class files to this post. There is both the original class and my decrypted class within.
original class = vr.jad
decrypted class = vr1.jad
Thanks In Advance :-)
Regards,
Clandestiny
I stumbled across this Java target recently and (to my untrained Java eye) it appears to be a bit unique. The target is called VisualRoute5.1c and it is available to be downloaded from:
http://download.cnet.com/downloads/0-10145-100-5197284.html?tag=st.dl.10145-106-1.lst-3-13.5197284
First off, I'll be upfront here and admit this is the very first Java protection I've attempted, but I think I can honestly say I've investigated it pretty thouroughly for someone who's never composed a Java bytecode in their life

Here are my findings so far:
The protection seems to consist of 3 main parts:
1) An .exe loader which loads the main .class file via the MS wjview commandline Java class loader.
2) The main class file named vr.class
3) An encrypted vr.bin file
Using JAD to decompile the vr.class file, I discovered that it functions as a loader itself, decrypting and dynamically loading a portion of the vr.bin file as a new class. This appears to be the sole purpose of vr.class and there are no other references to the protection at this point.
Realizing this, I inserted a couple of lines of code to write out the decrypted portion of the vr.bin to disk. Now, I have a new class file which is fully decompilable with JAD. Decompiling my new class, I soon discover that it too possesses loader functionality. Like the original class, it too appears to decrypt a part of that .bin file and dynamically load a new class. ...And here is where I've become stuck....
A couple of ideas have crossed my mind, but I haven't been able to successfully implement them yet (even assuming they would be worthwhile approaches)... Here they are anyway though:
1) First, I thought to rewrite the original class such that it would load the new class from my decrypted disk image. If it was reading the class from my decrypted version, I figured I could make another patch which would write out the next decrypted class to disk before it was loaded just like I did for the first one. So far I haven't managed to successfully rewrite the original loader - probably due to the fact that I've never coded in Java before and many of its "object oriented" intracicies seem to elude my "procedural programming" background.
2) Secondly, I thought to piggyback some of the code where it reads / decrypts the .bin in the second loader, into my original loader and recompile it. For this idea, all I can say is that it recompiled and wrote an empty file... Of course I could have easily done something wrong / overlooked something here too.
After having worked on this for some days now and read quite a few of the (quite scarce) Java Reversing tuts, I have to admit I'm stumped. I'm not sure what the next attack should be or indeed if I am even approaching this protection from the right direction. It would seem that the only tools at my disposal are my JAD decompiler and Filemon. I downloaded a *rudimentary* Java debugger, but it has proved all but worthless for these dynamically loaded classes.
At this point my brain is melting :'( and I'll REALLY appreciate any insight / help / tips anyone can provide.
BTW, in case you just want to take a quick look w/o downloading the target, I'm attaching my 2 decompiled .class files to this post. There is both the original class and my decrypted class within.
original class = vr.jad
decrypted class = vr1.jad
Thanks In Advance :-)
Regards,
Clandestiny