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< CommandToken > CommandTokens, string Command)
 .detach command handler

Variables

BOOLEAN g_IsVmmModuleLoaded
 shows whether the VMM module is loaded or not
ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
 State of active debugging thread.

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< CommandToken > CommandTokens,
string Command )

.detach command handler

Parameters
CommandTokens
Command
Returns
VOID
73{
74 if (CommandTokens.size() >= 2)
75 {
76 ShowMessages("incorrect use of the '%s'\n\n",
77 GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).c_str());
79 return;
80 }
81
82 //
83 // Perform detach from the process
84 //
86}
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
VOID DetachFromProcess()
perform detach from process
Definition detach.cpp:39
VOID CommandDetachHelp()
help of the .detach command
Definition detach.cpp:26

◆ 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:372
struct _DEBUGGER_ATTACH_DETACH_USER_MODE_PROCESS DEBUGGER_ATTACH_DETACH_USER_MODE_PROCESS
request for attaching user-mode process
#define AssertShowMessageReturnStmt(expr1, expr2, message1, message2, rc)
Definition common.h:59
#define ASSERT_MESSAGE_VMM_NOT_LOADED
Definition common.h:31
#define AssertReturn
Definition common.h:19
#define ASSERT_MESSAGE_DRIVER_NOT_LOADED
Definition common.h:27
HANDLE g_DeviceHandle
Holds the global handle of device which is used to send the request to the kernel by IOCTL,...
Definition globals.h:481
BOOLEAN g_IsVmmModuleLoaded
shows whether the VMM module is loaded or not
Definition globals.h:28
BOOLEAN UdDetachProcess(UINT32 TargetPid, UINT64 ProcessDetailToken)
Detach the target process.
Definition ud.cpp:786

Variable Documentation

◆ g_ActiveProcessDebuggingState

ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
extern

State of active debugging thread.

372{0};

◆ g_IsVmmModuleLoaded

BOOLEAN g_IsVmmModuleLoaded
extern

shows whether the VMM module is loaded or not