diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2018-11-17 14:02:28 -0800 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2018-11-17 14:02:28 -0800 |
commit | 1501b173c058f11e53507532ad583a6ac9c061cc (patch) | |
tree | 3066f68055fd6bcf73d9686a4980b041d74f28d6 | |
parent | 1f85741c8d12d9b1fbd55b29f334de572f9eea9b (diff) | |
download | witness-tutorializer-1501b173c058f11e53507532ad583a6ac9c061cc.tar.gz witness-tutorializer-1501b173c058f11e53507532ad583a6ac9c061cc.tar.bz2 witness-tutorializer-1501b173c058f11e53507532ad583a6ac9c061cc.zip |
4.0.5
-rw-r--r-- | App/App.vcxproj | 5 | ||||
-rw-r--r-- | App/Main.cpp | 3 | ||||
-rw-r--r-- | App/Version.h | 2 | ||||
-rw-r--r-- | Installer/Installer.vdproj | 8 | ||||
-rw-r--r-- | Source/Memory.h | 6 | ||||
-rw-r--r-- | Source/Randomizer.cpp | 2 | ||||
-rw-r--r-- | Source/Source.vcxproj | 1 | ||||
-rw-r--r-- | Test/Temp.cpp | 31 | ||||
-rw-r--r-- | WitnessRandomizer.sln | 16 |
9 files changed, 57 insertions, 17 deletions
diff --git a/App/App.vcxproj b/App/App.vcxproj index 1633837..2597b8d 100644 --- a/App/App.vcxproj +++ b/App/App.vcxproj | |||
@@ -72,15 +72,19 @@ | |||
72 | <PropertyGroup Label="UserMacros" /> | 72 | <PropertyGroup Label="UserMacros" /> |
73 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | 73 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
74 | <LinkIncremental>true</LinkIncremental> | 74 | <LinkIncremental>true</LinkIncremental> |
75 | <TargetName>WitnessRandomizer</TargetName> | ||
75 | </PropertyGroup> | 76 | </PropertyGroup> |
76 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | 77 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
77 | <LinkIncremental>true</LinkIncremental> | 78 | <LinkIncremental>true</LinkIncremental> |
79 | <TargetName>WitnessRandomizer</TargetName> | ||
78 | </PropertyGroup> | 80 | </PropertyGroup> |
79 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | 81 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
80 | <LinkIncremental>false</LinkIncremental> | 82 | <LinkIncremental>false</LinkIncremental> |
83 | <TargetName>WitnessRandomizer</TargetName> | ||
81 | </PropertyGroup> | 84 | </PropertyGroup> |
82 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | 85 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
83 | <LinkIncremental>false</LinkIncremental> | 86 | <LinkIncremental>false</LinkIncremental> |
87 | <TargetName>WitnessRandomizer</TargetName> | ||
84 | </PropertyGroup> | 88 | </PropertyGroup> |
85 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | 89 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
86 | <ClCompile> | 90 | <ClCompile> |
@@ -151,6 +155,7 @@ | |||
151 | <LanguageStandard>stdcpp17</LanguageStandard> | 155 | <LanguageStandard>stdcpp17</LanguageStandard> |
152 | <AdditionalIncludeDirectories>..\Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 156 | <AdditionalIncludeDirectories>..\Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
153 | <TreatWarningAsError>true</TreatWarningAsError> | 157 | <TreatWarningAsError>true</TreatWarningAsError> |
158 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
154 | </ClCompile> | 159 | </ClCompile> |
155 | <Link> | 160 | <Link> |
156 | <SubSystem>Windows</SubSystem> | 161 | <SubSystem>Windows</SubSystem> |
diff --git a/App/Main.cpp b/App/Main.cpp index 6ebef7e..7a8e7f3 100644 --- a/App/Main.cpp +++ b/App/Main.cpp | |||
@@ -54,7 +54,8 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |||
54 | GetWindowText(hwndSeed, &text[0], 100); | 54 | GetWindowText(hwndSeed, &text[0], 100); |
55 | int seed = _wtoi(text.c_str()); | 55 | int seed = _wtoi(text.c_str()); |
56 | 56 | ||
57 | if (seedIsRNG || text.empty()) { | 57 | // TODO: text needs to be resized! |
58 | if (seedIsRNG || wcslen(text.c_str()) == 0) { | ||
58 | seed = Random::RandInt(0, 100000); | 59 | seed = Random::RandInt(0, 100000); |
59 | seedIsRNG = true; | 60 | seedIsRNG = true; |
60 | } | 61 | } |
diff --git a/App/Version.h b/App/Version.h index 8029020..04b6d2b 100644 --- a/App/Version.h +++ b/App/Version.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | #define MAJOR 4 | 6 | #define MAJOR 4 |
7 | #define MINOR 0 | 7 | #define MINOR 0 |
8 | #define PATCH 4 | 8 | #define PATCH 5 |
9 | 9 | ||
10 | #define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH) | 10 | #define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH) |
11 | #define VERSION MAJOR, MINOR, PATCH | 11 | #define VERSION MAJOR, MINOR, PATCH |
diff --git a/Installer/Installer.vdproj b/Installer/Installer.vdproj index 19d6036..c53cdfb 100644 --- a/Installer/Installer.vdproj +++ b/Installer/Installer.vdproj | |||
@@ -162,15 +162,15 @@ | |||
162 | { | 162 | { |
163 | "Name" = "8:Microsoft Visual Studio" | 163 | "Name" = "8:Microsoft Visual Studio" |
164 | "ProductName" = "8:Witness Randomizer" | 164 | "ProductName" = "8:Witness Randomizer" |
165 | "ProductCode" = "8:{7DD620CA-9593-4E32-9D60-9D12069DA33C}" | 165 | "ProductCode" = "8:{4CD5A308-B14D-48BA-A677-08026664CC30}" |
166 | "PackageCode" = "8:{BBA8F7F1-52D8-44B0-BC53-9AC3F0181E3D}" | 166 | "PackageCode" = "8:{9E5B2E28-1FE1-41FF-ADCD-4C86649EFB9F}" |
167 | "UpgradeCode" = "8:{4CB5496B-A47E-41D3-B4A7-677E29AB7513}" | 167 | "UpgradeCode" = "8:{4CB5496B-A47E-41D3-B4A7-677E29AB7513}" |
168 | "AspNetVersion" = "8:2.0.50727.0" | 168 | "AspNetVersion" = "8:2.0.50727.0" |
169 | "RestartWWWService" = "11:FALSE" | 169 | "RestartWWWService" = "11:FALSE" |
170 | "RemovePreviousVersions" = "11:FALSE" | 170 | "RemovePreviousVersions" = "11:FALSE" |
171 | "DetectNewerInstalledVersion" = "11:TRUE" | 171 | "DetectNewerInstalledVersion" = "11:TRUE" |
172 | "InstallAllUsers" = "11:FALSE" | 172 | "InstallAllUsers" = "11:FALSE" |
173 | "ProductVersion" = "8:4.0.4" | 173 | "ProductVersion" = "8:4.0.5" |
174 | "Manufacturer" = "8:jbzdarkid" | 174 | "Manufacturer" = "8:jbzdarkid" |
175 | "ARPHELPTELEPHONE" = "8:" | 175 | "ARPHELPTELEPHONE" = "8:" |
176 | "ARPHELPLINK" = "8:https://www.github.com/jbzdarkid/witness-randomizer/issues" | 176 | "ARPHELPLINK" = "8:https://www.github.com/jbzdarkid/witness-randomizer/issues" |
@@ -698,7 +698,7 @@ | |||
698 | { | 698 | { |
699 | "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_F4835D5BBF3E437390127C4C49888F07" | 699 | "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_F4835D5BBF3E437390127C4C49888F07" |
700 | { | 700 | { |
701 | "SourcePath" = "8:..\\x64\\Debug\\App.exe" | 701 | "SourcePath" = "8:..\\x64\\Release\\WitnessRandomizer.exe" |
702 | "TargetName" = "8:" | 702 | "TargetName" = "8:" |
703 | "Tag" = "8:" | 703 | "Tag" = "8:" |
704 | "Folder" = "8:_8E9D847124D34D9D9008762077D816DE" | 704 | "Folder" = "8:_8E9D847124D34D9D9008762077D816DE" |
diff --git a/Source/Memory.h b/Source/Memory.h index d14d58d..23f6388 100644 --- a/Source/Memory.h +++ b/Source/Memory.h | |||
@@ -3,8 +3,8 @@ | |||
3 | #include <map> | 3 | #include <map> |
4 | #include <windows.h> | 4 | #include <windows.h> |
5 | 5 | ||
6 | #define GLOBALS 0x5B28C0 | 6 | // #define GLOBALS 0x5B28C0 |
7 | // #define GLOBALS 0x62A080 | 7 | #define GLOBALS 0x62A080 |
8 | 8 | ||
9 | // https://github.com/erayarslan/WriteProcessMemory-Example | 9 | // https://github.com/erayarslan/WriteProcessMemory-Example |
10 | // http://stackoverflow.com/q/32798185 | 10 | // http://stackoverflow.com/q/32798185 |
@@ -75,4 +75,6 @@ private: | |||
75 | std::map<uintptr_t, uintptr_t> _computedAddresses; | 75 | std::map<uintptr_t, uintptr_t> _computedAddresses; |
76 | uintptr_t _baseAddress = 0; | 76 | uintptr_t _baseAddress = 0; |
77 | HANDLE _handle = nullptr; | 77 | HANDLE _handle = nullptr; |
78 | |||
79 | friend class Temp; | ||
78 | }; \ No newline at end of file | 80 | }; \ No newline at end of file |
diff --git a/Source/Randomizer.cpp b/Source/Randomizer.cpp index a21b928..6f9c12b 100644 --- a/Source/Randomizer.cpp +++ b/Source/Randomizer.cpp | |||
@@ -8,6 +8,8 @@ | |||
8 | * Randomize audio logs -- Hard, seem to be unloaded some times? | 8 | * Randomize audio logs -- Hard, seem to be unloaded some times? |
9 | * Swap sounds in jungle (along with panels) -- maybe impossible | 9 | * Swap sounds in jungle (along with panels) -- maybe impossible |
10 | * Make orange 7 (all of oranges?) hard. Like big = hard. (See: HARD_MODE) | 10 | * Make orange 7 (all of oranges?) hard. Like big = hard. (See: HARD_MODE) |
11 | * Add a setting for "disable wonkavator and hotel", so that 100% runs are possible | ||
12 | * Try to stabilize challenge/doors RNG | ||
11 | */ | 13 | */ |
12 | #include "Memory.h" | 14 | #include "Memory.h" |
13 | #include "Randomizer.h" | 15 | #include "Randomizer.h" |
diff --git a/Source/Source.vcxproj b/Source/Source.vcxproj index 545753d..85ce6e1 100644 --- a/Source/Source.vcxproj +++ b/Source/Source.vcxproj | |||
@@ -147,6 +147,7 @@ | |||
147 | <ConformanceMode>true</ConformanceMode> | 147 | <ConformanceMode>true</ConformanceMode> |
148 | <LanguageStandard>stdcpp17</LanguageStandard> | 148 | <LanguageStandard>stdcpp17</LanguageStandard> |
149 | <TreatWarningAsError>true</TreatWarningAsError> | 149 | <TreatWarningAsError>true</TreatWarningAsError> |
150 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
150 | </ClCompile> | 151 | </ClCompile> |
151 | <Link> | 152 | <Link> |
152 | <SubSystem>Windows</SubSystem> | 153 | <SubSystem>Windows</SubSystem> |
diff --git a/Test/Temp.cpp b/Test/Temp.cpp index c847c6b..6ccaeff 100644 --- a/Test/Temp.cpp +++ b/Test/Temp.cpp | |||
@@ -1,7 +1,21 @@ | |||
1 | #include "gtest/gtest.h" | 1 | #include "gtest/gtest.h" |
2 | #include "Randomizer.h" | 2 | #include "Randomizer.h" |
3 | #include <iostream> | ||
4 | #include <fstream> | ||
3 | 5 | ||
4 | GTEST_TEST(SwapTests, Shipwreck) { | 6 | class Temp : public testing::Test |
7 | { | ||
8 | protected: | ||
9 | std::vector<char> ReadSubtitles(int size) { | ||
10 | Memory memory("witness64_d3d11.exe"); | ||
11 | std::vector<char> data; | ||
12 | data.resize(size); | ||
13 | ReadProcessMemory(memory._handle, (LPVOID)0x3D89F000, &data[0], sizeof(char) * size, nullptr); | ||
14 | return data; | ||
15 | } | ||
16 | }; | ||
17 | |||
18 | TEST(SwapTests, Shipwreck) { | ||
5 | Randomizer randomizer; | 19 | Randomizer randomizer; |
6 | int shipwreck = 0xAFB; | 20 | int shipwreck = 0xAFB; |
7 | int thEntry = 0x288C; | 21 | int thEntry = 0x288C; |
@@ -17,3 +31,18 @@ GTEST_TEST(SwapTests, Shipwreck) { | |||
17 | randomizer.SwapPanels(ypp, mill_upper_7, Randomizer::SWAP::LINES); | 31 | randomizer.SwapPanels(ypp, mill_upper_7, Randomizer::SWAP::LINES); |
18 | 32 | ||
19 | } | 33 | } |
34 | |||
35 | TEST_F(Temp, Extract) { | ||
36 | // std::vector<byte> data = ReadSubtitles(166480); | ||
37 | std::vector<char> data = ReadSubtitles(166480); | ||
38 | std::ofstream file("raw.txt"); | ||
39 | ASSERT_TRUE(file.is_open()); | ||
40 | |||
41 | std::string hex = "0123456789ABCDEF"; | ||
42 | for (int i=0; i<data.size(); i++) { | ||
43 | if (data[i] == '\r') continue; | ||
44 | file << data[i]; | ||
45 | |||
46 | } | ||
47 | file.close(); | ||
48 | } \ No newline at end of file | ||
diff --git a/WitnessRandomizer.sln b/WitnessRandomizer.sln index a06af41..0ece4ec 100644 --- a/WitnessRandomizer.sln +++ b/WitnessRandomizer.sln | |||
@@ -26,32 +26,32 @@ Global | |||
26 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Debug|x64.Build.0 = Debug|x64 | 26 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Debug|x64.Build.0 = Debug|x64 |
27 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Debug|x86.ActiveCfg = Debug|x64 | 27 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Debug|x86.ActiveCfg = Debug|x64 |
28 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Debug|x86.Build.0 = Debug|x64 | 28 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Debug|x86.Build.0 = Debug|x64 |
29 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x64.ActiveCfg = Debug|x64 | 29 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x64.ActiveCfg = Release|x64 |
30 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x64.Build.0 = Debug|x64 | 30 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x64.Build.0 = Release|x64 |
31 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x86.ActiveCfg = Debug|x64 | 31 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x86.ActiveCfg = Debug|x64 |
32 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x86.Build.0 = Debug|x64 | 32 | {235D27F1-9907-489B-8D58-636A0C5CD079}.Release|x86.Build.0 = Debug|x64 |
33 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x64.ActiveCfg = Debug|x64 | 33 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x64.ActiveCfg = Debug|x64 |
34 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x64.Build.0 = Debug|x64 | 34 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x64.Build.0 = Debug|x64 |
35 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x86.ActiveCfg = Debug|x64 | 35 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x86.ActiveCfg = Debug|x64 |
36 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x86.Build.0 = Debug|x64 | 36 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Debug|x86.Build.0 = Debug|x64 |
37 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x64.ActiveCfg = Debug|x64 | 37 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x64.ActiveCfg = Release|x64 |
38 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x64.Build.0 = Debug|x64 | 38 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x64.Build.0 = Release|x64 |
39 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x86.ActiveCfg = Debug|x64 | 39 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x86.ActiveCfg = Debug|x64 |
40 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x86.Build.0 = Debug|x64 | 40 | {6B5DF051-A51A-48CB-8ACD-C6FAD726019F}.Release|x86.Build.0 = Debug|x64 |
41 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x64.ActiveCfg = Debug | 41 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x64.ActiveCfg = Debug |
42 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x64.Build.0 = Debug | 42 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x64.Build.0 = Debug |
43 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x86.ActiveCfg = Debug | 43 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x86.ActiveCfg = Debug |
44 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x86.Build.0 = Debug | 44 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Debug|x86.Build.0 = Debug |
45 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x64.ActiveCfg = Debug | 45 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x64.ActiveCfg = Release |
46 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x64.Build.0 = Debug | 46 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x64.Build.0 = Release |
47 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x86.ActiveCfg = Debug | 47 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x86.ActiveCfg = Debug |
48 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x86.Build.0 = Debug | 48 | {78DEDBBE-AC84-496D-8907-40089B464A5B}.Release|x86.Build.0 = Debug |
49 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x64.ActiveCfg = Debug|x64 | 49 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x64.ActiveCfg = Debug|x64 |
50 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x64.Build.0 = Debug|x64 | 50 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x64.Build.0 = Debug|x64 |
51 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x86.ActiveCfg = Debug|x64 | 51 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x86.ActiveCfg = Debug|x64 |
52 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x86.Build.0 = Debug|x64 | 52 | {128784C2-9157-4291-8FD6-44637BE162FB}.Debug|x86.Build.0 = Debug|x64 |
53 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x64.ActiveCfg = Debug|x64 | 53 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x64.ActiveCfg = Release|x64 |
54 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x64.Build.0 = Debug|x64 | 54 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x64.Build.0 = Release|x64 |
55 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x86.ActiveCfg = Debug|x64 | 55 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x86.ActiveCfg = Debug|x64 |
56 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x86.Build.0 = Debug|x64 | 56 | {128784C2-9157-4291-8FD6-44637BE162FB}.Release|x86.Build.0 = Debug|x64 |
57 | EndGlobalSection | 57 | EndGlobalSection |