MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / ParseTableEntry

Method ParseTableEntry

WinArk/ProcessModuleTable.cpp:124–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124int CProcessModuleTable::ParseTableEntry(CString& s, char& mask, int& select, std::shared_ptr<WinSys::ModuleInfo>& info, int column) {
125 switch (static_cast<ModuleColumn>(column)) {
126 case ModuleColumn::ModuleName:
127 s = info->Name.empty() ? L"<Pagefile Backed>" : info->Name.c_str();
128 break;
129
130 case ModuleColumn::Type:
131 s = info->Type == WinSys::MapType::Image ? L"Image" : L"Data";
132 break;
133
134 case ModuleColumn::Bit:
135 if (info->Type == WinSys::MapType::Image) {
136 PEParser parser(info->Path.c_str());
137 s = parser.IsPe64() ? L"x64" : L"x86";
138
139 bool isExecutable = parser.IsExecutable();
140 parser.GetImports();
141 }
142 else {
143 s = L"N/A";
144 }
145 break;
146
147 case ModuleColumn::ModuleSize:
148 s.Format(L"0x%08X", info->ModuleSize);
149 break;
150
151 case ModuleColumn::Base:
152 s.Format(L"0x%p", info->Base);
153 break;
154
155 case ModuleColumn::ImageBase:
156 if (info->Type == WinSys::MapType::Image)
157 s.Format(L"0x%p", info->ImageBase);
158 else
159 s = L"N/A";
160 break;
161
162 case ModuleColumn::Characteristics:
163 s = info->Type == WinSys::MapType::Image ? CharacteristicsToString(info->Characteristics) : CString();
164 break;
165
166 case ModuleColumn::Path:
167 s = info->Path.c_str();
168 break;
169
170 case ModuleColumn::FileDescription:
171 if (info->Type == WinSys::MapType::Image) {
172 s = GetFileDescription(info->Path).c_str();
173 }
174 break;
175 }
176 return s.GetLength();
177}
178
179CProcessModuleTable::ModuleInfoEx& CProcessModuleTable::GetModuleEx(WinSys::ModuleInfo* mi) {
180 auto it = m_ModulesEx.find(mi);

Callers

nothing calls this directly

Calls 5

emptyMethod · 0.80
IsExecutableMethod · 0.80
GetImportsMethod · 0.80
IsPe64Method · 0.45
GetLengthMethod · 0.45

Tested by

no test coverage detected