Commit graph

1063 commits

Author SHA1 Message Date
sina
c3346c1853 show version in the help command
Some checks failed
vs2026-ci / Deploy release (push) Has been cancelled
vs2026-ci / win-amd64-build (debug, x64) (push) Has been cancelled
vs2026-ci / win-amd64-build (release, x64) (push) Has been cancelled
2026-10-07 15:44:39 +02:00
Max Raulea
b0e7294e35 implement Linux events and threads with pthreads 2026-10-04 21:46:13 +02:00
Max Raulea
6fb308d576 add Linux serial transport (termios and UNIX socket) 2026-10-04 21:46:13 +02:00
enzo-berry
5c95fed361 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-10-04 21:46:13 +02:00
Max Raulea
11c2ea9b7c Kernel mode stubs one line fills
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-09-20 14:01:04 +02:00
Max Raulea
5b9f8e2c28 filled in stubs for user mode 2026-09-20 12:45:52 +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
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
bb977b023a fix linux cli build 2026-08-26 17:38:27 +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
fb164a070a fix windows build 2026-08-23 14:35:39 +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
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
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
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
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
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
Max Raulea
33571e2c51 Implementationb of the platform spinlocks file for linux kernel module 2026-08-11 13:02:16 +02:00
Max Raulea
786cb1775d Filled in PlatformProcess.c for linux module build 2026-08-11 12:53:18 +02:00
Max Raulea
b0de162deb Added linux part of PlatformIrql
Added the linux part of PlatformIrql by adding preempt_enable() and preempt_disable.
2026-08-11 12:20:50 +02:00
Max Raulea
9ea26e4f8b PlatformIO stub
Empty stubs for PLatform IO and added some types to the linux build
2026-08-11 12:00:27 +02:00
Max Raulea
d64ce241f7 Added stub for the PLatform event file
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
Added a  empty stub for the event functions on linux, since they don't
have a one to one mapping. also removed some redundant guards.
2026-08-11 11:17:35 +02:00
Max Raulea
6bb174b006 linux BHqueue for windows DPC port
In order for PlatformDpc to compile on linux I stubbed out the DPC part
and made a skeleton for the linux implementation using the BHqueue.
2026-08-11 10:53:17 +02:00
xmaple555
d53712638c revert hyperdbg-test 2026-08-11 00:23:02 +08:00
Sina Karvandi
80f224fa58
Merge pull request #671 from nikzad66/uin-uout-commands
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
Uin uout commands
2026-08-10 12:00:21 +02:00
sina
c8a209d84b add different DW DA definition
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-08 16:38:16 +02:00
Nikzad
128c9fac77 header files 2026-08-06 21:11:59 +03:30
Sina Karvandi
12cd4250b5
Merge pull request #664 from HyperDbg/linux
Linux
2026-08-01 20:18:42 +02:00
Max Raulea
17fb85f366 added header for PLatformCPU 2026-08-01 17:08:20 +02:00
Max Raulea
652721be62 Added Printk in rhw platformDBG file
For debug printing added printk for linux kernel logging.
2026-08-01 17:06:58 +02:00
Max Raulea
953af9388a PlatformCPU Linux Implementation
Filled in the stubs for the windows functions:
KeQueryActiveProcessorCount(0) and KeGetCurrentProcessorNumberEx(NULL).
KeQueryActiveProcessorCount(0) maps one to one to num_online_cpus()
KeGetCurrentProcessorNumberEx(NULL) maps to raw_smp_processor_id(),
however this can also be smp_processor_id(), we have to decide based on
preemption, the latter checks for preemption and throws a warning if it
is executed in preemptible code. (I dont know the kernel code well
enough so this may need some discussion)
2026-08-01 16:54:08 +02:00
Max Raulea
be2c96d192 Environment header file guards
For the kernel module build some libc header files are not present so we
guard them out for the kernel build
2026-08-01 16:52:29 +02:00
Sina Karvandi
e5a41009f5
Merge pull request #663 from munraimix/fix/serial-resync
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
Resync the serial receiver on framing overflow instead of flooding after an unclean disconnect
2026-08-01 13:23:48 +02:00
sina
b77df6a62b remove unused serial codes
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-07-29 15:02:53 +02:00