forked from zodiacon/ObjectExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show structures for common kernel object types
- Loading branch information
Showing
17 changed files
with
129 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
#pragma once | ||
|
||
#include <map> | ||
|
||
struct ObjectHelpers abstract final { | ||
static UINT ShowObjectProperties(HANDLE hObject, PCWSTR typeName, PCWSTR name = nullptr, PCWSTR target = nullptr, DWORD handleCount = 0); | ||
static std::vector<std::pair<CString, CString>> GetSimpleProps(HANDLE hObject, PCWSTR type, PCWSTR name, PCWSTR target = nullptr); | ||
static bool IsNamedObjectType(USHORT index); | ||
|
||
inline static std::map<CString, CString> KernelTypes{ | ||
{ L"ALPC Port", L"_ALPC_PORT" }, | ||
{ L"Process", L"_EPROCESS" }, | ||
{ L"Semaphore", L"_KSEMAPHORE" }, | ||
{ L"Job", L"_EJOB" }, | ||
{ L"Mutant", L"_KMUTANT" }, | ||
{ L"Event", L"_KEVENT" }, | ||
{ L"Thread", L"_ETHREAD" }, | ||
{ L"Section", L"_SECTION" }, | ||
{ L"File", L"_FILE_OBJECT" }, | ||
{ L"Type", L"_OBJECT_TYPE" }, | ||
{ L"Key", L"_CM_KEY_BODY" }, | ||
{ L"Token", L"_TOKEN" }, | ||
{ L"SymbolicLink", L"_OBJECT_SYMBOLIC_LINK" }, | ||
{ L"Driver", L"_DRIVER_OBJECT" }, | ||
{ L"Device", L"_DEVICE_OBJECT" }, | ||
}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
#include "pch.h" | ||
#include "StructurePage.h" | ||
#include "DiaHelper.h" | ||
#include "SymbolToTreeView.h" | ||
#include "TreeListView.h" | ||
|
||
CStructPage::CStructPage(HANDLE hObject, DiaSymbol const& sym) : m_hObject(hObject), m_Object(sym) { | ||
CStructPage::CStructPage(HANDLE hObject) : m_hObject(hObject), m_Object(DiaSymbol::Empty) { | ||
} | ||
|
||
void CStructPage::SetSymbol(DiaSymbol sym, PVOID address) { | ||
m_Object = std::move(sym); | ||
m_Address = address; | ||
} | ||
|
||
LRESULT CStructPage::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) { | ||
InitDynamicLayout(); | ||
InitDynamicLayout(false); | ||
|
||
m_Tree.SubclassWindow(GetDlgItem(IDC_TREE)); | ||
auto header = m_Tree.GetHeaderControl(); | ||
HDITEM col = { 0 }; | ||
col.mask = HDI_FORMAT | HDI_TEXT | HDI_WIDTH; | ||
col.fmt = HDF_LEFT; | ||
col.cxy = 150; | ||
col.pszText = (PWSTR)_T("Member"); | ||
header.InsertItem(0, &col); | ||
col.cxy = 150; | ||
col.pszText = (PWSTR)_T("Type"); | ||
header.InsertItem(1, &col); | ||
col.cxy = 150; | ||
col.pszText = (PWSTR)_T("Value"); | ||
header.InsertItem(2, &col); | ||
|
||
SymbolToTreeView::FillTreeView(m_Tree, TVI_ROOT, m_Object); | ||
m_Tree.AddColumn(L"Member", 200); | ||
m_Tree.AddColumn(L"Type", 180); | ||
m_Tree.AddColumn(L"Value", 150); | ||
m_Tree.AddColumn(L"Details", 150); | ||
m_font.CreatePointFont(100, L"Consolas"); | ||
m_Tree.GetTreeControl().SetFont(m_font); | ||
|
||
CImageList images; | ||
images.Create(16, 16, ILC_COLOR32, 8, 0); | ||
UINT icons[] = { IDI_STRUCT, IDI_UNION, IDI_FIELD, IDI_ENUM, IDI_BITFIELD }; | ||
for (auto icon : icons) | ||
images.AddIcon(AtlLoadIconImage(icon, 0, 16, 16)); | ||
m_Tree.GetTreeControl().SetImageList(images); | ||
|
||
auto hRoot = m_Tree.GetTreeControl().InsertItem(m_Object.Name().c_str(), 0, 0, TVI_ROOT, TVI_LAST); | ||
SymbolToTreeView::FillTreeView(m_Tree, hRoot, m_Object); | ||
m_Tree.GetTreeControl().Expand(hRoot, TVE_EXPAND); | ||
|
||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters