44{
45 if (SplitCommand.size() == 1)
46 {
49 return;
50 }
51
53 {
54 ShowMessages(
"log was opened previously, you have the close it first "
55 "(using .logclose)\n");
56 return;
57 }
58
59
60
61
63
64
65
66
67 Command.erase(0, SplitCommand.at(0).size());
68
69
70
71
73
74
75
76
78
79
80
81
83 {
84
85
86
88
89
90
91
92 time_t t = time(NULL);
93 struct tm tm = *localtime(&t);
94
95 ShowMessages(
"save commands and results into file : %s (%d-%02d-%02d "
96 "%02d:%02d:%02d)\n",
97 Command.c_str(),
98 tm.tm_year + 1900,
99 tm.tm_mon + 1,
100 tm.tm_mday,
101 tm.tm_hour,
102 tm.tm_min,
103 tm.tm_sec);
104 }
105 else
106 {
107 ShowMessages(
"unable to open file : %s\n", Command.c_str());
108 return;
109 }
110}
#define TRUE
Definition BasicTypes.h:55
void Trim(std::string &s)
trim from both ends and start of a string (in place)
Definition common.cpp:594
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
VOID CommandLogopenHelp()
help of the .logopen command
Definition logopen.cpp:28
ofstream g_LogOpenFile
The object of log file ('.logopen' command)
Definition globals.h:484