home *** CD-ROM | disk | FTP | other *** search
- Solution for daPope's CrackMe #2
- The_Dux
-
- SOLUTION
-
- So, prepare yourself to a new brand of cracking skills: we're going to PATCH
- an executable built with visual j++. Its main purpose is to mix the power of
- java with the portability of an exe file. The result is another compiler from
- Microsoft that create executable that load only in 5-10 seconds (nice uh?).
- Ok, here is the tutorial.
- First of all we read the txt file included and we acquire the rules: we have
- to patch the file. Nothing more.
- If you have ever patched a file you know that it's not so difficult after you
- know what you have to change. Here it's completely different because you have
- to know what to patch but also where to patch it. The problem is, of course,
- the fact that you haven't a real executable, so you can't disassemble it with
- a standard windows disassembler (such as w32dasm or ida). We have instead a
- nice dissassembler (jad?) that decompile our program and let us see the REAL
- code of the program (in java, as it is written). From this point of view our
- job (???) is very easy, but keep in mind that we don't know (at least for
- now, maybe one day someone will make a dissassembler with offset references)
- the offset of each instruction.
- Let's start.
- Extract the class file and the resource file from the exe with a tool like
- J++ Extract (donwload it at http://protools.cjb.net) and you will get two
- files: form1.class and form1.resources. Fire up your disassembler and open
- the .class file. The output will be something like form1.java. Here you have
- the original source code and you can quickly find what this little program do:
- create a nice dialog box, create two labels with success message ( Well done
- etc. ) and a picture ( can you figure out what is the picture? ).
- What we have to do so? We can patch it in many ways?
- I think so but the easiest way it's to reduce the size of the picture ( as
- you read from the source file there's a line that set picture's width and
- height ).
- You may think: "Why the hell I have to reduce the size of the image?? I can't
- simply tell the program not to load it?".
- You're right. It's the best way to solve the crackme. Now do it if you're
- able without going crazy nor studying two years the structure of the vj++
- exe files.
- So we have to change the size of the picture...
- How we do that?
- We try...
- I know it's a bad way to approach with the problem but it's still the
- quickest way...
- So, reading the rules i see that it's not fobidden to use vj++. Use it only
- to see if your work could be successful (you can't use it for other
- purposes...).
- Fire it up and load that java file you've created with jad (or any other
- disassembler) and try to change the size of the picture. IT WORKS!!!!!
- Now the good part. Patch the real exe...
- When i got to this point a problem grew up: i could patch the file? Yes, of
- course.
- But i could also rewrite the file instead of patching it? Well, i thought a
- bit because this is a new world, one with the source code as the author wrote.
- The answer, for me, is: yes you have the source code and you can virtually
- rewrite the whole program without any trouble, but this isn't patching the
- program and even more you are stealing an idea from the programmer ( well,
- he could hide is code a bit more, but this isn't our main purpose, we only
- want to try his program forever, not to steal his ideas right? ).
- Well, after this morality break ( jump over it, it's an ensemble of words
- written to explain why i've decided to patch the program, it doesn't have
- much sense at all) we could go patching the program. This is the real hard
- and long part.
- I proceeded as follow:
- i've made some test programs (from the source code disassembled) with
- different sizes of the picture.
- i've looked at the difference from one file to another
- i've pointed out (more or less) the offsets of the changes.
- keeping in mind that the size of the original file is more or less the same
- i've searched for similar code in the real exe.
- Here's what i found:
- ( the size of the picture, in hex, is 128h x 110h )
- Start Bytes
- Offset
-
- 0x15CDE BB 00 3B 59 11 01 28 11 01 10
-
- BB 00 seems to be a header of sth as 3B 59 do.
- The relevant bytes are the last five.
- The 01 28 is the width and 01 10 is the height ( strange format... )
- If you want to patch the program fill with zeros the height or the width and
- the image will let you read that nice phrase we're always searching for:
-
- Well, Done!!
-