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

Method ParseTableEntry

WinArk/ProcessATHookTable.cpp:27–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27int CProcessATHookTable::ParseTableEntry(CString& s, char& mask, int& select, EATHookInfo& info, int column) {
28 switch (static_cast<Column>(column))
29 {
30 case Column::HookObject:
31 s = info.Name.c_str();
32 break;
33
34 case Column::HookType:
35 s = TypeToString(info.Type);
36 break;
37
38 case Column::Address:
39 {
40 auto& symbols = SymbolManager::Get();
41 DWORD64 offset = 0;
42 auto symbol = symbols.GetSymbolFromAddress(m_Pid, info.Address, &offset);
43 CStringA text;
44 if (symbol) {
45 auto sym = symbol->GetSymbolInfo();
46 if (offset != 0) {
47 text.Format("%s!%s+0x%X", symbol->ModuleInfo.ModuleName, sym->Name, (DWORD)offset);
48 }
49 else
50 text.Format("%s!%s", symbol->ModuleInfo.ModuleName, sym->Name);
51 std::string details = text.GetString();
52 std::wstring wdetails = Helpers::StringToWstring(details);
53 s.Format(L"0x%p (%s)", info.Address, wdetails.c_str());
54 }
55 else
56 s.Format(L"0x%p", info.Address);
57 break;
58 }
59
60 case Column::Module:
61 s = info.TargetModule.c_str();
62 break;
63
64 case Column::TargetAddress:
65 {
66 auto& symbols = SymbolManager::Get();
67 DWORD64 offset = 0;
68 auto symbol = symbols.GetSymbolFromAddress(m_Pid, info.TargetAddress, &offset);
69 CStringA text;
70 if (symbol) {
71 auto sym = symbol->GetSymbolInfo();
72 if (offset != 0) {
73 text.Format("%s!%s+0x%X", symbol->ModuleInfo.ModuleName, sym->Name, (DWORD)offset);
74 }
75 else
76 text.Format("%s!%s", symbol->ModuleInfo.ModuleName, sym->Name);
77 std::string details = text.GetString();
78 std::wstring wdetails = Helpers::StringToWstring(details);
79 s.Format(L"0x%p (%s)", info.TargetAddress, wdetails.c_str());
80 }
81 else
82 s.Format(L"0x%p", info.TargetAddress);
83 break;
84 }

Callers

nothing calls this directly

Calls 4

GetStringMethod · 0.80
GetSymbolFromAddressMethod · 0.45
GetSymbolInfoMethod · 0.45
GetLengthMethod · 0.45

Tested by

no test coverage detected