Guest User

Untitled

a guest
Feb 18th, 2013
783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. Tools:
  2. cff_patched by kao
  3. MegaDumper (ex DotnetDumper) http://forum.tuts4yo...umper-10/page-3
  4. ConfuserMethodsDecryptor http://forum.tuts4yo...thodsdecryptor/
  5. ModuleToAssembly http://forum.tuts4yo...etoassembly-10/
  6.  
  7. Universal Fixer http://forum.tuts4yo...niversal-fixer/
  8. and Hacked Reflector
  9.  
  10. Step1: Dumping the .NET module called "___.netmodule"
  11. Start MegaDumper (ex DotnetDumper)
  12. Select the option Main->Dumping Options->Don't restore file name
  13. since we want only addresses this time!
  14. Go on Main->Process Manager and select Confuser_UnpackMe.exe
  15. Click on Start!
  16. Now we watch for a memcpy with the source MZ (since it is an exe);
  17. First Source: 01D905F0 MZ?
  18. Go on the process Confuser_UnpackMe.exe; right click and choose Net Dump
  19. after that we choose "Go to Location" and we go under the Dump directory
  20. Open the file rawdump_01D905F0.dll under CFF Explorer
  21. and look under Module table - we should find "___.netmodule"
  22. Nop is not this one.
  23. We again click Continue for several time since no new Source with MZ finded
  24. MegaDumper stops for several times with no apparent reason (don't know why!)
  25. just click Continue
  26.  
  27. The last MZ before the application start is the right one:
  28. memcpy reached:
  29. Value of EBP:0012EA9C
  30. Old ESP: 0012ED00
  31. Return Address: 79493D82
  32. Source: 01C25248 MZ?
  33. len: (hex) 00038200
  34. Destination: 02C20000
  35.  
  36. Go on the process Confuser_UnpackMe.exe; right click and choose Net Dump
  37. Load rawdump_01C25248.dll under CFF Explorer
  38. and yes this has two modules - first one called "___.netmodule"
  39. so this is the right file.
  40. We rename this file to "___.netmodule"
  41. and we place it under same directory with Confuser_UnpackMe.exe
  42.  
  43. Step2: Restoring MSIL of "___.netmodule" with ConfuserMethodsDecryptor
  44. This is Framework 4.0 so we must have Confuser_Methods_Decryptor.exe.config
  45. under ConfuserMethodsDecryptor.exe directory.
  46. Simple select Confuser_UnpackMe.exe and "___.netmodule"
  47. and click on Decrypt.
  48.  
  49. Step3: Convert "___.netmodule" to a module using Module ModuleToAssembly
  50. Once again select Confuser_UnpackMe.exe and "____decryptedmethods.netmodule"
  51. and click on Convert.
  52.  
  53. Step4: Let's see if it runs: no it doesn't: we open the file in CFF Explorer
  54. and go at Nt Headers->File Headers; double click on Characteristics member
  55. and unmark "File is a DLL".
  56. We also go under Optional Header and we set Subsystem to 02 (Windows GUI).
  57.  
  58. Step5: Fix the file ____decryptedmethods_assembly.exe
  59. with Universal Fixer so we could load it under Hacked Reflector.
  60. We load the file under Reflector and we search for "GetHINSTANCE"
  61. using CodeSearch plugin for Reflector.
  62. We finded two methods the one we want is the smallest wich has 3 exception handlers.
  63. real token: 060000AC
  64.  
  65. This is the anti-tamper method, also the method wich decrypt methods!
  66. We go under CFF Explorer at index 172 (=AC in hex)
  67. and at RVA of method which is in this case is 0000D4B8
  68. and we change from 1B30 to 062A (a simply return).
  69. And job doned: the program runs!
Advertisement
Add Comment
Please, Sign In to add comment