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 /Test/Temp.cpp | |
parent | 1f85741c8d12d9b1fbd55b29f334de572f9eea9b (diff) | |
download | witness-tutorializer-1501b173c058f11e53507532ad583a6ac9c061cc.tar.gz witness-tutorializer-1501b173c058f11e53507532ad583a6ac9c061cc.tar.bz2 witness-tutorializer-1501b173c058f11e53507532ad583a6ac9c061cc.zip |
4.0.5
Diffstat (limited to 'Test/Temp.cpp')
-rw-r--r-- | Test/Temp.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
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 | ||