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

Method ParseTableEntry

WinArk/ProcessInlineHookTable.cpp:44–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44int CProcessInlineHookTable::ParseTableEntry(CString& s, char& mask, int& select, InlineHookInfo& info, int column) {
45 switch (static_cast<Column>(column))
46 {
47 case Column::HookObject:
48 s = info.Name.c_str();
49 break;
50
51 case Column::HookType:
52 s = TypeToString(info.Type);
53 break;
54
55 case Column::Address:
56 {
57 auto& symbols = SymbolManager::Get();
58 DWORD64 offset = 0;
59 auto symbol = symbols.GetSymbolFromAddress(m_Pid, info.Address, &offset);
60 CStringA text;
61 if (symbol) {
62 auto sym = symbol->GetSymbolInfo();
63 if (offset != 0) {
64 text.Format("%s!%s+0x%X", symbol->ModuleInfo.ModuleName, sym->Name, (DWORD)offset);
65 }
66 else
67 text.Format("%s!%s", symbol->ModuleInfo.ModuleName, sym->Name);
68 std::string details = text.GetString();
69 std::wstring wdetails = Helpers::StringToWstring(details);
70 s.Format(L"0x%p (%s)", info.Address, wdetails.c_str());
71 }
72 else
73 s.Format(L"0x%p", info.Address);
74 break;
75 }
76
77 case Column::Module:
78 s = info.TargetModule.c_str();
79 break;
80
81 case Column::TargetAddress:
82 {
83 auto& symbols = SymbolManager::Get();
84 DWORD64 offset = 0;
85 auto symbol = symbols.GetSymbolFromAddress(m_Pid, info.TargetAddress, &offset);
86 CStringA text;
87 if (symbol) {
88 auto sym = symbol->GetSymbolInfo();
89 if (offset != 0) {
90 text.Format("%s!%s+0x%X", symbol->ModuleInfo.ModuleName, sym->Name, (DWORD)offset);
91 }
92 else
93 text.Format("%s!%s", symbol->ModuleInfo.ModuleName, sym->Name);
94 std::string details = text.GetString();
95 std::wstring wdetails = Helpers::StringToWstring(details);
96 s.Format(L"0x%p (%s)", info.TargetAddress, wdetails.c_str());
97 }
98 else
99 s.Format(L"0x%p", info.TargetAddress);
100 break;
101 }

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