|
HyperDbg Debugger
|
Demonstrates basic hooking functionality of the ZydisFormatter class by implementing a custom symbol-resolver.
More...
#include "pch.h"#include "Zycore/Format.h"#include "Zycore/LibC.h"#include "Zydis/Zydis.h"Classes | |
| struct | ZydisSymbol_ |
Defines the ZydisSymbol struct. More... | |
Macros | |
| #define | PaddingLength 12 |
Typedefs | |
| typedef struct ZydisSymbol_ | ZydisSymbol |
Defines the ZydisSymbol struct. | |
Functions | |
| VOID | DisassembleBuffer (ZydisDecoder *decoder, ZyanU64 runtime_address, ZyanU8 *data, ZyanUSize length, uint32_t maximum_instr, BOOLEAN is_x86_64, BOOLEAN show_of_branch_is_taken, PRFLAGS rflags) |
| Disassemble a user-mode buffer. | |
| int | ZydisTest () |
| Zydis test. | |
| int | HyperDbgDisassembler64 (unsigned char *BufferToDisassemble, UINT64 BaseAddress, UINT64 Size, UINT32 MaximumInstrDecoded, BOOLEAN ShowBranchIsTakenOrNot, PRFLAGS Rflags) |
| Disassemble x64 assemblies. | |
| int | HyperDbgDisassembler32 (unsigned char *BufferToDisassemble, UINT64 BaseAddress, UINT64 Size, UINT32 MaximumInstrDecoded, BOOLEAN ShowBranchIsTakenOrNot, PRFLAGS Rflags) |
| Disassemble 32 bit assemblies. | |
| DEBUGGER_CONDITIONAL_JUMP_STATUS | HyperDbgIsConditionalJumpTaken (unsigned char *BufferToDisassemble, UINT64 BuffLength, RFLAGS Rflags, BOOLEAN Isx86_64) |
| Check whether the jump is taken or not taken (in debugger) | |
| BOOLEAN | HyperDbgCheckWhetherTheCurrentInstructionIsCall (unsigned char *BufferToDisassemble, UINT64 BuffLength, BOOLEAN Isx86_64, PUINT32 CallLength) |
| Check whether the current instruction is a 'call' or not. | |
| UINT32 | HyperDbgLengthDisassemblerEngine (unsigned char *BufferToDisassemble, UINT64 BuffLength, BOOLEAN Isx86_64) |
| Length Disassembler engine based on Zydis. | |
| BOOLEAN | HyperDbgCheckWhetherTheCurrentInstructionIsCallOrRet (unsigned char *BufferToDisassemble, UINT64 CurrentRip, UINT32 BuffLength, BOOLEAN Isx86_64, PBOOLEAN IsRet) |
| Check whether the current instruction is a 'call' or 'ret' or not. | |
| BOOLEAN | HyperDbgCheckWhetherTheCurrentInstructionIsRet (unsigned char *BufferToDisassemble, UINT64 BuffLength, BOOLEAN Isx86_64) |
| Check whether the current instruction is a 'ret' or not. | |
Variables | |
| UINT32 | g_DisassemblerSyntax |
| Shows the syntax used in !u !u2 u u2 commands. | |
| std::map< UINT64, LOCAL_FUNCTION_DESCRIPTION > | g_DisassemblerSymbolMap |
| Symbol table for disassembler. | |
| BOOLEAN | g_AddressConversion |
| Whether converting addresses to object names or not. | |
| ZydisFormatterFunc | default_print_address_absolute |
Demonstrates basic hooking functionality of the ZydisFormatter class by implementing a custom symbol-resolver.
| #define PaddingLength 12 |
| typedef struct ZydisSymbol_ ZydisSymbol |
Defines the ZydisSymbol struct.
| VOID DisassembleBuffer | ( | ZydisDecoder * | decoder, |
| ZyanU64 | runtime_address, | ||
| ZyanU8 * | data, | ||
| ZyanUSize | length, | ||
| uint32_t | maximum_instr, | ||
| BOOLEAN | is_x86_64, | ||
| BOOLEAN | show_of_branch_is_taken, | ||
| PRFLAGS | rflags ) |
Disassemble a user-mode buffer.
| decoder | |
| runtime_address | |
| data | |
| length | |
| maximum_instr | |
| is_x86_64 | |
| show_of_branch_is_taken | |
| rflags | just used in the case show_of_branch_is_taken is true |
| BOOLEAN HyperDbgCheckWhetherTheCurrentInstructionIsCall | ( | unsigned char * | BufferToDisassemble, |
| UINT64 | BuffLength, | ||
| BOOLEAN | Isx86_64, | ||
| PUINT32 | CallLength ) |
Check whether the current instruction is a 'call' or not.
| BufferToDisassemble | Current Bytes of assembly |
| BuffLength | Length of buffer |
| Isx86_64 | Whether it's an x86 or x64 |
| CallLength | Length of call (if return value is TRUE) |
| BOOLEAN HyperDbgCheckWhetherTheCurrentInstructionIsCallOrRet | ( | unsigned char * | BufferToDisassemble, |
| UINT64 | CurrentRip, | ||
| UINT32 | BuffLength, | ||
| BOOLEAN | Isx86_64, | ||
| PBOOLEAN | IsRet ) |
Check whether the current instruction is a 'call' or 'ret' or not.
| BufferToDisassemble | Current Bytes of assembly |
| CurrentRip | Address of current RIP |
| BuffLength | Length of buffer |
| Isx86_64 | Whether it's an x86 or x64 |
| IsRet | Whether it's a 'ret' or not |
| BOOLEAN HyperDbgCheckWhetherTheCurrentInstructionIsRet | ( | unsigned char * | BufferToDisassemble, |
| UINT64 | BuffLength, | ||
| BOOLEAN | Isx86_64 ) |
Check whether the current instruction is a 'ret' or not.
| BufferToDisassemble | Current Bytes of assembly |
| BuffLength | Length of buffer |
| Isx86_64 | Whether it's an x86 or x64 |
| RetLength | Length of ret (if return value is TRUE) |
| int HyperDbgDisassembler32 | ( | unsigned char * | BufferToDisassemble, |
| UINT64 | BaseAddress, | ||
| UINT64 | Size, | ||
| UINT32 | MaximumInstrDecoded, | ||
| BOOLEAN | ShowBranchIsTakenOrNot, | ||
| PRFLAGS | Rflags ) |
Disassemble 32 bit assemblies.
| BufferToDisassemble | buffer to disassemble |
| BaseAddress | the base address of assembly |
| Size | size of buffer |
| MaximumInstrDecoded | maximum instructions to decode, 0 means all possible |
| ShowBranchIsTakenOrNot | on conditional jumps shows whether jumps is taken or not |
| Rflags | in the case ShowBranchIsTakenOrNot is true, we use this variable to show the result of jump |
| int HyperDbgDisassembler64 | ( | unsigned char * | BufferToDisassemble, |
| UINT64 | BaseAddress, | ||
| UINT64 | Size, | ||
| UINT32 | MaximumInstrDecoded, | ||
| BOOLEAN | ShowBranchIsTakenOrNot, | ||
| PRFLAGS | Rflags ) |
Disassemble x64 assemblies.
| BufferToDisassemble | buffer to disassemble |
| BaseAddress | the base address of assembly |
| Size | size of buffer |
| MaximumInstrDecoded | maximum instructions to decode, 0 means all possible |
| ShowBranchIsTakenOrNot | on conditional jumps shows whether jumps is taken or not |
| Rflags | in the case ShowBranchIsTakenOrNot is true, we use this variable to show the result of jump |
| DEBUGGER_CONDITIONAL_JUMP_STATUS HyperDbgIsConditionalJumpTaken | ( | unsigned char * | BufferToDisassemble, |
| UINT64 | BuffLength, | ||
| RFLAGS | Rflags, | ||
| BOOLEAN | Isx86_64 ) |
Check whether the jump is taken or not taken (in debugger)
the implementation of this function derived from the table in this site : http://www.unixwiz.net/techtips/x86-jumps.html
| BufferToDisassemble | Current Bytes of assembly |
| BuffLength | Length of buffer |
| Rflags | The kernel's current RFLAG |
| Isx86_64 | Whether it's an x86 or x64 |
| UINT32 HyperDbgLengthDisassemblerEngine | ( | unsigned char * | BufferToDisassemble, |
| UINT64 | BuffLength, | ||
| BOOLEAN | Isx86_64 ) |
Length Disassembler engine based on Zydis.
| BufferToDisassemble | Current Bytes of assembly |
| BuffLength | Length of buffer |
| Isx86_64 | Whether it's an x86 or x64 |
| Length | of call (if return value is TRUE) |
| int ZydisTest | ( | ) |
Zydis test.
| ZydisFormatterFunc default_print_address_absolute |
|
extern |
Whether converting addresses to object names or not.
it is enabled by default
|
extern |
Symbol table for disassembler.
|
extern |
Shows the syntax used in !u !u2 u u2 commands.
INTEL = 1, ATT = 2, MASM = 3