home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / CrackMesCbjNet / dux_pope2.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  4.4 KB  |  85 lines

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