diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-08 22:06:07 -0800 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-08 22:06:07 -0800 |
commit | 4d55d7d9aad8d3c2bedec371c165bbb848c3786b (patch) | |
tree | 6d9c17bcc538a95c8edb28045e1f92d1a9a6177b /Source/Memory.h | |
parent | 0e6b61f87b676028fcfd75bbf576f48a0ef91632 (diff) | |
download | witness-tutorializer-4d55d7d9aad8d3c2bedec371c165bbb848c3786b.tar.gz witness-tutorializer-4d55d7d9aad8d3c2bedec371c165bbb848c3786b.tar.bz2 witness-tutorializer-4d55d7d9aad8d3c2bedec371c165bbb848c3786b.zip |
Looks like chained read/write isn't working
Diffstat (limited to 'Source/Memory.h')
-rw-r--r-- | Source/Memory.h | 140 |
1 files changed, 139 insertions, 1 deletions
diff --git a/Source/Memory.h b/Source/Memory.h index c19d92b..95de884 100644 --- a/Source/Memory.h +++ b/Source/Memory.h | |||
@@ -54,6 +54,7 @@ public: | |||
54 | private: | 54 | private: |
55 | template<class T> | 55 | template<class T> |
56 | std::vector<T> ReadData(const std::vector<int>& offsets, size_t numItems) { | 56 | std::vector<T> ReadData(const std::vector<int>& offsets, size_t numItems) { |
57 | if (numItems == 0) return {}; | ||
57 | std::vector<T> data; | 58 | std::vector<T> data; |
58 | data.resize(numItems); | 59 | data.resize(numItems); |
59 | for (int i=0; i<5; i++) { | 60 | for (int i=0; i<5; i++) { |
@@ -68,6 +69,7 @@ private: | |||
68 | 69 | ||
69 | template <class T> | 70 | template <class T> |
70 | void WriteData(const std::vector<int>& offsets, const std::vector<T>& data) { | 71 | void WriteData(const std::vector<int>& offsets, const std::vector<T>& data) { |
72 | if (data.empty()) return; | ||
71 | for (int i=0; i<5; i++) { | 73 | for (int i=0; i<5; i++) { |
72 | if (WriteProcessMemory(_handle, ComputeOffset(offsets), &data[0], sizeof(T) * data.size(), nullptr)) { | 74 | if (WriteProcessMemory(_handle, ComputeOffset(offsets), &data[0], sizeof(T) * data.size(), nullptr)) { |
73 | return; | 75 | return; |
@@ -97,4 +99,140 @@ private: | |||
97 | friend class Temp; | 99 | friend class Temp; |
98 | friend class ChallengeRandomizer; | 100 | friend class ChallengeRandomizer; |
99 | friend class Randomizer; | 101 | friend class Randomizer; |
100 | }; \ No newline at end of file | 102 | }; |
103 | |||
104 | #if GLOBALS == 0x5B28C0 | ||
105 | #define PATH_COLOR 0xC8 | ||
106 | #define REFLECTION_PATH_COLOR 0xD8 | ||
107 | #define DOT_COLOR 0xF8 | ||
108 | #define ACTIVE_COLOR 0x108 | ||
109 | #define BACKGROUND_REGION_COLOR 0x118 | ||
110 | #define SUCCESS_COLOR_A 0x128 | ||
111 | #define SUCCESS_COLOR_B 0x138 | ||
112 | #define STROBE_COLOR_A 0x148 | ||
113 | #define STROBE_COLOR_B 0x158 | ||
114 | #define ERROR_COLOR 0x168 | ||
115 | #define PATTERN_POINT_COLOR 0x188 | ||
116 | #define PATTERN_POINT_COLOR_A 0x198 | ||
117 | #define PATTERN_POINT_COLOR_B 0x1A8 | ||
118 | #define SYMBOL_A 0x1B8 | ||
119 | #define SYMBOL_B 0x1C8 | ||
120 | #define SYMBOL_C 0x1D8 | ||
121 | #define SYMBOL_D 0x1E8 | ||
122 | #define SYMBOL_E 0x1F8 | ||
123 | #define PUSH_SYMBOL_COLORS 0x208 | ||
124 | #define OUTER_BACKGROUND 0x20C | ||
125 | #define OUTER_BACKGROUND_MODE 0x21C | ||
126 | #define TRACED_EDGES 0x230 | ||
127 | #define AUDIO_PREFIX 0x278 | ||
128 | #define POWER 0x2A8 | ||
129 | #define TARGET 0x2BC | ||
130 | #define POWER_OFF_ON_FAIL 0x2C0 | ||
131 | #define IS_CYLINDER 0x2FC | ||
132 | #define CYLINDER_Z0 0x300 | ||
133 | #define CYLINDER_Z1 0x304 | ||
134 | #define CYLINDER_RADIUS 0x308 | ||
135 | #define CURSOR_SPEED_SCALE 0x358 | ||
136 | #define NEEDS_REDRAW 0x384 | ||
137 | #define SPECULAR_ADD 0x398 | ||
138 | #define SPECULAR_POWER 0x39C | ||
139 | #define PATH_WIDTH_SCALE 0x3A4 | ||
140 | #define STARTPOINT_SCALE 0x3A8 | ||
141 | #define NUM_DOTS 0x3B8 | ||
142 | #define NUM_CONNECTIONS 0x3BC | ||
143 | #define MAX_BROADCAST_DISTANCE 0x3C0 | ||
144 | #define DOT_POSITIONS 0x3C8 | ||
145 | #define DOT_FLAGS 0x3D0 | ||
146 | #define DOT_CONNECTION_A 0x3D8 | ||
147 | #define DOT_CONNECTION_B 0x3E0 | ||
148 | #define DECORATIONS 0x420 | ||
149 | #define DECORATION_FLAGS 0x428 | ||
150 | #define DECORATION_COLORS 0x430 | ||
151 | #define NUM_DECORATIONS 0x438 | ||
152 | #define REFLECTION_DATA 0x440 | ||
153 | #define GRID_SIZE_X 0x448 | ||
154 | #define GRID_SIZE_Y 0x44C | ||
155 | #define STYLE_FLAGS 0x450 | ||
156 | #define SEQUENCE_LEN 0x45C | ||
157 | #define SEQUENCE 0x460 | ||
158 | #define DOT_SEQUENCE_LEN 0x468 | ||
159 | #define DOT_SEQUENCE 0x470 | ||
160 | #define DOT_SEQUENCE_LEN_REFLECTION 0x478 | ||
161 | #define DOT_SEQUENCE_REFLECTION 0x480 | ||
162 | #define NUM_COLORED_REGIONS 0x4A0 | ||
163 | #define COLORED_REGIONS 0x4A8 | ||
164 | #define PANEL_TARGET 0x4B0 | ||
165 | #define SPECULAR_TEXTURE 0x4D8 | ||
166 | #define CABLE_TARGET_2 0xD8 | ||
167 | #define AUDIO_LOG_NAME 0xC8 | ||
168 | #define OPEN_RATE 0xE8 | ||
169 | #define METADATA 0xF2 // sizeof(short) | ||
170 | #define HOTEL_EP_NAME 0x4BC640 | ||
171 | #elif GLOBALS == 0x62D0A0 | ||
172 | #define PATH_COLOR 0xC0 | ||
173 | #define REFLECTION_PATH_COLOR 0xD0 | ||
174 | #define DOT_COLOR 0xF0 | ||
175 | #define ACTIVE_COLOR 0x100 | ||
176 | #define BACKGROUND_REGION_COLOR 0x110 | ||
177 | #define SUCCESS_COLOR_A 0x120 | ||
178 | #define SUCCESS_COLOR_B 0x130 | ||
179 | #define STROBE_COLOR_A 0x140 | ||
180 | #define STROBE_COLOR_B 0x150 | ||
181 | #define ERROR_COLOR 0x160 | ||
182 | #define PATTERN_POINT_COLOR 0x180 | ||
183 | #define PATTERN_POINT_COLOR_A 0x190 | ||
184 | #define PATTERN_POINT_COLOR_B 0x1A0 | ||
185 | #define SYMBOL_A 0x1B0 | ||
186 | #define SYMBOL_B 0x1C0 | ||
187 | #define SYMBOL_C 0x1D0 | ||
188 | #define SYMBOL_D 0x1E0 | ||
189 | #define SYMBOL_E 0x1F0 | ||
190 | #define PUSH_SYMBOL_COLORS 0x200 | ||
191 | #define OUTER_BACKGROUND 0x204 | ||
192 | #define OUTER_BACKGROUND_MODE 0x214 | ||
193 | #define TRACED_EDGES 0x228 | ||
194 | #define AUDIO_PREFIX 0x270 | ||
195 | #define POWER 0x2A0 | ||
196 | #define TARGET 0x2B4 | ||
197 | #define POWER_OFF_ON_FAIL 0x2B8 | ||
198 | #define IS_CYLINDER 0x2F4 | ||
199 | #define CYLINDER_Z0 0x2F8 | ||
200 | #define CYLINDER_Z1 0x2FC | ||
201 | #define CYLINDER_RADIUS 0x300 | ||
202 | #define CURSOR_SPEED_SCALE 0x350 | ||
203 | #define NEEDS_REDRAW 0x37C | ||
204 | #define SPECULAR_ADD 0x38C | ||
205 | #define SPECULAR_POWER 0x390 | ||
206 | #define PATH_WIDTH_SCALE 0x39C | ||
207 | #define STARTPOINT_SCALE 0x3A0 | ||
208 | #define NUM_DOTS 0x3B4 | ||
209 | #define NUM_CONNECTIONS 0x3B8 | ||
210 | #define MAX_BROADCAST_DISTANCE 0x3BC | ||
211 | #define DOT_POSITIONS 0x3C0 | ||
212 | #define DOT_FLAGS 0x3C8 | ||
213 | #define DOT_CONNECTION_A 0x3D0 | ||
214 | #define DOT_CONNECTION_B 0x3D8 | ||
215 | #define DECORATIONS 0x418 | ||
216 | #define DECORATION_FLAGS 0x420 | ||
217 | #define DECORATION_COLORS 0x428 | ||
218 | #define NUM_DECORATIONS 0x430 | ||
219 | #define REFLECTION_DATA 0x438 | ||
220 | #define GRID_SIZE_X 0x440 | ||
221 | #define GRID_SIZE_Y 0x444 | ||
222 | #define STYLE_FLAGS 0x448 | ||
223 | #define SEQUENCE_LEN 0x454 | ||
224 | #define SEQUENCE 0x458 | ||
225 | #define DOT_SEQUENCE_LEN 0x460 | ||
226 | #define DOT_SEQUENCE 0x468 | ||
227 | #define DOT_SEQUENCE_LEN_REFLECTION 0x470 | ||
228 | #define DOT_SEQUENCE_REFLECTION 0x478 | ||
229 | #define NUM_COLORED_REGIONS 0x498 | ||
230 | #define COLORED_REGIONS 0x4A0 | ||
231 | #define PANEL_TARGET 0x4A8 | ||
232 | #define SPECULAR_TEXTURE 0x4D0 | ||
233 | #define CABLE_TARGET_2 0xD0 | ||
234 | #define AUDIO_LOG_NAME 0x0 | ||
235 | #define OPEN_RATE 0xE0 | ||
236 | #define METADATA 0x13A // sizeof(short) | ||
237 | #define HOTEL_EP_NAME 0x51E340 | ||
238 | #endif \ No newline at end of file | ||