Skip to content

Commit 85ac085

Browse files
修复了多语言设置未正确应用于文本显示的问题
解决了窗口最小化后重新打开时布局显示不正确的BUG 实现了对虚函数表的正常查看功能 新增了自动生成缓存文件的功能
1 parent 1ccc9e3 commit 85ac085

21 files changed

Lines changed: 961 additions & 73 deletions

PDBViewer.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ END
5353
//
5454

5555
1 VERSIONINFO
56-
FILEVERSION 1,0,0,0
57-
PRODUCTVERSION 1,0,0,0
56+
FILEVERSION 1,1,0,0
57+
PRODUCTVERSION 1,1,0,0
5858
FILEFLAGSMASK 0x3fL
5959
#ifdef _DEBUG
6060
FILEFLAGS 0x1L
@@ -76,7 +76,7 @@ BEGIN
7676
VALUE "LegalCopyright", "Copyright (C) 2026 StackAndPointer"
7777
VALUE "OriginalFilename", "PDB Insight.exe"
7878
VALUE "ProductName", "PDB Insight"
79-
VALUE "ProductVersion", "1.0"
79+
VALUE "ProductVersion", "1.1"
8080
END
8181
END
8282
BLOCK "VarFileInfo"

PDBViewer.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<ConformanceMode>true</ConformanceMode>
8080
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
8181
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)src;$(ProjectDir)src\Core;$(ProjectDir)src\Managers;$(ProjectDir)src\PDB;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
82+
<LanguageStandard>stdcpp17</LanguageStandard>
8283
</ClCompile>
8384
<Link>
8485
<SubSystem>Windows</SubSystem>
@@ -95,6 +96,7 @@
9596
<ConformanceMode>true</ConformanceMode>
9697
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
9798
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)src;$(ProjectDir)src\Core;$(ProjectDir)src\Managers;$(ProjectDir)src\PDB;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
99+
<LanguageStandard>stdcpp17</LanguageStandard>
98100
</ClCompile>
99101
<Link>
100102
<SubSystem>Windows</SubSystem>
@@ -109,6 +111,7 @@
109111
<ConformanceMode>true</ConformanceMode>
110112
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
111113
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)src;$(ProjectDir)src\Core;$(ProjectDir)src\Managers;$(ProjectDir)src\PDB;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
114+
<LanguageStandard>stdcpp17</LanguageStandard>
112115
</ClCompile>
113116
<Link>
114117
<SubSystem>Windows</SubSystem>
@@ -126,6 +129,7 @@
126129
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
127130
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)src;$(ProjectDir)src\Core;$(ProjectDir)src\Managers;$(ProjectDir)src\PDB;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
128131
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
132+
<LanguageStandard>stdcpp17</LanguageStandard>
129133
</ClCompile>
130134
<Link>
131135
<SubSystem>Windows</SubSystem>
@@ -155,6 +159,7 @@
155159
<ClInclude Include="src\Managers\SearchOptimizer.h" />
156160
<ClInclude Include="src\Managers\SettingsManager.h" />
157161
<ClInclude Include="src\Managers\TreeViewManager.h" />
162+
<ClInclude Include="src\Managers\CacheManager.h" />
158163
<ClInclude Include="src\PDB\cvConst.h" />
159164
<ClInclude Include="src\PDB\dia2.h" />
160165
<ClInclude Include="src\PDB\diaCreate.h" />
@@ -185,6 +190,7 @@
185190
<ClCompile Include="src\Managers\SearchOptimizer.cpp" />
186191
<ClCompile Include="src\Managers\SettingsManager.cpp" />
187192
<ClCompile Include="src\Managers\TreeViewManager.cpp" />
193+
<ClCompile Include="src\Managers\CacheManager.cpp" />
188194
<ClCompile Include="src\PDB\diaCreate.cpp" />
189195
<ClCompile Include="src\PDB\PDBExporter.cpp" />
190196
<ClCompile Include="src\PDB\PDBHeaderGenerator.cpp" />

Resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#define IDC_GROUP_IDA_COMPATIBILITY 2018
3636
#define IDC_IDA_COMPATIBLE 2019
3737
#define ID_MENU_SETTINGS 3000
38+
#define ID_MENU_OPEN_CACHE 40001
3839

3940
// Next default values for new objects
4041
//

en-US.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"app_title": "PDB Insight",
33
"menu_file": "File(&F)",
44
"menu_open": "Open PDB File(&O)...",
5+
"menu_open_cache": "Open PDB Cache File(&C)...",
56
"menu_export_csv": "Export All as CSV(&C)...",
67
"menu_export_functions_csv": "Export Functions as CSV(&F)...",
78
"menu_export_classes_csv": "Export Classes as CSV(&L)...",
@@ -34,6 +35,8 @@
3435
"status_loading": "Loading PDB file...",
3536
"status_parsing": "Parsing",
3637
"status_loaded": "Loaded",
38+
"status_loading_cache": "Loading cache file...",
39+
"status_loaded_cache": "Loaded from cache",
3740
"status_associate_success": "PDB files associated successfully!",
3841
"status_unassociate_success": "PDB files unassociated!",
3942
"status_cannot_create_file": "Cannot create file",
@@ -64,6 +67,7 @@
6467
"col_value": "Value",
6568
"col_member_count": "Member Count",
6669
"col_base_count": "Base Class Count",
70+
"col_virtual_function_count": "Virtual Function Count",
6771
"col_virtual_address": "Virtual Address",
6872

6973
"prop_name": "Name",
@@ -82,6 +86,8 @@
8286
"prop_base_class_prefix": "--- Base Class: ",
8387
"prop_base_class_suffix": " ---",
8488
"prop_current_class_members": "--- Current Class Members ---",
89+
"prop_virtual_functions": "Virtual Functions",
90+
"prop_virtual_function_table": "--- Virtual Function Table ---",
8591
"prop_param_prefix": "Parameter ",
8692

8793
"msg_open_pdb_first": "Please open a PDB file first",
@@ -91,6 +97,7 @@
9197
"msg_export_fail": "Export failed!",
9298
"msg_export_partial": "Some files failed to export!",
9399
"msg_pdb_load_fail": "Failed to load PDB file",
100+
"msg_cache_load_fail": "Failed to load cache file",
94101
"msg_error": "Error",
95102
"msg_success": "Success",
96103
"msg_warning": "Warning",

src/Core/MainWindow.cpp

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "DragDropManager.h"
1111
#include "DPIManager.h"
1212
#include "SettingsManager.h"
13+
#include "CacheManager.h"
1314

1415
#pragma comment(lib, "comctl32.lib")
1516
#pragma comment(lib, "shell32.lib")
@@ -139,25 +140,58 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, LPWSTR lpCmdLine)
139140
}
140141
if (!filePath.empty())
141142
{
142-
if (g_parser.LoadPDB(filePath))
143+
size_t dotPos = filePath.find_last_of(L'.');
144+
if (dotPos != std::wstring::npos)
143145
{
144-
g_parser.SetProgressCallback([](int progress, const std::wstring& text) {
145-
std::wstring status = L"解析中: " + text + L" (" + std::to_wstring(progress) + L"%)";
146-
UpdateStatusBar(status);
147-
});
148-
g_moduleInfo = g_parser.ParseModule();
149-
g_moduleInfo.pdbFileName = filePath;
150-
g_pdbLoaded = true;
151-
152-
PopulateTreeView();
153-
154-
std::wstringstream ss;
155-
ss << L"已加载: " << filePath
156-
<< L" | 函数: " << g_moduleInfo.functions.size()
157-
<< L" | 类: " << g_moduleInfo.classes.size()
158-
<< L" | 结构体: " << g_moduleInfo.structs.size()
159-
<< L" | 联合体: " << g_moduleInfo.unions.size();
160-
UpdateStatusBar(ss.str());
146+
std::wstring extension = filePath.substr(dotPos);
147+
for (size_t i = 0; i < extension.length(); i++)
148+
{
149+
extension[i] = towlower(extension[i]);
150+
}
151+
152+
if (extension == L".pdb")
153+
{
154+
if (g_parser.LoadPDB(filePath))
155+
{
156+
g_parser.SetProgressCallback([](int progress, const std::wstring& text) {
157+
std::wstring status = L"解析中: " + text + L" (" + std::to_wstring(progress) + L"%)";
158+
UpdateStatusBar(status);
159+
});
160+
g_moduleInfo = g_parser.ParseModule();
161+
g_moduleInfo.pdbFileName = filePath;
162+
g_pdbLoaded = true;
163+
164+
PopulateTreeView();
165+
166+
std::wstringstream ss;
167+
ss << L"已加载: " << filePath
168+
<< L" | 函数: " << g_moduleInfo.functions.size()
169+
<< L" | 类: " << g_moduleInfo.classes.size()
170+
<< L" | 结构体: " << g_moduleInfo.structs.size()
171+
<< L" | 联合体: " << g_moduleInfo.unions.size();
172+
UpdateStatusBar(ss.str());
173+
}
174+
}
175+
else if (extension == L".pdbbc")
176+
{
177+
ModuleInfo moduleInfo;
178+
std::wstring errorMsg;
179+
if (CacheManager::GetInstance().LoadCache(moduleInfo, filePath, errorMsg))
180+
{
181+
g_moduleInfo = moduleInfo;
182+
g_pdbLoaded = true;
183+
184+
PopulateTreeView();
185+
186+
std::wstringstream ss;
187+
ss << L"已从缓存加载: " << filePath
188+
<< L" | 函数: " << g_moduleInfo.functions.size()
189+
<< L" | 类: " << g_moduleInfo.classes.size()
190+
<< L" | 结构体: " << g_moduleInfo.structs.size()
191+
<< L" | 联合体: " << g_moduleInfo.unions.size();
192+
UpdateStatusBar(ss.str());
193+
}
194+
}
161195
}
162196
}
163197
}
@@ -183,6 +217,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
183217
case ID_MENU_OPEN:
184218
OpenPDBFile(hWnd);
185219
break;
220+
case ID_MENU_OPEN_CACHE:
221+
OpenCacheFile(hWnd);
222+
break;
186223
case ID_MENU_EXPORT_CSV:
187224
ExportToCSV(hWnd);
188225
break;

0 commit comments

Comments
 (0)