about summary refs log tree commit diff stats
path: root/Test
diff options
context:
space:
mode:
Diffstat (limited to 'Test')
-rw-r--r--Test/Temp.cpp31
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
4GTEST_TEST(SwapTests, Shipwreck) { 6class Temp : public testing::Test
7{
8protected:
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
18TEST(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
35TEST_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