Skip to content

Commit

Permalink
v0.8.2
Browse files Browse the repository at this point in the history
v0.8.2
  • Loading branch information
SinaKarvandi committed Mar 19, 2024
2 parents 68e0d32 + 5400e4f commit 103874d
Show file tree
Hide file tree
Showing 296 changed files with 6,489 additions and 4,381 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
[submodule "hyperdbg/dependencies/phnt"]
path = hyperdbg/dependencies/phnt
url = https://github.com/HyperDbg/phnt.git
[submodule "hyperdbg/dependencies/pdbex"]
path = hyperdbg/dependencies/pdbex
url = https://github.com/HyperDbg/pdbex.git
[submodule "hyperdbg/dependencies/zydis"]
path = hyperdbg/dependencies/zydis
url = https://github.com/HyperDbg/zydis
[submodule "hyperdbg/script-engine/modules/script-engine-test"]
path = hyperdbg/script-engine/modules/script-engine-test
url = https://github.com/HyperDbg/script-engine-test
[submodule "hyperdbg/dependencies/pdbex"]
path = hyperdbg/dependencies/pdbex
url = https://github.com/HyperDbg/pdbex.git
26 changes: 20 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,40 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.1.0] - 2024-02-01
## [0.8.2.0] - 2024-03-19
New release of the HyperDbg Debugger.

### Added
- Add user-defined functions and variable types in script engine thanks to [@xmaple555](https://github.com/xmaple555) ([link](https://docs.hyperdbg.org/commands/scripting-language/constants-and-functions))([link](https://github.com/HyperDbg/HyperDbg/pull/342))

### Changed
- Fix the issue of not intercepting memory monitoring on non-contiguous physical memory allocations
- The speed of memory read/write/execution interception is enhanced by avoiding triggering out-of-range events
- Fix debuggee crash after running the '.debug close' command on the debugger
- The problem with adding edge MTRR pages is fixed thanks to [@Maladiy](https://github.com/Maladiy) ([link](https://github.com/HyperDbg/HyperDbg/pull/347))
- All compiler/linker warnings of kernel-mode modules are fixed
- User/Kernel modules of HyperDbg now compiled with "treat warning as error"
- After downloading new symbols it is automatically loaded
- Fix error messages/comments spelling typos

## [0.8.1.0] - 2024-02-01
New release of the HyperDbg Debugger.

### Added
- The **!monitor** command now supports length in parameters ([link](https://docs.hyperdbg.org/commands/extension-commands/monitor#syntax))

### Changed
- Fix the issue of not intercepting memory monitoring on non-contiguous physical memory allocations
- The speed of memory read/write/execution interception is enhanced by avoiding triggering out-of-range events

## [0.8.0.0] - 2024-01-28
New release of the HyperDbg Debugger thanks to [@mattiwatti](https://github.com/Mattiwatti).

### Changed
- Fix miscalculating MTRRs in 13th gen processors

### Added
- The **!mode** event command is added to detect kernel-to-user and user-to-kernel transitions ([link](https://docs.hyperdbg.org/commands/extension-commands/mode))
- The 'preactivate' command is added to support initializing special functionalities in the Debugger Mode ([link](https://docs.hyperdbg.org/commands/debugging-commands/preactivate))

### Changed
- Fix miscalculating MTRRs in 13th gen processors

## [0.7.2.0] - 2024-01-23
New release of the HyperDbg Debugger thanks to [@mattiwatti](https://github.com/Mattiwatti) and [@cutecatsandvirtualmachines](https://github.com/cutecatsandvirtualmachines).

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://raw.githubusercontent.com/HyperDbg/graphics/master/Badges/License-GPLv3-blue.svg" alt="License"></a>
</p>

<a href="https://hyperdbg.org/"><img align="right" width="150" height="150" src="https://github.com/HyperDbg/graphics/raw/master/Art%20Board/HyperDbg-Cat.Circle.Compressed.png" alt="HyperDbg Debugger"></a></br>

# HyperDbg Debugger

<a href="https://hyperdbg.org/"><img align="right" width="150" height="150" src="https://github.com/HyperDbg/graphics/raw/master/Art%20Board/HyperDbg-Cat.Circle.Compressed.png" alt="HyperDbg Debugger"></a></br>
HyperDbg Debugger is an open-source, community-driven, hypervisor-assisted, user-mode, and kernel-mode Windows debugger with a focus on using modern hardware technologies. It is a debugger designed for analyzing, fuzzing, and reversing.

You can follow **HyperDbg** on **[Twitter](https://twitter.com/HyperDbg)** to get notified about new releases, or join the HyperDbg **[Telegram](https://t.me/HyperDbg)** group, where you can ask developers and open-source reversing enthusiasts for help with setting up and running HyperDbg.
Expand Down
8 changes: 4 additions & 4 deletions hyperdbg/hprdbgctrl/code/app/hprdbgctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ ReadIrpBasedBuffer()
}

//
// allocate buffer for transfering messages
// allocate buffer for transferring messages
//
char * OutputBuffer = (char *)malloc(UsermodeBufferSize);

Expand Down Expand Up @@ -196,7 +196,7 @@ ReadIrpBasedBuffer()
if (!Status)
{
//
// Error occured for second time, and we show the error message
// Error occurred for second time, and we show the error message
//
// ShowMessages("ioctl failed with code 0x%x\n", GetLastError());

Expand Down Expand Up @@ -401,7 +401,7 @@ ReadIrpBasedBuffer()
}
catch (const std::exception &)
{
ShowMessages("err, exception occured in creating handle or parsing buffer\n");
ShowMessages("err, exception occurred in creating handle or parsing buffer\n");
}

free(OutputBuffer);
Expand Down Expand Up @@ -570,7 +570,7 @@ HyperDbgLoadVmm()
else
{
ShowMessages("this program is not designed to run in a non-VT-x "
"environemnt !\n");
"environment !\n");
return 1;
}

Expand Down
74 changes: 37 additions & 37 deletions hyperdbg/hprdbgctrl/code/common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ SeparateTo64BitValue(UINT64 Value)
/**
* @brief print bits and bytes for d* commands
*
* @param size
* @param ptr
* @param Size
* @param Ptr
* @return VOID
*/
VOID
PrintBits(size_t const size, void const * const ptr)
PrintBits(const UINT32 Size, const void * Ptr)
{
unsigned char * b = (unsigned char *)ptr;
unsigned char byte;
unsigned char * Buf = (unsigned char *)Ptr;
unsigned char Byte;
int i, j;

for (i = size - 1; i >= 0; i--)
for (i = Size - 1; i >= 0; i--)
{
for (j = 7; j >= 0; j--)
{
byte = (b[i] >> j) & 1;
ShowMessages("%u", byte);
Byte = (Buf[i] >> j) & 1;
ShowMessages("%u", Byte);
}
ShowMessages(" ", byte);
ShowMessages(" ", Byte);
}
}

Expand Down Expand Up @@ -390,14 +390,14 @@ ConvertStringToUInt32(string TextToConvert, PUINT32 Result)
*Result = i;
return TRUE;
}
catch (std::invalid_argument const & e)
catch (std::invalid_argument const &)
{
//
// Bad input: std::invalid_argument thrown
//
return FALSE;
}
catch (std::out_of_range const & e)
catch (std::out_of_range const &)
{
//
// Integer overflow: std::out_of_range thrown
Expand All @@ -420,7 +420,7 @@ ConvertStringToUInt32(string TextToConvert, PUINT32 Result)
else
{
//
// It's hex numer
// It's hex number
//
UINT32 TempResult;
TempResult = stoi(TextToConvert, nullptr, 16);
Expand Down Expand Up @@ -505,47 +505,47 @@ HPRDBGCTRL_API bool
HyperDbgVmxSupportDetection()
{
//
// Call asm function
// Call assembly function
//
return AsmVmxSupportDetection();
}

/**
* @brief SetPrivilege enables/disables process token privilege
*
* @param hToken
* @param lpszPrivilege
* @param bEnablePrivilege
* @param Token
* @param Privilege
* @param EnablePrivilege
* @return BOOL
*/
BOOL
SetPrivilege(HANDLE hToken, // access token handle
LPCTSTR lpszPrivilege, // name of privilege to enable/disable
BOOL bEnablePrivilege // to enable or disable privilege
SetPrivilege(HANDLE Token, // access token handle
LPCTSTR Privilege, // name of privilege to enable/disable
BOOL EnablePrivilege // to enable or disable privilege
)
{
TOKEN_PRIVILEGES tp;
LUID luid;
TOKEN_PRIVILEGES Tp;
LUID Luid;

if (!LookupPrivilegeValue(NULL, // lookup privilege on local system
lpszPrivilege, // privilege to lookup
&luid)) // receives LUID of privilege
if (!LookupPrivilegeValue(NULL, // lookup privilege on local system
Privilege, // privilege to lookup
&Luid)) // receives LUID of privilege
{
ShowMessages("err, in LookupPrivilegeValue (%x)\n", GetLastError());
return FALSE;
}

tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
if (bEnablePrivilege)
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
Tp.PrivilegeCount = 1;
Tp.Privileges[0].Luid = Luid;
if (EnablePrivilege)
Tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
else
tp.Privileges[0].Attributes = 0;
Tp.Privileges[0].Attributes = 0;

//
// Enable the privilege or disable all privileges.
//
if (!AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), (PTOKEN_PRIVILEGES)NULL, (PDWORD)NULL))
if (!AdjustTokenPrivileges(Token, FALSE, &Tp, sizeof(TOKEN_PRIVILEGES), (PTOKEN_PRIVILEGES)NULL, (PDWORD)NULL))
{
ShowMessages("err, in AdjustTokenPrivileges (%x)\n", GetLastError());
return FALSE;
Expand Down Expand Up @@ -743,7 +743,7 @@ StringToWString(std::wstring & ws, const std::string & s)
VOID
SplitPathAndArgs(std::vector<std::string> & Qargs, const std::string & Command)
{
int Len = Command.length();
int Len = (int)Command.length();
bool Qot = false, Sqot = false;
int ArgLen;

Expand Down Expand Up @@ -1077,11 +1077,11 @@ CheckAccessValidityAndSafety(UINT64 TargetAddress, UINT32 Size)
//
// Address should be accessed in more than one page
//
UINT64 ReadSize = AddressToCheck;
UINT32 ReadSize = 0;

while (Size != 0)
{
ReadSize = (UINT64)PAGE_ALIGN(TargetAddress + PAGE_SIZE) - TargetAddress;
ReadSize = (UINT32)((UINT64)PAGE_ALIGN(TargetAddress + PAGE_SIZE) - TargetAddress);

if (ReadSize == PAGE_SIZE && Size < PAGE_SIZE)
{
Expand Down Expand Up @@ -1128,9 +1128,9 @@ CheckAccessValidityAndSafety(UINT64 TargetAddress, UINT32 Size)
//

//
// There is no way to perfom this check! The below implementation doesn't satisfy
// There is no way to perform this check! The below implementation doesn't satisfy
// our needs for address checks, but we're not trying to ask kernel about it as
// HyperDbg's script engine is not designed to be runned these functions in user-mode
// HyperDbg's script engine is not designed to be ran these functions in user-mode
// so we left it unimplemented to avoid crashes in the main program
//
return FALSE;
Expand All @@ -1147,11 +1147,11 @@ CheckAccessValidityAndSafety(UINT64 TargetAddress, UINT32 Size)
//
// Address should be accessed in more than one page
//
UINT64 ReadSize = AddressToCheck;
UINT32 ReadSize = 0;

while (Size != 0)
{
ReadSize = (UINT64)PAGE_ALIGN(TargetAddress + PAGE_SIZE) - TargetAddress;
ReadSize = (UINT32)((UINT64)PAGE_ALIGN(TargetAddress + PAGE_SIZE) - TargetAddress);

if (ReadSize == PAGE_SIZE && Size < PAGE_SIZE)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ CommandBcHelp()
/**
* @brief handler of bc command
*
* @param SplittedCommand
* @param SplitCommand
* @param Command
* @return VOID
*/
VOID
CommandBc(vector<string> SplittedCommand, string Command)
CommandBc(vector<string> SplitCommand, string Command)
{
UINT64 BreakpointId;
DEBUGGEE_BP_LIST_OR_MODIFY_PACKET Request = {0};

//
// Validate the commands
//
if (SplittedCommand.size() != 2)
if (SplitCommand.size() != 2)
{
ShowMessages("incorrect use of the 'bc'\n\n");
CommandBcHelp();
Expand All @@ -59,7 +59,7 @@ CommandBc(vector<string> SplittedCommand, string Command)
//
// Get the breakpoint id
//
if (!ConvertStringToUInt64(SplittedCommand.at(1), &BreakpointId))
if (!ConvertStringToUInt64(SplitCommand.at(1), &BreakpointId))
{
ShowMessages("please specify a correct hex value for breakpoint id\n\n");
CommandBcHelp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ CommandBdHelp()
/**
* @brief handler of bd command
*
* @param SplittedCommand
* @param SplitCommand
* @param Command
* @return VOID
*/
VOID
CommandBd(vector<string> SplittedCommand, string Command)
CommandBd(vector<string> SplitCommand, string Command)
{
UINT64 BreakpointId;
DEBUGGEE_BP_LIST_OR_MODIFY_PACKET Request = {0};

//
// Validate the commands
//
if (SplittedCommand.size() != 2)
if (SplitCommand.size() != 2)
{
ShowMessages("incorrect use of the 'bd'\n\n");
CommandBdHelp();
Expand All @@ -59,7 +59,7 @@ CommandBd(vector<string> SplittedCommand, string Command)
//
// Get the breakpoint id
//
if (!ConvertStringToUInt64(SplittedCommand.at(1), &BreakpointId))
if (!ConvertStringToUInt64(SplitCommand.at(1), &BreakpointId))
{
ShowMessages("please specify a correct hex value for breakpoint id\n\n");
CommandBdHelp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ CommandBeHelp()
/**
* @brief handler of be command
*
* @param SplittedCommand
* @param SplitCommand
* @param Command
* @return VOID
*/
VOID
CommandBe(vector<string> SplittedCommand, string Command)
CommandBe(vector<string> SplitCommand, string Command)
{
UINT64 BreakpointId;
DEBUGGEE_BP_LIST_OR_MODIFY_PACKET Request = {0};

//
// Validate the commands
//
if (SplittedCommand.size() != 2)
if (SplitCommand.size() != 2)
{
ShowMessages("incorrect use of the 'be'\n\n");
CommandBeHelp();
Expand All @@ -59,7 +59,7 @@ CommandBe(vector<string> SplittedCommand, string Command)
//
// Get the breakpoint id
//
if (!ConvertStringToUInt64(SplittedCommand.at(1), &BreakpointId))
if (!ConvertStringToUInt64(SplitCommand.at(1), &BreakpointId))
{
ShowMessages("please specify a correct hex value for breakpoint id\n\n");
CommandBeHelp();
Expand Down
Loading

0 comments on commit 103874d

Please sign in to comment.