home *** CD-ROM | disk | FTP | other *** search
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- ; Client Sample code for ProcDump32 Bhrama Server 0.3
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- ; Compilation :
- ;
- ; First edit path in Makefiles (bmake or mmake).
- ;
- ; Tasm :
- ; make -fbmake
- ;
- ; Masm :
- ; nmake /f mmake
- ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- ; Original version : Stone [Tag: 2nd&mi] - stone@one.se
- ; Release version : G-RoM - g-rom@innocent.com
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-
- .386P
- .MODEL FLAT, STDCALL ; with STDCALL we must reverse the sequence of pushes
- ; before a APIn call.
-
- UNICODE = 0 ; Needed for win32.inc
- INCLUDE WIN32.inc ; Windows definitions
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- ; API declarations
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- CreateProcessA WINAPI:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
- TerminateProcess WINAPI:DWORD,:DWORD
- SuspendThread WINAPI:DWORD
- ExitProcess WINAPI:DWORD
-
- MessageBoxA WINAPI:DWORD,:DWORD,:DWORD,:DWORD
- FindWindowA WINAPI:DWORD,:DWORD
- SendMessageA WINAPI:DWORD,:DWORD,:DWORD,:DWORD
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- ; Data Definitions
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- .DATA
- ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- szWeee db "Weeeeeeeeeeeeeeeeehhhhhh!!!",0
- szSuccesful db "It'll dump when you press OK!",0
- ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- szWindowName db "ProcDump32 - Dumper Server",0
-
- align 4
-
- dwdata dd 1 ; Dumper Service
- cbdata dd 20h ; Size Of Bhrama Struc
- lpdata dd offset BhramaStruc ; Pointer to Bhrama Struc
-
- BhramaStruc dd 00000003h ; Version 0.3
- B_pid dd 00000000h ; Targetted PID
- B_eip dd 00000000h ; EIP to set
- OptL1 dd 00000000h ;┐
- OptL2 dd 00000000h ;│
- OptL3 dd 00000000h ;│Options to use for dumping
- OptL4 dd 00000000h ;│ REQUIRED !!
- OptL5 dd 00000000h ;┘
- ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
- szFileName db "TARGET.EXE",0 ; Name of our Sample Target.
-
- align 4
- lpStartUpInfo STARTUPINFO <?> ;┐
- lpProcessInfo PROCESSINFORMATION <?> ;┘CreateProcess Structs
-
- tag db "2nd&mi" ; Stone Pers tag. not used
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- ; Code Start Here.
- ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
- .CODE
- start:
- ;────────────────────────────────────────────────────────────────────────────
- ; Init CreateProcess Crap.
- ;────────────────────────────────────────────────────────────────────────────
- mov edi, offset lpStartUpInfo
- mov ecx, STARTUPINFO_
- xor eax, eax
- rep stosb
- mov lpStartUpInfo.si_cb, STARTUPINFO_
- ;────────────────────────────────────────────────────────────────────────────
- ; Launch our Target.
- ;────────────────────────────────────────────────────────────────────────────
- push offset lpProcessInfo
- push offset lpStartUpInfo
- push NULL
- push NULL
- push NORMAL_PRIORITY_CLASS
- push FALSE
- push NULL
- push NULL
- push offset szFileName
- push NULL
- CALL CreateProcessA
- test eax, eax
- jz TerminateNOW
- ;────────────────────────────────────────────────────────────────────────────
- ; Display the MessageBox to wait user.
- ;────────────────────────────────────────────────────────────────────────────
- push 0
- push offset szWeee
- push offset szSuccesful
- push 0
- Call MessageBoxA
- ;────────────────────────────────────────────────────────────────────────────
- ; Freeze our Target.
- ;────────────────────────────────────────────────────────────────────────────
- push dword ptr [lpProcessInfo.pi_hThread]
- call SuspendThread
- ;────────────────────────────────────────────────────────────────────────────
- ; Feed ProcDump Communication Structures.
- ;────────────────────────────────────────────────────────────────────────────
- mov eax, [lpProcessInfo.pi_dwProcessId]
- mov [B_pid], eax ; Targetted PID.
- mov [B_eip], 01100h ; Sample EIP Just to show how to use
- ; Set it to 0 if u want to keep EIP
- ; untouched.
- mov [OptL1], 00000000h ;┐
- mov [OptL2], 01000001h ;│
- mov [OptL3], 01010001h ;│Upload Options to use.
- mov [OptL4], 00010000h ;│
- mov [OptL5], 00000000h ;┘
- ;────────────────────────────────────────────────────────────────────────────
- ; LookUp for ProcDump Server.
- ;────────────────────────────────────────────────────────────────────────────
- push offset szWindowName
- push 0
- call FindWindowA
- test eax, eax
- jz short NukeAndTerminate
- ;────────────────────────────────────────────────────────────────────────────
- ; Send Dump Message to ProcDump Server.
- ;────────────────────────────────────────────────────────────────────────────
- push offset dwdata
- push 0
- push WM_COPYDATA
- push eax
- call SendMessageA
- ;────────────────────────────────────────────────────────────────────────────
- ; Nuke Target & Quit.
- ;────────────────────────────────────────────────────────────────────────────
- NukeAndTerminate:
- push -28
- push dword ptr [lpProcessInfo.pi_hProcess]
- CALL TerminateProcess
- TerminateNOW:
- push 0
- call ExitProcess
- end start
-