HyperDbg Debugger
Loading...
Searching...
No Matches
detach.cpp File Reference

.detach command More...

#include "pch.h"

Functions

VOID CommandDetachHelp ()
 help of the .detach command
 
VOID DetachFromProcess ()
 perform detach from process
 
VOID CommandDetach (vector< string > SplitCommand, string Command)
 .detach command handler
 

Variables

ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
 State of active debugging thread.
 
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
 Shows if the debugger was connected to remote debuggee over (A remote guest)
 

Detailed Description

.detach command

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.1
Date
2020-08-28

Function Documentation

◆ CommandDetach()

VOID CommandDetach ( vector< string > SplitCommand,
string Command )

.detach command handler

Parameters
SplitCommand
Command
Returns
VOID
72{
73 if (SplitCommand.size() >= 2)
74 {
75 ShowMessages("incorrect use of the '.detach'\n\n");
77 return;
78 }
79
80 //
81 // .attach and .detach commands are only supported in VMI Mode
82 //
84 {
85 ShowMessages("err, '.attach', and '.detach' commands are only usable "
86 "in VMI Mode, you can use the '.process', or the '.thread' "
87 "in Debugger Mode\n");
88 return;
89 }
90
91 //
92 // Perform detach from the process
93 //
95}
VOID DetachFromProcess()
perform detach from process
Definition detach.cpp:39
VOID CommandDetachHelp()
help of the .detach command
Definition detach.cpp:26
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96

◆ CommandDetachHelp()

VOID CommandDetachHelp ( )

help of the .detach command

Returns
VOID
27{
28 ShowMessages(".detach : detaches from debugging a user-mode process.\n\n");
29
30 ShowMessages("syntax : \t.detach \n");
31}

◆ DetachFromProcess()

VOID DetachFromProcess ( )

perform detach from process

Returns
VOID
40{
42
43 //
44 // Check if debugger is loaded or not
45 //
47
48 //
49 // Check if we attached to a process or not
50 //
52 {
53 ShowMessages("you're not attached to any thread\n");
54 return;
55 }
56
57 //
58 // Perform the detaching of the target process
59 //
61}
ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
State of active debugging thread.
Definition globals.h:362
#define AssertShowMessageReturnStmt(expr, message, rc)
Definition common.h:51
#define AssertReturn
Definition common.h:19
#define ASSERT_MESSAGE_DRIVER_NOT_LOADED
Definition common.h:25
HANDLE g_DeviceHandle
Holds the global handle of device which is used to send the request to the kernel by IOCTL,...
Definition globals.h:471
UINT32 ProcessId
Definition ud.h:51
BOOLEAN IsActive
Definition ud.h:49
UINT64 ProcessDebuggingToken
Definition ud.h:50
request for attaching user-mode process
Definition RequestStructures.h:631
BOOLEAN UdDetachProcess(UINT32 TargetPid, UINT64 ProcessDetailToken)
Detach the target process.
Definition ud.cpp:764

Variable Documentation

◆ g_ActiveProcessDebuggingState

ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
extern

State of active debugging thread.

362{0};

◆ g_IsSerialConnectedToRemoteDebuggee

BOOLEAN g_IsSerialConnectedToRemoteDebuggee
extern

Shows if the debugger was connected to remote debuggee over (A remote guest)