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

.logclose command handler

Parameters
SplitCommand
Command
Returns
VOID
42{
43 if (SplitCommand.size() != 1)
44 {
45 ShowMessages("incorrect use of the '.logclose'\n\n");
47 return;
48 }
49 if (!g_LogOpened)
50 {
51 ShowMessages("there is no opened log, did you use '.logopen'? \n");
52 return;
53 }
54
55 //
56 // Show the time and message before close
57 //
58 time_t t = time(NULL);
59 struct tm tm = *localtime(&t);
60 ShowMessages("log file closed (%d-%02d-%02d "
61 "%02d:%02d:%02d)\n",
62 tm.tm_year + 1900,
63 tm.tm_mon + 1,
64 tm.tm_mday,
65 tm.tm_hour,
66 tm.tm_min,
67 tm.tm_sec);
68 //
69 // close the file
70 //
71 g_LogOpenFile.close();
72
73 //
74 // Globally indicate that file is no longer available
75 //
77}
#define FALSE
Definition BasicTypes.h:54
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
BOOLEAN g_LogOpened
Shows whether the '.logopen' command is executed and the log file is open or not.
Definition globals.h:478
ofstream g_LogOpenFile
The object of log file ('.logopen' command)
Definition globals.h:484
VOID CommandLogcloseHelp()
help .logclose command
Definition logclose.cpp:26

◆ 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)