diff options
| author | jbzdarkid <jbzdarkid@gmail.com> | 2018-10-22 21:32:20 -0700 | 
|---|---|---|
| committer | jbzdarkid <jbzdarkid@gmail.com> | 2018-10-22 21:32:20 -0700 | 
| commit | 4da4677cb662108502791e49078df386949c0e21 (patch) | |
| tree | 3b9380a3a253b776e3b4a083717d1d89053571a9 /WitnessRandomizer | |
| parent | f255be24d96352c43ec5197cf1bfd6a5a7bb47be (diff) | |
| download | witness-tutorializer-4da4677cb662108502791e49078df386949c0e21.tar.gz witness-tutorializer-4da4677cb662108502791e49078df386949c0e21.tar.bz2 witness-tutorializer-4da4677cb662108502791e49078df386949c0e21.zip | |
Ideas & bugs & zzzzz
Diffstat (limited to 'WitnessRandomizer')
| -rw-r--r-- | WitnessRandomizer/Memory.h | 5 | ||||
| -rw-r--r-- | WitnessRandomizer/WitnessRandomizer.cpp | bin | 13170 -> 24480 bytes | |||
| -rw-r--r-- | WitnessRandomizer/WitnessRandomizer.h | 12 | 
3 files changed, 9 insertions, 8 deletions
| diff --git a/WitnessRandomizer/Memory.h b/WitnessRandomizer/Memory.h index 2453cf0..6b50948 100644 --- a/WitnessRandomizer/Memory.h +++ b/WitnessRandomizer/Memory.h | |||
| @@ -24,10 +24,11 @@ public: | |||
| 24 | } | 24 | } | 
| 25 | 25 | ||
| 26 | template <class T> | 26 | template <class T> | 
| 27 | void WriteData(const std::vector<int>& offsets, const std::vector<T>& data) { | 27 | bool WriteData(const std::vector<int>& offsets, const std::vector<T>& data) { | 
| 28 | if (!WriteProcessMemory(_handle, (LPVOID)ComputeOffset(offsets), &data[0], sizeof(T) * data.size(), NULL)) { | 28 | if (!WriteProcessMemory(_handle, (LPVOID)ComputeOffset(offsets), &data[0], sizeof(T) * data.size(), NULL)) { | 
| 29 | ThrowError(); | 29 | return false; | 
| 30 | } | 30 | } | 
| 31 | return true; | ||
| 31 | } | 32 | } | 
| 32 | 33 | ||
| 33 | private: | 34 | private: | 
| diff --git a/WitnessRandomizer/WitnessRandomizer.cpp b/WitnessRandomizer/WitnessRandomizer.cpp index ebf0146..9d3e917 100644 --- a/WitnessRandomizer/WitnessRandomizer.cpp +++ b/WitnessRandomizer/WitnessRandomizer.cpp | |||
| Binary files differ | |||
| diff --git a/WitnessRandomizer/WitnessRandomizer.h b/WitnessRandomizer/WitnessRandomizer.h index 26affa3..182c88e 100644 --- a/WitnessRandomizer/WitnessRandomizer.h +++ b/WitnessRandomizer/WitnessRandomizer.h | |||
| @@ -2,18 +2,18 @@ | |||
| 2 | 2 | ||
| 3 | int SWAP_TARGETS = 0x1; | 3 | int SWAP_TARGETS = 0x1; | 
| 4 | int SWAP_PATHWAYS = 0x2; | 4 | int SWAP_PATHWAYS = 0x2; | 
| 5 | int SWAP_STYLE = 0x40; | 5 | int SWAP_STYLE = 0x4; | 
| 6 | int SWAP_COLORS = 0x4; | 6 | int SWAP_COLORS = 0x8; | 
| 7 | int SWAP_TRACED = 0x80; | 7 | int SWAP_TRACED = 0x10; | 
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | int SWAP_SIZE = 0x8; | 10 | int SWAP_SIZE = 0x20; | 
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | class WitnessRandomizer { | 13 | class WitnessRandomizer { | 
| 14 | public: | 14 | public: | 
| 15 | 15 | ||
| 16 | WitnessRandomizer() = default; | 16 | WitnessRandomizer(); | 
| 17 | 17 | ||
| 18 | void Randomize(std::vector<int> panels, int flags); | 18 | void Randomize(std::vector<int> panels, int flags); | 
| 19 | void SwapPanels(int panel1, int panel2, int flags); | 19 | void SwapPanels(int panel1, int panel2, int flags); | 
| @@ -21,5 +21,5 @@ public: | |||
| 21 | private: | 21 | private: | 
| 22 | void SwapPanelData(int panel1, int panel2, int finalOffset, int dataSize); | 22 | void SwapPanelData(int panel1, int panel2, int finalOffset, int dataSize); | 
| 23 | 23 | ||
| 24 | Memory _memory = Memory("witness64_d3d11.exe"); | 24 | Memory _memory; | 
| 25 | }; \ No newline at end of file | 25 | }; \ No newline at end of file | 
