Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
zodiacon committed Nov 23, 2022
1 parent 0486803 commit 1ad3e87
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DiaHelper/DiaSession.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "DiaSymbol.h"

#include <atlcomcli.h>
#include <vector>
#include <string>

Expand Down
7 changes: 7 additions & 0 deletions DiaHelper/DiaSymbol.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "pch.h"
#include "DiaHelper.h"
#include "DiaSymbol.h"

DiaSymbol::DiaSymbol(IDiaSymbol* sym) : m_spSym(sym) {
}
Expand Down Expand Up @@ -73,6 +74,12 @@ SymbolTag DiaSymbol::Tag() const {
return SymbolTag(tag);
}

uint64_t DiaSymbol::Length() const {
ULONGLONG len;
m_spSym->get_length(&len);
return uint64_t(len);
}

DataItemKind DiaSymbol::Kind() const {
DWORD kind = 0;
m_spSym->get_dataKind(&kind);
Expand Down
4 changes: 3 additions & 1 deletion DiaHelper/DiaSymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <string>
#include <vector>
#include <atlcomcli.h>

struct IDiaSymbol;

Expand All @@ -21,11 +22,12 @@ class DiaSymbol {
DiaSymbol Type() const;
LocationKind Location() const;
SymbolTag Tag() const;
uint64_t Length() const;
DataItemKind Kind() const;
std::vector<DiaSymbol> FindChildren(SymbolTag tag = SymbolTag::Null, PCWSTR name = nullptr,
CompareOptions options = CompareOptions::None) const;

private:
protected:
DiaSymbol(IDiaSymbol* sym);

CComPtr<IDiaSymbol> m_spSym;
Expand Down
Binary file modified External/Capstone/capstone.lib
Binary file not shown.
Binary file modified External/tinyxml2.lib
Binary file not shown.
6 changes: 5 additions & 1 deletion TotalPE/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ TreeItemType CMainFrame::TreeItemWithIndex(TreeItemType type, int index) {

CString CMainFrame::DoFileOpen() const {
CSimpleFileDialog dlg(TRUE, nullptr, nullptr, OFN_EXPLORER | OFN_ENABLESIZING,
L"PE Files\0*.exe;*.dll;*.efi;*.ocx;*.cpl;*.sys;*.mui;*.mun\0All Files\0*.*\0");
L"PE Files\0*.exe;*.dll;*.efi;*.ocx;*.cpl;*.sys;*.mui;*.mun;*.scr\0All Files\0*.*\0");
ThemeHelper::Suspend();
auto path = IDOK == dlg.DoModal() ? dlg.m_szFileName : L"";
ThemeHelper::Resume();
Expand Down Expand Up @@ -688,3 +688,7 @@ LRESULT CMainFrame::OnShowWindow(UINT, WPARAM show, LPARAM, BOOL&) {
return 0;
}

LRESULT CMainFrame::OnMenuSelect(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
return 0;
}

2 changes: 2 additions & 0 deletions TotalPE/MainFrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class CMainFrame :
::SendMessage(m_CurrentView, WM_COMMAND, wParam, lParam);
}
MESSAGE_HANDLER(WM_DROPFILES, OnDropFiles)
MESSAGE_HANDLER(WM_MENUSELECT, OnMenuSelect)
MESSAGE_HANDLER(WM_SHOWWINDOW, OnShowWindow)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
Expand Down Expand Up @@ -107,6 +108,7 @@ class CMainFrame :
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCreateView(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnShowWindow(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnMenuSelect(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnDropFiles(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled);
LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
Expand Down
6 changes: 3 additions & 3 deletions TotalPE/ResourcesView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include "SortHelper.h"

LRESULT CResourcesView::OnCreate(UINT, WPARAM, LPARAM, BOOL&) {
m_hWndClient = m_Splitter.Create(m_hWnd, rcDefault, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);
m_hWndClient = m_Splitter.Create(m_hWnd, rcDefault, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0);
m_List.Create(m_Splitter, rcDefault, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
LVS_REPORT | LVS_OWNERDATA | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS);
LVS_REPORT | LVS_OWNERDATA | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS, 0);
m_List.SetExtendedListViewStyle(LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
m_HexView.Create(m_Splitter, rcDefault, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
m_HexView.Create(m_Splitter, rcDefault, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0);
m_HexView.SetDynamicAlloc(false);
m_HexView.GetHexControl().SetBytesPerLine(24);

Expand Down
6 changes: 5 additions & 1 deletion TotalPE/SymbolsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ int CSymbolsView::GetRowImage(HWND, int row, int col) const {
return 0;
}

int CSymbolsView::GetSaveColumnRange(int& start) const {
int CSymbolsView::GetSaveColumnRange(HWND, int& start) const {
return -1;
}

CString CSymbolsView::GetName(DiaSymbol const& sym) const {
return CString();
}

LRESULT CSymbolsView::OnCreate(UINT, WPARAM, LPARAM, BOOL&) {
m_hWndClient = m_List.Create(*this, rcDefault, nullptr, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
LVS_REPORT | LVS_OWNERDATA);
Expand Down
3 changes: 2 additions & 1 deletion TotalPE/SymbolsView.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class CSymbolsView :
CString GetColumnText(HWND, int row, int col) const;
void DoSort(SortInfo const* si);
int GetRowImage(HWND, int row, int col) const;
int GetSaveColumnRange(int& start) const;
int GetSaveColumnRange(HWND, int& start) const;
CString GetName(DiaSymbol const& sym) const;

BEGIN_MSG_MAP(CSymbolsView)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
Expand Down

0 comments on commit 1ad3e87

Please sign in to comment.