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

.logclose command More...

#include "pch.h"

Functions

VOID CommandLogcloseHelp ()
 help .logclose command
VOID CommandLogclose (vector< CommandToken > CommandTokens, string Command)
 .logclose command handler

Variables

BOOLEAN g_LogOpened
 Shows whether the '.logopen' command is executed and the log file is open or not.
ofstream g_LogOpenFile
 The object of log file ('.logopen' command).

Detailed Description

.logclose command

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

Function Documentation

◆ CommandLogclose()

VOID CommandLogclose ( vector< CommandToken > CommandTokens,
string Command )

.logclose command handler

Parameters
CommandTokens
Command
Returns
VOID
43{
44 if (CommandTokens.size() != 1)
45 {
46 ShowMessages("incorrect use of the '%s'\n\n",
47 GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).c_str());
49 return;
50 }
51 if (!g_LogOpened)
52 {
53 ShowMessages("there is no opened log, did you use '.logopen'? \n");
54 return;
55 }
56
57 //
58 // Show the time and message before close
59 //
60 time_t t = time(NULL);
61 struct tm tm = *localtime(&t);
62 ShowMessages("log file closed (%d-%02d-%02d "
63 "%02d:%02d:%02d)\n",
64 tm.tm_year + 1900,
65 tm.tm_mon + 1,
66 tm.tm_mday,
67 tm.tm_hour,
68 tm.tm_min,
69 tm.tm_sec);
70 //
71 // close the file
72 //
73 g_LogOpenFile.close();
74
75 //
76 // Globally indicate that file is no longer available
77 //
79}
#define FALSE
Definition BasicTypes.h:113
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
ofstream g_LogOpenFile
The object of log file ('.logopen' command).
Definition globals.h:494
VOID CommandLogcloseHelp()
help .logclose command
Definition logclose.cpp:26
BOOLEAN g_LogOpened
Shows whether the '.logopen' command is executed and the log file is open or not.
Definition globals.h:488

◆ CommandLogcloseHelp()

VOID CommandLogcloseHelp ( )

help .logclose command

Returns
VOID
27{
28 ShowMessages(".logclose : closes the previously opened log.\n\n");
29
30 ShowMessages("syntax : \t.logclose\n");
31}

Variable Documentation

◆ g_LogOpened

BOOLEAN g_LogOpened
extern

Shows whether the '.logopen' command is executed and the log file is open or not.

◆ g_LogOpenFile

ofstream g_LogOpenFile
extern

The object of log file ('.logopen' command).