home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / acid_burn2000 / ab-cdilla.txt < prev    next >
Encoding:
Text File  |  2000-05-25  |  13.0 KB  |  388 lines

  1.  
  2.   ·      ·    -  -- A C i D B U R N - P R O D U C T i O N S -- - ▄   ·     ·
  3.      ░    ▄  ░      ▄ ▄  ▄       ░ ▄░          ░ ▄     ▄         ▐█▄   ▄ ░
  4.   ▄██▓▀▀███▌▄▓█▀▀▀███▌▐█▌▐███▀▀▀█▓▄▐▓██▀▀███▄░▄▓█▌ ▀▄  ▐███▀▀███▄░▓██▄ ▐█▓▄
  5.   ███▌ ░▓██▌███ ░▀▀▀▀ ▀▀▀ ███ ░ ███▌███  ▐██▓░▓██ ░ ██▌▐███▌ ▐██▓ ███▀█▄███▌
  6.   ▓██▀▀▀███▌███▌░ ░▓█▌███▌███ ░ ███▌███▀▀▀██▄▐███ ░ ███▐███▀▀▓██▄ ███▌ ▀███▌
  7.  ░▓██▌░ ███ ▓██▌░ ███▌███░▓██ ░▐███▌███▌ ▄███▐███▌░░▓██░▓██▌ ▐███▌███▌░ ███▄
  8.  ▐███▌░ ███▐███▌░ ███▐██▓▐███ ░▐███░▓██▌░▐███▐███▌ ▐███▌███▌░ ███▌███▌░ ██▓▀▄
  9.  ▐███▌░ ███▐███▌░ ███▐██▓▐███ ░▐███▐███ ░▐███▐███▌ ▐███▌███▌░░▓██ ▓██▌░ ██▌
  10.  ▐██▓ ░▐██▓▀▒██▄▄▄███▒██▓▐███▄▄██▒▀▓███▄▄████▀████▄▓███▀▓█▒▄ ▐█▀ ░▓███ ▐█▀
  11.   ▀      ▀░  ▀    ▀    ▀       ▀          ▀         ▀   ░    ▀      ▀  ▀
  12.   ·      ·    -  -- A C i D B U R N - P R O D U C T i O N S --  -    ·     ·
  13.                                 SRT - CRO
  14.  
  15.  
  16.                 CDilla Cracking:                        
  17.  
  18.              MidTown Madness French version : Another approach on cdilla    
  19.                                  
  20.         Tutorial by ACiD BuRN [Immortal Descendants]             
  21.                              (October 6th, 1999)         
  22.  
  23.  
  24.  
  25.  
  26. Tools needed : * Original CD of Midtown madness
  27.                * Soft ice 3.23             
  28.                * soft ice tool to patch sice (used to dump sections)
  29.                * Hexwork shop
  30.            * Frog ice (to hide soft ice)
  31.                * Procdump (for PE Editor)
  32.            * Exescope
  33.  
  34.  
  35.  
  36. Introduction:
  37.  
  38. hello all , i know there is already a tutor on Midtown madness by black check
  39. but the way to crack it is not the same than him , and i will explain more things
  40. than he did about pasting our new dumped sections in cracked exe :)
  41. i also assume you read this tut , and you know some things about PE file format...
  42.  
  43.  
  44.  
  45.  
  46.  
  47. let's kick cdilla 's ass :
  48.  
  49.  
  50. After installing your little game , PE edit the ".icd" files with procdump.
  51. (Fire up procdump , click on PE Editor , Browse to your ".icd" file , there it is
  52. Midtown.icd ...
  53. now , you must see : 
  54.  
  55.              - Entry Point : 00166C10
  56.              - Image Base  : 00400000
  57.  
  58. ok, we will need the OEP (original Entry point) later , so to have it just addition
  59. the Image base and the entry poing you get in procdump : 00400000 + 00166C10 = 566C10
  60.  
  61. now , click on the "sections" Button , to see all sections of the file :
  62.  
  63.  
  64. you will only need to have the Virtual Offset , Raw Size , and Raw Offset values!
  65.  
  66.  
  67. - for the ".text" section :
  68.  
  69.  
  70.    Virtual Offset: 00001000 
  71.          Raw Size: 18D78F
  72.        Raw Offset: 600
  73.  
  74.  
  75. - for the ".Rdata" section :
  76.  
  77.  
  78.    Virtual Offset: 0018F000
  79.          Raw Size: 14C99
  80.        Raw Offset: 18DE00
  81.  
  82.  
  83.  
  84. - for the ".data" section :
  85.  
  86.  
  87.    Virtual Offset: 001A4000
  88.          Raw Size: 3D8A4
  89.        Raw Offset: 1A2C00
  90.  
  91.  
  92.  
  93. - for the ".data1" section :
  94.  
  95.  
  96.    Virtual Offset: 00314000
  97.          Raw Size: 20
  98.        Raw Offset: 1E0600
  99.  
  100.  
  101. - for the ".rsrc" section :
  102.  
  103.  
  104.    Virtual Offset: 00315000
  105.          Raw Size: CB3
  106.        Raw Offset: 1E0800
  107.  
  108.  
  109. Now , we will dump all the sections of the ".icd" file , except the ".Rdata" , you will 
  110. later why....
  111. btw , you need to add the image base to the virtual Offset of all sections:
  112.  
  113. .text  : 400000 + 00001000 = 00401000
  114. .rdata : 400000 + 0018F000 = 0058F000
  115. .data  : 400000 + 001A4000 = 005A4000
  116. .data1 : 400000 + 00314000 = 00714000
  117. .rsrc  : 400000 + 00315000 = 00715000
  118.  
  119.  
  120. ok , now we gonna dump all this sections (except the .rdata)
  121. For this, we will need to but a breakpoint on the EOP (566C10 for us)
  122. btw , i assume you read the black check tutor , and you patched your Frog ice to
  123. hidde your soft ice , else go and read the nice tut before...
  124. Fire up your patched Frog ice , and run your original game.
  125. you will see a little video , at this time , make soft ice appears (ctrl+D) , and set 
  126. a bpx on the OEP: Bpx 56CC10 for this game!
  127. Press F5 to make the game runing again and close it after...
  128. now , Run it , and it normally breaks on 56CC10 , if it doesn't , look if you set the bpx
  129. to the good place (bl: you must get something like this:  #025F:56CC10)
  130. i assume it breaked , now u must can dump all the sections.
  131. Before dumping , disable all your bpx , we don't want shits in our dumped sections...
  132. the pagein command works like this : 
  133.  
  134. pagein "address to dump start" "size" "file name"
  135. so, just type this in soft ice:
  136.  
  137.  
  138. pagein 401000 18D78F c:\text.bin
  139. pagein 5A4000 3D8A4 c:\data.bin
  140. pagein 714000 20 c:\data1.bin
  141. pagein 715000 CB3 c:\rsrc.bin
  142.  
  143. ok, this dumped the section to our hard disk!!
  144.  
  145. now , we have to do the "nice" part !! dumping our rdata sections , but it is not
  146. like the others !!
  147. first of all , you have to get the real address of the fuction , so we will trace into
  148. the call to our rdata section.
  149.  
  150. After breaking , we land here:
  151.  
  152.  
  153. 00566C10   PUSH    EBP               <-- we break here , on entry point
  154. 00566C11   MOV     EBP,ESP
  155. 00566C13   PUSH    FF
  156. 00566C15   PUSH    005968D0
  157. 00566C1A   PUSH    00566724
  158. 00566C1F   MOV     EAX,FS:[00000000]
  159. 00566C25   PUSH    EAX
  160. 00566C26   MOV     FS:[00000000],ESP
  161. 00566C2D   ADD     ESP, -5C
  162. 00566C30   PUSH    EBX
  163. 00566C31   PUSH    ESI
  164. 00566C32   PUSH    EDI
  165. 00566C33   MOV     [EBP-18],ESP
  166. 00566C36   CALL    [0058F14C]        <-- this is the call in our rdata section , trace it (F8)
  167.  
  168.  
  169. in this call , we land here :
  170.  
  171. 009A6485     pushad
  172. 009A6486     push 00000031              
  173. 009A6488     push 00000000              ---> 0 mean kernels , it will be 1 for users... 
  174. 009A6490     call [9A64A6]               --> get the real address of the function (9A64A6)
  175. 009A6496     add esp, 8
  176. 009A6499     popad
  177. .......      jmp [XXXXXXXX]
  178.  
  179.  
  180. trace this code , and you see the jmp [XXXXXXXX] becoming jmp [KERNEL32!GetVersion]...
  181. ok , it is good , you are on the good way :)
  182. we are near done about starting to code te call fixer!!
  183. anyway , we need to know how many Kernels and users imports there is in this game!!
  184. Ok , to do this , there is severals way , you can dessassemble the ".icd" with wdasm
  185. and count them , you can trace in soft ice too , but i used a tool called EXESCOPE
  186. to see how many imports it got...
  187. anyway , in my midtown.icd , i got :
  188.  
  189. - 127 kernels import
  190. - 042 users import
  191.  
  192. ok , but we need to have this number in hexadecimal , coz soft ice use only hexa value =)
  193. 127 = 7Fh
  194.  42 = 2Ah
  195.  
  196. my favourite part come now !! coding the call fixer.
  197. first of all , we don't have writte access (read only access) to the Rdata section , so 
  198. we will move the rdata section to the data section place..
  199. For coding the call fixer , i start to code at EOP place , so enable your bpx on it , and 
  200. run the game again , wait until we break...
  201. now , we have to move rdata section in data section place in memory.
  202. To do this , just type :
  203.  
  204. m "virtual offset of data section + image base" l "rdata size" "data virtual offset"
  205. NOTE: For the data virtual offset , use a biger number , it is better...
  206. 5A4000 is our normal virtual offset , i used 5B0000 (bigger like i said)
  207.  
  208. so , just type this :
  209.  
  210. m 58F000 l 14C99 5B0000
  211.  
  212. ok, now time code !!
  213.  
  214. you are at the line : 566C10     PUSH   EBP
  215.  
  216. we will code something looking like this :
  217.  
  218. 00 pushad
  219. 01 push ebx
  220. 02 push 0
  221. 04 call [XXXXXXXX]
  222. 0A add esp,8
  223. 0D mov edx, XXXXXX 
  224. 12 cmp eax,[edx] 
  225. 14 je 20
  226. 16 inc edx
  227. 17 cmp edx, XXXXXX + XXXXX
  228. 1D jne 12
  229. 1F int 03       
  230. 20 mov [edx],ecx
  231. 22 popad
  232. 23 inc ebx
  233. 24 cmp ebx, XX  
  234. 2A jne 00
  235. 2C int 03
  236.  
  237. so , let's go :
  238.  
  239. Type in soft ice: A "press enter"
  240.  
  241. and code :
  242.  
  243. 566C10   pushad
  244. 566C11   push ebx
  245. 566C12   push 0
  246. 566C14   call [009A64A6]            <-- real address , we found this when we traced in the call
  247. 566C1A   add esp,8
  248. 566C1D   mov edx, 5B0000            <-- address where we copied our .rdata section in
  249. 566C22   cmp eax,[edx]    
  250. 566C24   je 566C40
  251. 566C26   inc edx
  252. 566C27   cmp edx, 5B0000 + 14C99    <-- adress where we copied our .rdata in + rdata size 
  253. 566C3D   jne 566C22
  254. 566C3F   int 03                     <-- safty, if it found no match, break here.
  255. 566C40   mov [edx],ecx    
  256. 566C42   popad
  257. 566C43   inc ebx
  258. 566C44   cmp ebx, 7F                <-- number of api to fix 
  259. 566C4A   jne 566C10
  260. 566C4C   int 03
  261.  
  262.  
  263. Now set ebx to 0 (R ebx 0) , set your eip to line 0 (line 0 = 566C10 here , so R EIP 566C10)
  264. type "i3here on" and press F5 to run it, normaly u should break on 566C4C...
  265. Now set your ebx back to 0, change line 02 (56CC12 here) to "push 1" and change line 24 to
  266. 'cmp ebx, user_import_number' (2A for us) and set the eip back line 0 (R EIP 566C10). 
  267. run it again.Normaly , all is ok now , it should break on 566C4C again...
  268. now , we can dump our rdata section safely:
  269.  
  270. pagein 5B0000 14C99 c:\rdata.bin
  271.  
  272.  
  273. hehe !! now we just have to rebuild a working executable file.
  274. i tried Procdump to import sections , but this bitch didn't change anything , so i
  275. imported manually my sections , i will show you all ;)
  276. In first , do a copy of the ".icd" file , for us : Midtown.icd , and rename it with the
  277. name you want , but with ".exe" extension.  ex: damnit.exe
  278.  
  279. Now , fire up hexworkshop , open "Damnit.exe" , and open the 1st section we dumped.
  280. it was : c:\text.bin...
  281.  
  282. it is now , you need the Raw offset of each section , i written them in 1st of the tut
  283. but i will rewritte them here , to help you understanding this crap :p
  284.  
  285.  
  286.  for the ".text" section : Raw Offset: 600         size : 18D78F 
  287. for the ".Rdata" section : Raw Offset: 18DE00      size : 14C99
  288.  for the ".data" section : Raw Offset: 1A2C00      size : 3D8A4
  289. for the ".data1" section : Raw Offset: 1E0600      size : 20
  290.  for the ".rsrc" section : Raw Offset: 1E0800      size : CB3
  291.  
  292.  
  293. ok , you got all shits here !! we want to do the 1st section ".text" so :
  294.  
  295. In hexworkshop , press alt+f5 , enter the Raw offset of the section you want to paste
  296. here : 600 , and click on ok. now go in the edit menu , and click on "select block"
  297. enter the size of the section , here : 18D78F...
  298. now , look at the other opened file (text.bin) , and press 'ctrl+a' to select all..
  299. now , go back to the main executable windown in hexworkshop , and paste the byte u just
  300. copied into the clipboard , do : 'ctrl+v' or edit menu , and paste...
  301. save your file , GOOD !! u just updated the '.text' section with our dumped section !!
  302.  
  303. ok , i do another section import with you , and you will do the others using the same way !
  304.  
  305. 2nd section : Rdata!
  306.  
  307. you can close the window 'text.bin' , and open with hexworkshop the file : 'rdata.bin'
  308. click on the main exe window , press 'alt+f5' , enter the size of the Raw Offset of
  309. the rdata section : 18DE00. Click on ok, go in edit menu , then "select block" , enter the
  310. rdata size section : 14C99...
  311. look the window of rdata.bin , press 'ctrl+a' to selection all bytes , and go back in
  312. main executable (damnit.exe) window in hexworkshop... now , just paste them with 'ctrl+c'
  313. or with paste in the edit menu..
  314.  
  315. ok , i think you understood now , just do the same with all sections , save your executable..
  316. Now , you can unload frog ice , coz the anti sice is not anymore in our rebuilded exe.
  317. remove the original cd of midtown madness , and run 'damnit.exe' or 'whateverunameit.exe'
  318. WOW , the game run , very quickly , without this lame window, saying us to wait during the
  319. cd verification , and voila !! the game is runing very well =)
  320. But , to make a perfect executable , you have to rebuild the file's pe like it is written
  321. in Black Check tutorial:
  322.  
  323. If you try to run it on another Windows 9x Version. It will crash. 
  324. it would only run on win98, cause the rdata section contained the address's of all the 
  325. functions from win98 (can be only on win95 if you cracked it on win95)
  326. The addresses we put in the import table are only valid for the Windows version we cracked 
  327. it on. Let's fix that:
  328.  
  329.  
  330. -Start Procdump (very good job G-RoM :)
  331. go to Options and select:
  332.  
  333. [v]Recompute Object Size
  334. [v]Optmize PE Structure
  335.  
  336. [X] Use actual import infos
  337. then , click on the OK button...
  338.  
  339. now , we just have to rebuild the file , click on Rebuild PE , and browse to your cracked
  340. file (Damnit.exe for my)
  341.  
  342. Procdump make us a valid import table and our executable is now fixed , and perfect !!!
  343. (i hope so ;p ) it should run on all win9x version of Windows...
  344.  
  345. Voila !! this tut is finish , but if you have any comments or question , just mail me!!
  346. Acid2600@hotmail.com or ACiD_BuRN@nema.com
  347.  
  348. you can also find all of my tutors here : http://acidburn2000.cjb.net/
  349.  
  350.  
  351.  
  352. Now , i want to give special greets to some ppls who helped me about cdilla :
  353.  
  354. - BIG FAT THX goes to R!SC for all the help , and answers to my questions...
  355. this dude rox !! he just cracked the new cdilla , PHEAR :p
  356.  
  357. - thx to noos , for some help too :)
  358. - Killer_3K : 'lo ;)
  359. - G-RoM , for procdump and some nice chat ;p
  360.  
  361. and now , my usual greetings for all my friends :
  362.  
  363.  
  364. Greetings: 
  365. group greetings : ID - ECLiPSE - CiA - ODT - EXEC - TiTaNe - PWA - PC - UCF- CORE- +HCU
  366.  
  367. Also greetingz to: (no specific order)
  368.  
  369. Cyber Blade, ^Inferno^, AB4DS,  Klefz, , Volatility, TORN@DO, T4D
  370. Jeff, [Virus], JaNe , Appbusta , Duelist , tKC , BuLLeT , Lucifer48 , 
  371. MiZ , DnNuke , Bjanes , Skymarshall , afkayas , elmopio , SiFLyiNG , 
  372. Fire Worx , Crackz , neural_en  , WarezPup , _y , SiONIDE , SKORPIEN
  373. Lazarus , Eternal_Bliss , Magic Raphoun , DEZM , Bisoux , Carpathia ,
  374. K17 , theMc , Xmen , TeeJi , JB007 , Arobas , T0AD ,ytc , Kwai_lo , 
  375. TaMaMBoLo , gizmo , Gota , ExtaBrain , Alpine , WarezPup , zoltan ...
  376.  
  377. eheh , i bet i forget some peoples :-/ , sorry !!!
  378.  
  379.             
  380.  
  381. copyright (c) ACiD BuRN and the Immortal Descendants.
  382.  
  383.             
  384.                 http://www.immortaldescendants.com/
  385.  
  386.  
  387.  
  388.