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

Method LoadSymbolsThread

WinArk/CallStackDlg.cpp:13–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13DWORD CCallStackDlg::LoadSymbolsThread() {
14 auto stack = m_pData->GetStackEventData();
15 auto& symbols = SymbolManager::Get();
16 auto pid = stack->GetProperty(L"StackProcess")->GetValue<DWORD>();
17
18 CString num;
19 for (int i = 1; i <= 192; i++) {
20 if (m_ExitSymbolThread)
21 break;
22
23 num.Format(L"Stack%d", i);
24 auto prop = stack->GetProperty(num);
25 if (prop == nullptr)
26 break;
27
28 DWORD64 address;
29 if (prop->GetLength() == 4)
30 address = prop->GetValue<DWORD>();
31 else
32 address = prop->GetValue<DWORD64>();
33 DWORD64 offset = 0;
34 auto symbol = symbols.GetSymbolFromAddress(pid, address, &offset);
35 if (symbol) {
36 auto sym = symbol->GetSymbolInfo();
37 CStringA text;
38 text.Format("%s!%s+0x%X", symbol->ModuleInfo.ModuleName, sym->Name, (DWORD)offset);
39 SendMessage(WM_USER + 100, i, (LPARAM)(PCSTR)text);
40 }
41 }
42 SendMessage(WM_USER + 100, 0, 0);
43
44 return 0;
45}
46
47LRESULT CCallStackDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) {
48 m_List.Attach(GetDlgItem(IDC_LIST));

Callers 1

OnInitDialogMethod · 0.80

Calls 5

GetStackEventDataMethod · 0.80
GetPropertyMethod · 0.80
GetLengthMethod · 0.45
GetSymbolFromAddressMethod · 0.45
GetSymbolInfoMethod · 0.45

Tested by

no test coverage detected