Commit graph

2654 commits

Author SHA1 Message Date
sina
ba0e62daf5 update CHANGELOG and minor CPUID SDK fucntion fix 2026-09-22 18:31:20 +02:00
Sina Karvandi
21cbecfa89
Merge pull request #682 from enzo-berry/fix/cam-config-space-length
Size the PCI CAM config space buffer at its real 256 bytes
2026-09-22 17:37:15 +02:00
Sina Karvandi
4315083bc7
Merge pull request #669 from enzo-berry/claude/code-audit-improvements-prdq23
Improve error handling for malformed command arguments
2026-09-22 16:28:39 +02:00
sina
cc45ad239f restore Linux directory listing and apply address check to kernel functions 2026-09-22 14:50:45 +02:00
sina
f340a9ba58 Restore Linux change 2026-09-22 14:45:09 +02:00
Sina Karvandi
950954acc7
Merge pull request #680 from enzo-berry/fix/hidden-bp-first-original-byte
Preserve the original byte of the first hidden breakpoint on a page
2026-09-22 13:33:40 +02:00
sina
b7a05585c0 cleanup uout and interpreter commands
Some checks are pending
vs2026-ci / win-amd64-build (debug, x64) (push) Waiting to run
vs2026-ci / win-amd64-build (release, x64) (push) Waiting to run
vs2026-ci / Deploy release (push) Blocked by required conditions
2026-09-15 18:17:36 +02:00
sina
9e415a8ce5 change results of the io in and io out commands 2026-09-15 14:05:36 +02:00
sina
434a539868 change help messages of uin and uout commands 2026-09-15 13:59:46 +02:00
Sina Karvandi
019d85f7ee
Merge pull request #684 from FallinBinary/dev
Add dds, dqs and dps commands
2026-09-15 13:36:48 +02:00
FallinBinary
2031e665f8 Register dds, dps, dqs commands in the command table 2026-08-30 02:09:37 -07:00
FallinBinary
dfe1e53569 Update command help menu 2026-08-29 03:36:32 -07:00
FallinBinary
a52aa35986 Add dps command 2026-08-29 03:25:53 -07:00
FallinBinary
7193b95c86 Add dqs command 2026-08-29 03:19:00 -07:00
FallinBinary
7c0d9eaa1a Add dds command 2026-08-29 03:06:55 -07:00
Max Raulea
3faff1e1e2 kernel module compilation guide
Some checks failed
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
2026-08-26 18:02:47 +02:00
Max Raulea
bb977b023a fix linux cli build 2026-08-26 17:38:27 +02:00
enzo-berry
b8369ec593 Size the PCI CAM config space buffer at its real 256 bytes
PCI CAM configuration space is 256 bytes, offsets 0x00 to 0xff, but
CAM_CONFIG_SPACE_LENGTH is defined as 255, next to BUS_MAX_NUM and
DEV_MAX_NUM which legitimately are 255.

The buffer that holds a captured config space is sized from that constant:

    BYTE ConfigSpaceAdditional[CAM_CONFIG_SPACE_LENGTH - sizeof(PORTABLE_PCI_CONFIG_SPACE_HEADER)];

giving 64 + 191 = 255 contiguous bytes. Every loop over it, however, is
written in terms of the real 256-byte size and steps in units that overshoot
the constant. ExtensionCommandPcidevinfo() fills the buffer with

    for (UINT16 i = 0; i < CAM_CONFIG_SPACE_LENGTH; i += 4)

which runs i = 0, 4, ... 252 and writes a DWORD each time, so it writes 256
bytes into those 255 - one byte past the end of the config space, into the
first byte of MmioBarInfo[0].Is64Bit that follows it in PCI_DEV. The write
stays inside the enclosing struct, so this is a correctness bug rather than
memory corruption, but the last byte of config space is stored outside the
buffer that is meant to hold it. The two raw-dump loops (i += 16) likewise
cover 256 bytes and read the last one from beyond the buffer.

Define the constant as the length it is named for. The buffer becomes 64 +
192 = 256 bytes, the fill loop lands exactly on the end, and both dump loops
cover exactly 16 rows of 16 bytes. The existing

    static_assert(sizeof(DEBUGGEE_PCIDEVINFO_REQUEST_RESPONSE_PACKET) < PacketChunkSize)

still holds with the one byte the packet grows by.

PciReadCam()/PciWriteCam() compare a byte offset against the same constant,
so the bound is switched to >= to keep meaning a valid offset now that the
constant is a length rather than the highest offset. Both comparisons are
still statically false because Offset is a BYTE; this only stops the check
from being wrong if that parameter is ever widened.
2026-08-26 12:19:00 +02:00
enzo-berry
80e1f6276b Preserve the original byte of the first hidden breakpoint on a page
EptHookCreateHookPage() records BreakpointAddresses[0] and sets
CountOfBreakpoints to 1, but never fills in the matching
PreviousBytesOnBreakpointAddresses[0]. The entry is allocated with
PlatformMemAllocateZeroedNonPagedPool(), so that slot deterministically
holds 0x00.

Every later breakpoint on the same page does save its original byte in
EptHookUpdateHookPage(), and EptHookUnHookSingleAddressHiddenBreakpoint()
restores all slots the same way. Removing the first breakpoint while a
second one is still on the page therefore writes 0x00 into the fake page
instead of the instruction byte that was there, corrupting the fake-page
instruction stream. The 0x00 can also swallow the remaining 0xcc as a
ModRM byte, so the surviving breakpoint stops triggering.

Read the byte after the page contents are copied and before the 0xcc is
written over it. This also makes the existing comment in the unhooking
path correct, which already assumed the first entry holds a valid
previous byte.

Fixes #637
2026-08-26 11:49:04 +02:00
Max Raulea
02587aae30 windows fix
Some checks failed
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
2026-08-24 11:57:23 +02:00
Max Raulea
7bcb464fce windows fix 2026-08-24 11:31:33 +02:00
Max Raulea
2f59ad7c70 Kernel Module now Links and compiles!!
The kernel module now links and compiles, there are still a lot of empty
TODOs left, there are empty stubs for hypertrace, assembly files and
kdserial etc. these can be introduced one by one. My first step will be
loading the kernel module from the userspace cli.

Big step forward! :)
2026-08-24 11:20:24 +02:00
Max Raulea
bf66d87e02 New fail came up, so new fix
Some checks are pending
vs2026-ci / win-amd64-build (debug, x64) (push) Waiting to run
vs2026-ci / win-amd64-build (release, x64) (push) Waiting to run
vs2026-ci / Deploy release (push) Blocked by required conditions
2026-08-23 15:17:38 +02:00
Max Raulea
d45fabed13 New wiondows build fix 2026-08-23 14:58:56 +02:00
Max Raulea
fb164a070a fix windows build 2026-08-23 14:35:39 +02:00
Max Raulea
9a1db34a4d fix build 2026-08-23 14:29:04 +02:00
Max Raulea
95389e46df A lot of platform function swaps and left hyperevade out of the build
Created a lot of new platform wrappers for windows only functions
also removed hyperevade from the linux module build and added a empty
stub for the transparent functions they provide which can be filled in
later.
2026-08-23 14:18:12 +02:00
Max Raulea
98fe5abd96 Added new types in the WDK linux header and went through hyperevade to sweep windows functions for the platform functions 2026-08-23 13:04:20 +02:00
Max Raulea
1233397d18 hyperhv now compiles! Together with the Zydis submodule for linux 2026-08-23 13:04:20 +02:00
Max Raulea
26a6415b70 new platform API functions 2026-08-23 13:04:20 +02:00
Max Raulea
e439fd38d3 Added new platform API functions and changed them in the source code 2026-08-23 13:04:20 +02:00
Max Raulea
845318ff0c Created empty stubs for the GNU assembler assembly files instead of the MASM files for linux kernel module 2026-08-23 13:04:20 +02:00
Max Raulea
ec7e4207c4 New platform functions added for hyperhv compilation 2026-08-23 13:04:20 +02:00
Sina Karvandi
46098fcba1
Merge pull request #678 from HyperDbg/linux
Some checks failed
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
Linux
2026-08-22 22:58:13 +02:00
sina
3a3b017156 Restore script-engine-test submodule pointer
Some checks are pending
vs2026-ci / win-amd64-build (debug, x64) (push) Waiting to run
vs2026-ci / win-amd64-build (release, x64) (push) Waiting to run
vs2026-ci / Deploy release (push) Blocked by required conditions
2026-08-22 22:41:01 +02:00
Nikzad
123e0dd790 fixed problem for user i/o instruction 2026-08-17 22:08:37 +03:30
Max Raulea
a5b2c13c4b fix build
Some checks failed
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
2026-08-17 15:33:46 +02:00
Max Raulea
82ad5fc9b6 Swepped hyperhv project for platform functions and swapped them 2026-08-17 15:24:25 +02:00
Sina Karvandi
fd8b9d8bc3
Merge pull request #676 from FallinBinary/dev
Some checks failed
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
refactor dl, da and dw commands
2026-08-15 22:36:49 +02:00
Max Raulea
925c90ab26 For the WDK definitions a new file now exists to store them for the linux build 2026-08-14 18:23:38 +02:00
FallinBinary
a78b0208e4 refactor dl, da and dw commands 2026-08-14 08:52:06 -07:00
Sina Karvandi
a79dd9f6cc
Merge pull request #675 from xmaple555/dev
Some checks failed
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
update function parameter to the script engine
2026-08-14 17:16:52 +02:00
Max Raulea
cf4b2c48e3 Windows build fix
Some checks failed
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
2026-08-14 16:56:49 +02:00
Max Raulea
a02a0a25fd Port hyperlog to the Linux kernel module
Logging.c and UnloadDll.c compile and link into HyperDbg.ko, along with
the two components that were waiting on the logging layer (BinarySearch,
OptimizationsExamples).

- new PlatformStr.{h,c}: PlatformVsnprintf/Sprintf/Strnlen replace
  vsprintf_s/sprintf_s/strnlen_s; PlatformSprintf moved here out of
  PlatformMem so both spellings return -1 on truncation
- BasicTypes.h: IRP/IO_STACK_LOCATION/IO_STATUS_BLOCK/UNICODE_STRING
  grow the members shared code touches, plus the NT status and access
  constants the notify path needs
- Environment.h: RTL_NUMBER_OF, _Analysis_assume_, ASSERT -> WARN_ON
- PlatformEvent: ExEventObjectType placeholder token
- HyperLogCallback.c stays out of the module: it defines the same
  LogCallback* entry points as Logging.c (it is the per-DLL forwarding
  shim on Windows), so in one link unit it is a duplicate symbol
2026-08-14 16:25:37 +02:00
Max Raulea
a7d6535442 Add files to the build files
Hopefully fixes build issue
2026-08-14 15:41:00 +02:00
xmaple555
c40f57efa6 update function parameter to the script engine 2026-08-14 21:40:42 +08:00
Max Raulea
4dc132937f Port components/Spinlock.c to Linux kernel module
Some checks are pending
vs2026-ci / win-amd64-build (debug, x64) (push) Waiting to run
vs2026-ci / win-amd64-build (release, x64) (push) Waiting to run
vs2026-ci / Deploy release (push) Blocked by required conditions
Route Spinlock.c's three MSVC intrinsics through the platform
intrinsics layer instead of the Windows builtins:
  _mm_pause                 -> CpuPause (already existed)
  _interlockedbittestandset -> CpuInterlockedBitTestAndSet (new)
  InterlockedCompareExchange-> CpuInterlockedCompareExchange (new, 32-bit)

Add the two new Cpu* wrappers to the kernel PlatformIntrinsics
{.h,.c} with win + linux arms (Linux uses __atomic_* builtins,
mirroring the existing 64-bit CAS), keeping the Cpu* wrappers the
single intrinsic boundary.
2026-08-14 11:35:21 +02:00
Sina Karvandi
368f0302f4
Merge pull request #673 from HyperDbg/linux
Some checks are pending
vs2026-ci / win-amd64-build (release, x64) (push) Waiting to run
vs2026-ci / win-amd64-build (debug, x64) (push) Waiting to run
vs2026-ci / Deploy release (push) Blocked by required conditions
Linux
2026-08-13 15:01:18 +02:00
xmaple555
d8e777cd39 update test script-semantic 2026-08-12 23:01:07 +08:00
Max Raulea
2a23d05ce6 Filled in the time stubs for platformtime functions for linux
Some checks failed
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
vs2026-ci / Deploy release (push) Has been cancelled
2026-08-11 13:13:07 +02:00