44{
46 wstring Filepath;
48
49 if (SplitCommand.size() <= 2)
50 {
51 ShowMessages(
"err, incorrect use of the '.pe' command\n\n");
53 return;
54 }
55
56
57
58
59 if (!SplitCommand.at(1).compare("section"))
60 {
61 if (SplitCommand.size() == 3)
62 {
65 return;
66 }
67 ShowDumpOfSection =
TRUE;
68 }
69 else if (!SplitCommand.at(1).compare("header"))
70 {
71 ShowDumpOfSection =
FALSE;
72 }
73 else
74 {
75
76
77
79 SplitCommand.at(1).c_str());
81 return;
82 }
83
84
85
86
88
89
90
91
92 Command.erase(0, SplitCommand.at(0).size());
93
94 if (!ShowDumpOfSection)
95 {
96
97
98
99 Command.erase(0, 6 + 1);
100 }
101 else
102 {
103
104
105
106 Command.erase(0, 7 + 1);
107
108
109
110
111 Command.erase(0, SplitCommand.at(2).size() + 1);
112 }
113
114
115
116
118
119
120
121
123
124
125
126
128 {
129
130
131
132 return;
133 }
134
135
136
137
138 if (!ShowDumpOfSection)
139 {
141 }
142 else
143 {
145 }
146}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
VOID StringToWString(std::wstring &ws, const std::string &s)
convert std::string to std::wstring
Definition common.cpp:729
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 PeIsPE32BitOr64Bit(const WCHAR *AddressOfFile, PBOOLEAN Is32Bit)
Detect whether PE is a 32-bit PE or 64-bit PE.
Definition pe-parser.cpp:482
BOOLEAN PeShowSectionInformationAndDump(const WCHAR *AddressOfFile, const CHAR *SectionToShow, BOOLEAN Is32Bit)
Show information about different sections of PE and the dump of sections.
Definition pe-parser.cpp:75
VOID CommandPeHelp()
help of the .pe command
Definition pe.cpp:22