Skip to content

Commit 62b0e72

Browse files
committed
PROJECT+DBG+GUI: capstone_wrapper as a static library (for maintainability)
1 parent 8e7887d commit 62b0e72

18 files changed

+214
-382
lines changed

src/dbg/capstone_wrapper.h renamed to src/capstone_wrapper/capstone_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _CAPSTONE_WRAPPER_H
22
#define _CAPSTONE_WRAPPER_H
33

4-
#include "capstone/capstone.h"
4+
#include "../dbg/capstone/capstone.h"
55
#include <string>
66

77
#define MAX_DISASM_BUFFER 16
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|x64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|Win32">
13+
<Configuration>Release</Configuration>
14+
<Platform>Win32</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<ProjectGuid>{C9B06E6E-3534-4E7B-9C00-C3EA33CC4E15}</ProjectGuid>
23+
<RootNamespace>capstone_wrapper</RootNamespace>
24+
</PropertyGroup>
25+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
26+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
27+
<ConfigurationType>StaticLibrary</ConfigurationType>
28+
<UseDebugLibraries>true</UseDebugLibraries>
29+
<PlatformToolset>v120_xp</PlatformToolset>
30+
<CharacterSet>MultiByte</CharacterSet>
31+
</PropertyGroup>
32+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
33+
<ConfigurationType>StaticLibrary</ConfigurationType>
34+
<UseDebugLibraries>true</UseDebugLibraries>
35+
<PlatformToolset>v120_xp</PlatformToolset>
36+
<CharacterSet>MultiByte</CharacterSet>
37+
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
39+
<ConfigurationType>StaticLibrary</ConfigurationType>
40+
<UseDebugLibraries>false</UseDebugLibraries>
41+
<PlatformToolset>v120_xp</PlatformToolset>
42+
<WholeProgramOptimization>true</WholeProgramOptimization>
43+
<CharacterSet>MultiByte</CharacterSet>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
46+
<ConfigurationType>StaticLibrary</ConfigurationType>
47+
<UseDebugLibraries>false</UseDebugLibraries>
48+
<PlatformToolset>v120_xp</PlatformToolset>
49+
<WholeProgramOptimization>true</WholeProgramOptimization>
50+
<CharacterSet>MultiByte</CharacterSet>
51+
</PropertyGroup>
52+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
53+
<ImportGroup Label="ExtensionSettings">
54+
</ImportGroup>
55+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
56+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57+
</ImportGroup>
58+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
59+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
60+
</ImportGroup>
61+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
62+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
63+
</ImportGroup>
64+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
65+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
66+
</ImportGroup>
67+
<PropertyGroup Label="UserMacros" />
68+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
69+
<TargetExt>.lib</TargetExt>
70+
<OutDir>$(ProjectDir)..\..\bin\x32\</OutDir>
71+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
72+
</PropertyGroup>
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
74+
<TargetExt>.lib</TargetExt>
75+
<OutDir>$(ProjectDir)..\..\bin\x64\</OutDir>
76+
</PropertyGroup>
77+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
78+
<TargetExt>.lib</TargetExt>
79+
<OutDir>$(ProjectDir)..\..\bin\x32\</OutDir>
80+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
81+
</PropertyGroup>
82+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
83+
<TargetExt>.lib</TargetExt>
84+
<OutDir>$(ProjectDir)..\..\bin\x64\</OutDir>
85+
</PropertyGroup>
86+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
87+
<ClCompile>
88+
<WarningLevel>Level3</WarningLevel>
89+
<Optimization>Disabled</Optimization>
90+
<SDLCheck>true</SDLCheck>
91+
</ClCompile>
92+
<Link>
93+
<GenerateDebugInformation>true</GenerateDebugInformation>
94+
</Link>
95+
</ItemDefinitionGroup>
96+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
97+
<ClCompile>
98+
<WarningLevel>Level3</WarningLevel>
99+
<Optimization>Disabled</Optimization>
100+
<SDLCheck>true</SDLCheck>
101+
</ClCompile>
102+
<Link>
103+
<GenerateDebugInformation>true</GenerateDebugInformation>
104+
</Link>
105+
</ItemDefinitionGroup>
106+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
107+
<ClCompile>
108+
<WarningLevel>Level3</WarningLevel>
109+
<Optimization>MaxSpeed</Optimization>
110+
<FunctionLevelLinking>true</FunctionLevelLinking>
111+
<IntrinsicFunctions>true</IntrinsicFunctions>
112+
<SDLCheck>true</SDLCheck>
113+
<WholeProgramOptimization>false</WholeProgramOptimization>
114+
</ClCompile>
115+
<Link>
116+
<GenerateDebugInformation>true</GenerateDebugInformation>
117+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
118+
<OptimizeReferences>true</OptimizeReferences>
119+
</Link>
120+
</ItemDefinitionGroup>
121+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
122+
<ClCompile>
123+
<WarningLevel>Level3</WarningLevel>
124+
<Optimization>MaxSpeed</Optimization>
125+
<FunctionLevelLinking>true</FunctionLevelLinking>
126+
<IntrinsicFunctions>true</IntrinsicFunctions>
127+
<SDLCheck>true</SDLCheck>
128+
<WholeProgramOptimization>false</WholeProgramOptimization>
129+
</ClCompile>
130+
<Link>
131+
<GenerateDebugInformation>true</GenerateDebugInformation>
132+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
133+
<OptimizeReferences>true</OptimizeReferences>
134+
</Link>
135+
</ItemDefinitionGroup>
136+
<ItemGroup>
137+
<ClCompile Include="capstone_wrapper.cpp" />
138+
</ItemGroup>
139+
<ItemGroup>
140+
<ClInclude Include="capstone_wrapper.h" />
141+
</ItemGroup>
142+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
143+
<ImportGroup Label="ExtensionTargets">
144+
</ImportGroup>
145+
</Project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="capstone_wrapper.cpp">
19+
<Filter>Source Files</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
<ItemGroup>
23+
<ClInclude Include="capstone_wrapper.h">
24+
<Filter>Header Files</Filter>
25+
</ClInclude>
26+
</ItemGroup>
27+
</Project>

src/dbg/CodeFollowPass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "AnalysisPass.h"
44
#include "BasicBlock.h"
5-
#include "capstone_wrapper.h"
5+
#include <capstone_wrapper.h>
66

77
class CodeFollowPass : public AnalysisPass
88
{

src/dbg/LinearPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <ppl.h>
33
#include "AnalysisPass.h"
44
#include "LinearPass.h"
5-
#include "capstone_wrapper.h"
5+
#include <capstone_wrapper.h>
66

77
LinearPass::LinearPass(duint VirtualStart, duint VirtualEnd, BBlockArray & MainBlocks)
88
: AnalysisPass(VirtualStart, VirtualEnd, MainBlocks)

src/dbg/analysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _ANALYSIS_H
33

44
#include "_global.h"
5-
#include "capstone_wrapper.h"
5+
#include <capstone_wrapper.h>
66

77
class Analysis
88
{

src/dbg/disasm_fast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _DISASM_FAST_H
33

44
#include "_global.h"
5-
#include "capstone_wrapper.h"
5+
#include <capstone_wrapper.h>
66

77
void fillbasicinfo(Capstone* disasm, BASIC_INSTRUCTION_INFO* basicinfo);
88
bool disasmfast(duint addr, BASIC_INSTRUCTION_INFO* basicinfo);

src/dbg/disasm_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "value.h"
99
#include "console.h"
1010
#include "memory.h"
11-
#include "capstone_wrapper.h"
11+
#include <capstone_wrapper.h>
1212

1313
duint disasmback(unsigned char* data, duint base, duint size, duint ip, int n)
1414
{

src/dbg/instruction.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,8 +1939,7 @@ CMDRESULT cbInstrLog(int argc, char* argv[])
19391939
return STATUS_CONTINUE;
19401940
}
19411941

1942-
#include "capstone\capstone.h"
1943-
#include "capstone_wrapper.h"
1942+
#include <capstone_wrapper.h>
19441943

19451944
CMDRESULT cbInstrCapstone(int argc, char* argv[])
19461945
{

0 commit comments

Comments
 (0)