home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Tools / ProcDump 1.6.2 / BHRAMA / ASM / CLIENT.ASM < prev    next >
Encoding:
Assembly Source File  |  1999-03-21  |  5.7 KB  |  149 lines

  1. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  2. ; Client Sample code for ProcDump32 Bhrama Server 0.3
  3. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  4. ; Compilation :
  5. ;
  6. ; First edit path in Makefiles (bmake or mmake).
  7. ;
  8. ; Tasm :
  9. ;  make -fbmake
  10. ;
  11. ; Masm :
  12. ;  nmake /f mmake
  13. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  14. ; Original version : Stone [Tag: 2nd&mi] - stone@one.se
  15. ; Release  version : G-RoM               - g-rom@innocent.com
  16. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  17.  
  18.         .386P
  19.         .MODEL FLAT, STDCALL    ; with STDCALL we must reverse the sequence of pushes
  20.                     ; before a APIn call.
  21.  
  22. UNICODE = 0                    ; Needed for win32.inc
  23. INCLUDE WIN32.inc                ; Windows definitions
  24. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  25. ; API declarations
  26. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  27. CreateProcessA        WINAPI:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
  28. TerminateProcess    WINAPI:DWORD,:DWORD
  29. SuspendThread        WINAPI:DWORD
  30. ExitProcess        WINAPI:DWORD
  31.  
  32. MessageBoxA        WINAPI:DWORD,:DWORD,:DWORD,:DWORD
  33. FindWindowA        WINAPI:DWORD,:DWORD
  34. SendMessageA        WINAPI:DWORD,:DWORD,:DWORD,:DWORD
  35. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  36. ; Data Definitions
  37. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  38.         .DATA
  39. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  40. szWeee    db "Weeeeeeeeeeeeeeeeehhhhhh!!!",0
  41. szSuccesful     db "It'll dump when you press OK!",0
  42. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  43. szWindowName    db "ProcDump32 - Dumper Server",0
  44.  
  45. align 4
  46.  
  47.  dwdata    dd 1                ; Dumper Service
  48.  cbdata    dd 20h                          ; Size Of Bhrama Struc
  49.  lpdata    dd offset BhramaStruc           ; Pointer to Bhrama Struc
  50.  
  51. BhramaStruc    dd 00000003h                    ; Version 0.3
  52.  B_pid    dd 00000000h                    ; Targetted PID
  53.  B_eip    dd 00000000h                    ; EIP to set
  54.  OptL1         dd 00000000h                    ;┐
  55.  OptL2         dd 00000000h                    ;│
  56.  OptL3         dd 00000000h                    ;│Options to use for dumping
  57.  OptL4         dd 00000000h                    ;│        REQUIRED !!
  58.  OptL5         dd 00000000h                    ;┘
  59. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  60. szFileName    db "TARGET.EXE",0               ; Name of our Sample Target.
  61.  
  62. align 4
  63. lpStartUpInfo  STARTUPINFO <?>                 ;┐
  64. lpProcessInfo  PROCESSINFORMATION <?>          ;┘CreateProcess Structs
  65.  
  66. tag        db "2nd&mi"        ; Stone Pers tag. not used
  67. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  68. ; Code Start Here.
  69. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  70.         .CODE
  71. start:
  72. ;────────────────────────────────────────────────────────────────────────────
  73. ; Init CreateProcess Crap.
  74. ;────────────────────────────────────────────────────────────────────────────
  75.     mov  edi, offset lpStartUpInfo
  76.     mov  ecx, STARTUPINFO_
  77.     xor  eax, eax
  78.     rep  stosb
  79.     mov  lpStartUpInfo.si_cb, STARTUPINFO_
  80. ;────────────────────────────────────────────────────────────────────────────
  81. ; Launch our Target.
  82. ;────────────────────────────────────────────────────────────────────────────
  83.     push    offset lpProcessInfo
  84.     push    offset lpStartUpInfo
  85.     push    NULL
  86.     push    NULL
  87.     push    NORMAL_PRIORITY_CLASS
  88.     push    FALSE
  89.     push    NULL
  90.     push    NULL
  91.     push    offset szFileName
  92.     push    NULL
  93.     CALL    CreateProcessA
  94.     test    eax, eax
  95.     jz    TerminateNOW
  96. ;────────────────────────────────────────────────────────────────────────────
  97. ; Display the MessageBox to wait user.
  98. ;────────────────────────────────────────────────────────────────────────────
  99.     push    0
  100.     push    offset szWeee
  101.     push    offset szSuccesful
  102.     push    0
  103.     Call    MessageBoxA
  104. ;────────────────────────────────────────────────────────────────────────────
  105. ; Freeze our Target.
  106. ;────────────────────────────────────────────────────────────────────────────
  107.     push    dword ptr [lpProcessInfo.pi_hThread]
  108.     call    SuspendThread
  109. ;────────────────────────────────────────────────────────────────────────────
  110. ; Feed ProcDump Communication Structures.
  111. ;────────────────────────────────────────────────────────────────────────────
  112.     mov    eax, [lpProcessInfo.pi_dwProcessId]
  113.     mov    [B_pid], eax       ; Targetted PID.
  114.     mov    [B_eip], 01100h    ; Sample EIP Just to show how to use
  115.                    ; Set it to 0 if u want to keep EIP
  116.                    ; untouched.
  117.                mov     [OptL1], 00000000h ;┐
  118.                mov     [OptL2], 01000001h ;│
  119.                mov     [OptL3], 01010001h ;│Upload Options to use.
  120.                mov     [OptL4], 00010000h ;│
  121.                mov     [OptL5], 00000000h ;┘
  122. ;────────────────────────────────────────────────────────────────────────────
  123. ; LookUp for ProcDump Server.
  124. ;────────────────────────────────────────────────────────────────────────────
  125.     push    offset szWindowName
  126.     push    0
  127.     call    FindWindowA
  128.     test    eax, eax
  129.     jz    short NukeAndTerminate
  130. ;────────────────────────────────────────────────────────────────────────────
  131. ; Send Dump Message to ProcDump Server.
  132. ;────────────────────────────────────────────────────────────────────────────
  133.     push    offset dwdata
  134.     push    0
  135.     push    WM_COPYDATA
  136.     push    eax
  137.     call    SendMessageA
  138. ;────────────────────────────────────────────────────────────────────────────
  139. ; Nuke Target & Quit.
  140. ;────────────────────────────────────────────────────────────────────────────
  141. NukeAndTerminate:
  142.     push    -28
  143.     push    dword ptr [lpProcessInfo.pi_hProcess]
  144.     CALL    TerminateProcess
  145. TerminateNOW:
  146.     push    0
  147.     call    ExitProcess
  148. end start
  149.