summary refs log tree commit diff stats
path: root/Test
diff options
context:
space:
mode:
Diffstat (limited to 'Test')
-rw-r--r--Test/Temp.cpp64
-rw-r--r--Test/Test.vcxproj16
-rw-r--r--Test/packages.config2
3 files changed, 45 insertions, 37 deletions
diff --git a/Test/Temp.cpp b/Test/Temp.cpp index 6a45140..3b31539 100644 --- a/Test/Temp.cpp +++ b/Test/Temp.cpp
@@ -6,45 +6,45 @@
6class Temp : public testing::Test 6class Temp : public testing::Test
7{ 7{
8protected: 8protected:
9 std::vector<char> ReadSubtitles(int size) { 9 std::shared_ptr<Memory> _memory = std::make_shared<Memory>("witness64_d3d11.exe");
10 Memory memory("witness64_d3d11.exe"); 10 // std::vector<char> ReadSubtitles(int size) {
11 std::vector<char> data; 11 // Memory memory("witness64_d3d11.exe");
12 data.resize(size); 12 // std::vector<char> data;
13 ReadProcessMemory(memory._handle, (LPVOID)0x3D89F000, &data[0], sizeof(char) * size, nullptr); 13 // data.resize(size);
14 return data; 14 // ReadProcessMemory(memory._handle, (LPVOID)0x3D89F000, &data[0], sizeof(char) * size, nullptr);
15 } 15 // return data;
16 // }
16}; 17};
17 18
18TEST(SwapTests, Shipwreck) { 19// TEST_F(Temp, Shipwreck) {
19 Randomizer randomizer; 20// Randomizer randomizer(_memory);
20 int shipwreck = 0xAFB; 21// int shipwreck = 0xAFB;
21 int thEntry = 0x288C; 22// int thEntry = 0x288C;
22 int si1 = 0x00000022; 23// int si1 = 0x00000022;
23 int bu1 = 0x6; 24// int bu1 = 0x6;
24 int td1 = 0x5D; 25// int td1 = 0x5D;
25 int ypp = 0x33EA; 26// int ypp = 0x33EA;
26 int ramp_activation_shapers = 0x21D5; 27// int ramp_activation_shapers = 0x21D5;
27 int mill_upper_5 = 0x146C; 28// int mill_upper_5 = 0x146C;
28 int mill_entry_left = 0x1E5A; 29// int mill_entry_left = 0x1E5A;
29 int mill_upper_7 = 0x03686; 30// int mill_upper_7 = 0x03686;
30 31//
31 randomizer.SwapPanels(ypp, mill_upper_7, Randomizer::SWAP::LINES); 32// randomizer.SwapPanels(ypp, mill_upper_7, Randomizer::SWAP::LINES);
32 33// }
33}
34 34
35/* 35/*
36TEST_F(Temp, Extract) { 36TEST_F(Temp, Extract) {
37// std::vector<byte> data = ReadSubtitles(166480); 37// std::vector<byte> data = ReadSubtitles(166480);
38 std::vector<char> data = ReadSubtitles(166480); 38 std::vector<char> data = ReadSubtitles(166480);
39 std::ofstream file("raw.txt"); 39 std::ofstream file("raw.txt");
40 ASSERT_TRUE(file.is_open()); 40 ASSERT_TRUE(file.is_open());
41 41
42 std::string hex = "0123456789ABCDEF"; 42 std::string hex = "0123456789ABCDEF";
43 for (int i=0; i<data.size(); i++) { 43 for (int i=0; i<data.size(); i++) {
44 if (data[i] == '\r') continue; 44 if (data[i] == '\r') continue;
45 file << data[i]; 45 file << data[i];
46 46
47 } 47 }
48 file.close(); 48 file.close();
49} 49}
50*/ \ No newline at end of file 50*/ \ No newline at end of file
diff --git a/Test/Test.vcxproj b/Test/Test.vcxproj index 1beb5a4..d36f4af 100644 --- a/Test/Test.vcxproj +++ b/Test/Test.vcxproj
@@ -38,12 +38,16 @@
38 </ProjectReference> 38 </ProjectReference>
39 </ItemGroup> 39 </ItemGroup>
40 <ItemGroup> 40 <ItemGroup>
41 <ClCompile Include="RandomTests.cpp" />
42 <ClCompile Include="Temp.cpp" />
43 </ItemGroup>
44 <ItemGroup>
41 <None Include="packages.config" /> 45 <None Include="packages.config" />
42 </ItemGroup> 46 </ItemGroup>
43 <ItemDefinitionGroup /> 47 <ItemDefinitionGroup />
44 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> 48 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
45 <ImportGroup Label="ExtensionTargets"> 49 <ImportGroup Label="ExtensionTargets">
46 <Import Project="..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.0\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets" Condition="Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.0\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets')" /> 50 <Import Project="..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.1\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets" Condition="Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.1\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets')" />
47 </ImportGroup> 51 </ImportGroup>
48 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 52 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
49 <ClCompile> 53 <ClCompile>
@@ -51,7 +55,8 @@
51 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> 55 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
52 <Optimization>Disabled</Optimization> 56 <Optimization>Disabled</Optimization>
53 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> 57 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54 <MinimalRebuild>true</MinimalRebuild> 58 <MinimalRebuild>
59 </MinimalRebuild>
55 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> 60 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
56 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> 61 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
57 <WarningLevel>Level3</WarningLevel> 62 <WarningLevel>Level3</WarningLevel>
@@ -70,7 +75,8 @@
70 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> 75 <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
71 <Optimization>Disabled</Optimization> 76 <Optimization>Disabled</Optimization>
72 <PreprocessorDefinitions>X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> 77 <PreprocessorDefinitions>X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
73 <MinimalRebuild>true</MinimalRebuild> 78 <MinimalRebuild>
79 </MinimalRebuild>
74 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> 80 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
75 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> 81 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
76 <WarningLevel>Level3</WarningLevel> 82 <WarningLevel>Level3</WarningLevel>
@@ -94,6 +100,7 @@
94 <AdditionalIncludeDirectories>..\Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 100 <AdditionalIncludeDirectories>..\Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
95 <DisableSpecificWarnings>4996</DisableSpecificWarnings> 101 <DisableSpecificWarnings>4996</DisableSpecificWarnings>
96 <TreatWarningAsError>true</TreatWarningAsError> 102 <TreatWarningAsError>true</TreatWarningAsError>
103 <MinimalRebuild />
97 </ClCompile> 104 </ClCompile>
98 <Link> 105 <Link>
99 <GenerateDebugInformation>true</GenerateDebugInformation> 106 <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -113,6 +120,7 @@
113 <AdditionalIncludeDirectories>..\Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 120 <AdditionalIncludeDirectories>..\Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
114 <DisableSpecificWarnings>4996</DisableSpecificWarnings> 121 <DisableSpecificWarnings>4996</DisableSpecificWarnings>
115 <TreatWarningAsError>true</TreatWarningAsError> 122 <TreatWarningAsError>true</TreatWarningAsError>
123 <MinimalRebuild />
116 </ClCompile> 124 </ClCompile>
117 <Link> 125 <Link>
118 <GenerateDebugInformation>true</GenerateDebugInformation> 126 <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -125,6 +133,6 @@
125 <PropertyGroup> 133 <PropertyGroup>
126 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> 134 <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
127 </PropertyGroup> 135 </PropertyGroup>
128 <Error Condition="!Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.0\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.0\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets'))" /> 136 <Error Condition="!Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.1\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.1\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets'))" />
129 </Target> 137 </Target>
130</Project> \ No newline at end of file 138</Project> \ No newline at end of file
diff --git a/Test/packages.config b/Test/packages.config index 1dcab87..a412a41 100644 --- a/Test/packages.config +++ b/Test/packages.config
@@ -1,4 +1,4 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<packages> 2<packages>
3 <package id="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static" version="1.8.0" targetFramework="native" /> 3 <package id="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static" version="1.8.1" targetFramework="native" />
4</packages> \ No newline at end of file 4</packages> \ No newline at end of file