Show memory or disassembler.
200{
206
207
208
209
212 {
213 CheckForAddressMode =
TRUE;
214 }
215 else
216 {
217 CheckForAddressMode =
FALSE;
218 }
219
220
221
222
223 Buffer = (
UCHAR *)malloc(Size);
224
225
226
227
229 MemoryType,
230 ReadingType,
231 Pid,
232 Size,
233 CheckForAddressMode,
234 &AddressMode,
236 &ReturnedLength);
237
238
239
240
241 if (!Status)
242 {
243
244
245
247 {
248 ShowMessages(
"HyperDbg attempted to access an invalid target address: 0x%llx\n"
249 "if you are confident that the address is valid, it may be paged out "
250 "or not yet available in the current CR3 page table\n"
251 "you can use the '.pagein' command to load this page table into memory and "
252 "trigger a page fault (#PF), please refer to the documentation for further details\n\n",
254 }
255
256
257
258
259 std::free(Buffer);
260 return;
261 }
262
263 switch (Style)
264 {
266
267
268
269
270 if (Size == ReturnedLength)
271 {
275 Buffer,
277 }
278 else if (ReturnedLength == 0)
279 {
281 }
282 else
283 {
284 ShowMessages(
"err, invalid address or memory is smaller than the structure size");
285 }
286
287 break;
288
290
292 Buffer,
293 Size,
295 MemoryType,
296 ReturnedLength);
297
298 break;
299
301
303 Buffer,
304 Size,
306 MemoryType,
307 ReturnedLength);
308
309 break;
310
312
314 Buffer,
315 Size,
317 MemoryType,
318 ReturnedLength);
319
320 break;
321
323
325 Buffer,
326 Size,
328 MemoryType,
329 ReturnedLength);
330
331 break;
332
334
336
337 break;
338
340
341
342
343
345 {
346 ShowMessages(
"the target address seems to be located in a 32-bit program, if so, "
347 "please consider using the 'u32' instead to utilize the 32-bit disassembler\n");
348 }
349
350
351
352
353 if (ReturnedLength != 0)
354 {
356 Buffer,
358 ReturnedLength,
359 0,
361 NULL);
362 }
363 else
364 {
366 }
367
368 break;
369
371
372
373
374
376 {
377 ShowMessages(
"the target address seems to be located in a 64-bit program, if so, "
378 "please consider using the 'u' instead to utilize the 64-bit disassembler\n");
379 }
380
381
382
383
384 if (ReturnedLength != 0)
385 {
387 Buffer,
389 ReturnedLength,
390 0,
392 NULL);
393 }
394 else
395 {
397 }
398
399 break;
400 }
401
402
403
404
405 std::free(Buffer);
406}
UCHAR BOOLEAN
Definition BasicTypes.h:39
unsigned char BYTE
Definition BasicTypes.h:24
unsigned char UCHAR
Definition BasicTypes.h:35
UINT64 Address
Definition HyperDbgScriptImports.h:67
@ DEBUGGER_READ_ADDRESS_MODE_32_BIT
Definition RequestStructures.h:239
@ DEBUGGER_READ_ADDRESS_MODE_64_BIT
Definition RequestStructures.h:240
enum _DEBUGGER_READ_MEMORY_ADDRESS_MODE DEBUGGER_READ_MEMORY_ADDRESS_MODE
different address mode
@ DEBUGGER_SHOW_COMMAND_DT
Definition RequestStructures.h:251
@ DEBUGGER_SHOW_COMMAND_DC
Definition RequestStructures.h:255
@ DEBUGGER_SHOW_COMMAND_DISASSEMBLE32
Definition RequestStructures.h:253
@ DEBUGGER_SHOW_COMMAND_DD
Definition RequestStructures.h:257
@ DEBUGGER_SHOW_COMMAND_DQ
Definition RequestStructures.h:256
@ DEBUGGER_SHOW_COMMAND_DB
Definition RequestStructures.h:254
@ DEBUGGER_SHOW_COMMAND_DUMP
Definition RequestStructures.h:258
@ DEBUGGER_SHOW_COMMAND_DISASSEMBLE64
Definition RequestStructures.h:252
@ DEBUGGER_READ_VIRTUAL_ADDRESS
Definition RequestStructures.h:230
int HyperDbgDisassembler32(unsigned char *BufferToDisassemble, UINT64 BaseAddress, UINT64 Size, UINT32 MaximumInstrDecoded, BOOLEAN ShowBranchIsTakenOrNot, PRFLAGS Rflags)
Disassemble 32 bit assemblies.
Definition disassembler.cpp:373
int HyperDbgDisassembler64(unsigned char *BufferToDisassemble, UINT64 BaseAddress, UINT64 Size, UINT32 MaximumInstrDecoded, BOOLEAN ShowBranchIsTakenOrNot, PRFLAGS Rflags)
Disassemble x64 assemblies.
Definition disassembler.cpp:333
VOID CommandDumpSaveIntoFile(PVOID Buffer, UINT32 Length)
Saves the received buffers into the files.
Definition dump.cpp:301
void ShowMemoryCommandDD(unsigned char *OutputBuffer, UINT32 Size, UINT64 Address, DEBUGGER_READ_MEMORY_TYPE MemoryType, UINT64 Length)
Show memory in dword format (DD)
Definition readmem.cpp:555
void ShowMemoryCommandDQ(unsigned char *OutputBuffer, UINT32 Size, UINT64 Address, DEBUGGER_READ_MEMORY_TYPE MemoryType, UINT64 Length)
Show memory in qword format (DQ)
Definition readmem.cpp:604
void ShowMemoryCommandDB(unsigned char *OutputBuffer, UINT32 Size, UINT64 Address, DEBUGGER_READ_MEMORY_TYPE MemoryType, UINT64 Length)
Show memory in bytes (DB)
Definition readmem.cpp:418
BOOLEAN HyperDbgReadMemory(UINT64 TargetAddress, DEBUGGER_READ_MEMORY_TYPE MemoryType, DEBUGGER_READ_READING_TYPE ReadingType, UINT32 Pid, UINT32 Size, BOOLEAN GetAddressMode, DEBUGGER_READ_MEMORY_ADDRESS_MODE *AddressMode, BYTE *TargetBufferToStore, UINT32 *ReturnLength)
Read memory and disassembler.
Definition readmem.cpp:36
void ShowMemoryCommandDC(unsigned char *OutputBuffer, UINT32 Size, UINT64 Address, DEBUGGER_READ_MEMORY_TYPE MemoryType, UINT64 Length)
Show memory in dword format (DC)
Definition readmem.cpp:486
BOOLEAN ScriptEngineShowDataBasedOnSymbolTypesWrapper(const char *TypeName, UINT64 Address, BOOLEAN IsStruct, PVOID BufferAddress, const char *AdditionalParameters)
ScriptEngineShowDataBasedOnSymbolTypes wrapper.
Definition script-engine-wrapper.cpp:212
const char * TypeName
Definition RequestStructures.h:136
const char * AdditionalParameters
Definition RequestStructures.h:142