Commit graph

89 commits

Author SHA1 Message Date
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
Max Raulea
4dc132937f Port components/Spinlock.c to Linux kernel module
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
Max Raulea
2a23d05ce6 Filled in the time stubs for platformtime functions for linux 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
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
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
b77df6a62b remove unused serial codes 2026-07-29 15:02:53 +02:00
Max Raulea
4bf987a596 Added missing files to the CMake build file and sweeped them for the Platform functions and guarded windows only code 2026-07-24 21:06:04 +02:00
Max Raulea
5175381c73 script engine linux build complete, added undefined references with empty stubs or linux port and updated the Cmake file accordingly 2026-07-24 20:02:00 +02:00
Max Raulea
8583d99d14 Added ucpuid to CMakeList.txt and made it portable 2026-07-24 19:48:24 +02:00
sina
aa96eaa617 fix snprintf_s function 2026-07-23 15:46:03 +02:00
Max Raulea
6683c2dc3d New socket platform API and named-pipe linux file 2026-07-22 11:32:39 +02:00
Max Raulea
1abac35edc new email and some changes 2026-07-22 11:05:07 +02:00
Max Raulea
6f7bc287fe Guards and Documentation 2026-07-22 10:16:22 +02:00
Max Raulea
926070135d Sweeps and extra guards and some new platform functionsd 2026-07-21 15:53:34 +02:00
Max Raulea
a29e210ab0 Porting status update and terminate thread platform call 2026-07-20 12:32:10 +02:00
Max Raulea
dd38a30d22 New Platform functions and maybe missed CpuID wrapper function? 2026-07-19 11:05:12 +02:00
Max Raulea
0c7adbd244 New platform ioctl func and some sweeps of already existing platform functions 2026-07-18 19:20:56 +02:00
Max Raulea
db3064cb24 Sweeps of PLatform functions 2026-07-18 17:09:52 +02:00
Max Raulea
33de7da8ec test comment 2026-07-18 16:39:45 +02:00
Max Raulea
d6f70eecd9 Added driver install for linux stub, and new platform functions and 1:1 mappings 2026-07-18 16:38:09 +02:00
Max Raulea
3805190db8 ud.cpp, new additions to platform API and guards 2026-07-18 15:01:56 +02:00
Max Raulea
38a59b795f Some new lib calls and reverted sleep macro to function 2026-07-17 17:54:05 +02:00
Max Raulea
2a2425dc68 compiling kd.cpp on linux 2026-07-16 15:00:03 +02:00
Max Raulea
ffc2595941 add definition for gcc compilation 2026-07-14 19:12:28 +02:00
sina
aa18675760 update changelog and fix minor issues 2026-06-21 14:22:33 +02:00
maxraulea
81b16de62b added files for platform API 2026-06-20 09:28:37 +02:00
maxraulea
2d3941a43e signal handler platform independent API 2026-06-20 09:28:37 +02:00
maxraulea
7586303ee8 revert w_char types 2026-06-15 15:57:57 +02:00
maxraulea
5e074a5cbd PE parsing compiles now 2026-06-15 15:52:50 +02:00
maxraulea
0b59876919 compiling dump.cpp and track.cpp 2026-06-15 15:18:56 +02:00
maxraulea
ced1ee94a4 Update platform-lib-calls.c 2026-06-15 14:47:42 +02:00
maxraulea
54b5b5a42f Platform ioctl interface 2026-06-14 14:55:02 +02:00
sina
df12e9fd79 Fix adding missing IOCTL for Intel PT 2026-06-10 23:56:36 +02:00
maxraulea
6c97d86610 Hopefully fix build errors V2 2026-06-10 16:29:35 +02:00
maxraulea
6299161980 Hopefully fix build errors 2026-06-10 16:29:35 +02:00
maxraulea
31b514f8df Interface Linux for the serial port 2026-06-10 16:29:35 +02:00
maxraulea
853ae9d5fe added defs to linux environment 2026-06-10 16:29:35 +02:00
maxraulea
5a02c43cc1 New platform lib calls 2026-06-10 16:29:35 +02:00
maxraulea
9c3e0ed23b added Linux distinction and pragmas together with new platform functions 2026-06-10 16:29:35 +02:00
sina
ffb0f8ac1d fix build error on script engine refactor for Linux 2026-06-02 19:51:27 +02:00