Skip to content

Commit 9854593

Browse files
committed
refactor: structure cleanup
1 parent 47950bf commit 9854593

37 files changed

Lines changed: 229 additions & 863 deletions
Lines changed: 27 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
4-
<ProjectConfiguration Include="Debug|Win32">
5-
<Configuration>Debug</Configuration>
6-
<Platform>Win32</Platform>
7-
</ProjectConfiguration>
8-
<ProjectConfiguration Include="Release|Win32">
9-
<Configuration>Release</Configuration>
10-
<Platform>Win32</Platform>
11-
</ProjectConfiguration>
124
<ProjectConfiguration Include="Debug|x64">
135
<Configuration>Debug</Configuration>
146
<Platform>x64</Platform>
@@ -21,24 +13,11 @@
2113
<PropertyGroup Label="Globals">
2214
<VCProjectVersion>17.0</VCProjectVersion>
2315
<Keyword>Win32Proj</Keyword>
24-
<ProjectGuid>{6c260ca5-e15a-4e4c-af43-63596891df79}</ProjectGuid>
25-
<RootNamespace>Shared</RootNamespace>
16+
<ProjectGuid>{a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d}</ProjectGuid>
17+
<RootNamespace>Core</RootNamespace>
2618
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2719
</PropertyGroup>
2820
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30-
<ConfigurationType>StaticLibrary</ConfigurationType>
31-
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v143</PlatformToolset>
33-
<CharacterSet>Unicode</CharacterSet>
34-
</PropertyGroup>
35-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36-
<ConfigurationType>StaticLibrary</ConfigurationType>
37-
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v143</PlatformToolset>
39-
<WholeProgramOptimization>true</WholeProgramOptimization>
40-
<CharacterSet>Unicode</CharacterSet>
41-
</PropertyGroup>
4221
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4322
<ConfigurationType>StaticLibrary</ConfigurationType>
4423
<UseDebugLibraries>true</UseDebugLibraries>
@@ -57,54 +36,38 @@
5736
</ImportGroup>
5837
<ImportGroup Label="Shared">
5938
</ImportGroup>
60-
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61-
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62-
</ImportGroup>
63-
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64-
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65-
</ImportGroup>
6639
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
6740
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
6841
</ImportGroup>
6942
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
7043
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
7144
</ImportGroup>
7245
<PropertyGroup Label="UserMacros" />
73-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74-
<ClCompile>
75-
<WarningLevel>Level3</WarningLevel>
76-
<SDLCheck>true</SDLCheck>
77-
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78-
<ConformanceMode>true</ConformanceMode>
79-
<LanguageStandard>stdcpp23</LanguageStandard>
80-
</ClCompile>
81-
<Link>
82-
<SubSystem>Console</SubSystem>
83-
<GenerateDebugInformation>true</GenerateDebugInformation>
84-
</Link>
85-
</ItemDefinitionGroup>
86-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
87-
<ClCompile>
88-
<WarningLevel>Level3</WarningLevel>
89-
<FunctionLevelLinking>true</FunctionLevelLinking>
90-
<IntrinsicFunctions>true</IntrinsicFunctions>
91-
<SDLCheck>true</SDLCheck>
92-
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
93-
<ConformanceMode>true</ConformanceMode>
94-
<LanguageStandard>stdcpp23</LanguageStandard>
95-
</ClCompile>
96-
<Link>
97-
<SubSystem>Console</SubSystem>
98-
<GenerateDebugInformation>true</GenerateDebugInformation>
99-
</Link>
100-
</ItemDefinitionGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
47+
<TargetName>RivetCore</TargetName>
48+
</PropertyGroup>
49+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
50+
<TargetName>RivetCore</TargetName>
51+
</PropertyGroup>
52+
<PropertyGroup Label="Vcpkg">
53+
<VcpkgEnableManifest>true</VcpkgEnableManifest>
54+
</PropertyGroup>
55+
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
56+
<VcpkgUseStatic>true</VcpkgUseStatic>
57+
<VcpkgUseMD>true</VcpkgUseMD>
58+
</PropertyGroup>
59+
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
60+
<VcpkgUseStatic>true</VcpkgUseStatic>
61+
<VcpkgUseMD>true</VcpkgUseMD>
62+
</PropertyGroup>
10163
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
10264
<ClCompile>
10365
<WarningLevel>Level3</WarningLevel>
10466
<SDLCheck>true</SDLCheck>
105-
<PreprocessorDefinitions>RIVET_SHARED_EXPORTS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
67+
<PreprocessorDefinitions>RIVET_LIB_EXPORTS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
10668
<ConformanceMode>true</ConformanceMode>
10769
<LanguageStandard>stdcpp23</LanguageStandard>
70+
<AdditionalIncludeDirectories>$(SolutionDir)Core;$(SolutionDir)Lib</AdditionalIncludeDirectories>
10871
<MultiProcessorCompilation>true</MultiProcessorCompilation>
10972
</ClCompile>
11073
<Link>
@@ -118,9 +81,10 @@
11881
<FunctionLevelLinking>true</FunctionLevelLinking>
11982
<IntrinsicFunctions>true</IntrinsicFunctions>
12083
<SDLCheck>true</SDLCheck>
121-
<PreprocessorDefinitions>RIVET_SHARED_EXPORTS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
84+
<PreprocessorDefinitions>RIVET_LIB_EXPORTS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
12285
<ConformanceMode>true</ConformanceMode>
12386
<LanguageStandard>stdcpp23</LanguageStandard>
87+
<AdditionalIncludeDirectories>$(SolutionDir)Core;$(SolutionDir)Lib</AdditionalIncludeDirectories>
12488
<MultiProcessorCompilation>true</MultiProcessorCompilation>
12589
</ClCompile>
12690
<Link>
@@ -131,16 +95,16 @@
13195
<ItemGroup>
13296
<ClInclude Include="cli.h" />
13397
<ClInclude Include="config.h" />
134-
<ClInclude Include="flags.h" />
13598
<ClInclude Include="includes.h" />
136-
<ClInclude Include="sharedmacros.h" />
13799
</ItemGroup>
138100
<ItemGroup>
139101
<ClCompile Include="cli.cpp" />
140102
<ClCompile Include="config.cpp" />
141-
<ClCompile Include="flags.cpp" />
103+
<ClCompile Include="memory\functionscanner.cpp" />
104+
<ClCompile Include="memory\peheaders.cpp" />
105+
<ClCompile Include="memory\sigscanner.cpp" />
142106
</ItemGroup>
143107
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
144108
<ImportGroup Label="ExtensionTargets">
145109
</ImportGroup>
146-
</Project>
110+
</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Shared/includes.h renamed to Core/includes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ namespace fs = std::filesystem;
1616
namespace Rivet {
1717
template <typename T>
1818
concept StringOrBool = std::is_same_v<T, std::string> || std::is_same_v<T, bool>;
19-
}
19+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "functionscanner.hpp"
2-
#include "peheaders.hpp"
1+
#include <rivet/memory/functionscanner.hpp>
2+
#include <rivet/memory/peheaders.hpp>
33

44
#include <unordered_map>
55
#include <algorithm>
@@ -82,7 +82,7 @@ void Rivet::FunctionScanner::Scan() const {
8282
uint64_t funcEnd = (i + 1 < functionStarts.size()) ? functionStarts[i + 1] : endAddress_;
8383

8484
uint64_t localOffset = funcStart - startAddress_;
85-
85+
8686
while (localOffset < funcEnd - startAddress_) {
8787
ZydisDecodedInstruction instr;
8888
if (!ZYAN_SUCCESS(ZydisDecoderDecodeInstruction(&decoder, &ctx, code + localOffset, funcEnd - startAddress_ - localOffset, &instr))) {
@@ -110,4 +110,4 @@ void Rivet::FunctionScanner::Scan() const {
110110
}
111111

112112
GCache[startAddress_] = std::move(functions);
113-
}
113+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#include "peheaders.hpp"
1+
#include <rivet/memory/peheaders.hpp>
22

33
#include <ranges>
44
#include <utility>
55

66
RIVET_LIB_API std::vector<std::string> Rivet::PEHeaderManager::GetLoadedModuleNames() {
77
std::vector<std::string> output;
8-
8+
99
for (const auto& name : this->modules_ | std::views::keys)
1010
output.emplace_back(name);
1111

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "sigscanner.h"
2-
#include "peheaders.hpp"
1+
#include <rivet/memory/sigscanner.h>
2+
#include <rivet/memory/peheaders.hpp>
33

44
#include <sstream>
55
#include <mutex>
@@ -82,7 +82,7 @@ RIVET_LIB_API DWORD64 SignatureScanner::ScanPatternRaw(const std::vector<uint8_t
8282

8383
uint8_t badCharacters[tableSize];
8484
std::fill_n(badCharacters, tableSize, static_cast<uint8_t>(patternSize));
85-
85+
8686
for (size_t index = 0; index < patternSize - 1; ++index) {
8787
if (mask[index])
8888
badCharacters[bytes[index]] = static_cast<uint8_t>(patternSize - 1 - index);

Core/vcpkg-configuration.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"default-registry": {
3+
"kind": "git",
4+
"baseline": "b1e15efef6758eaa0beb0a8732cfa66f6a68a81d",
5+
"repository": "https://github.com/microsoft/vcpkg"
6+
},
7+
"registries": [
8+
{
9+
"kind": "artifact",
10+
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
11+
"name": "microsoft"
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)