mirror of
https://github.com/HyperDbg/HyperDbg
synced 2026-08-15 06:29:09 -04:00
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
46 lines
1.5 KiB
C
46 lines
1.5 KiB
C
/**
|
|
* @file PlatformEvent.h
|
|
* @author Sina Karvandi (sina@hyperdbg.org)
|
|
* @brief Cross platform APIs for kernel event and object management
|
|
* @details
|
|
* @version 0.19
|
|
* @date 2026-05-09
|
|
*
|
|
* @copyright This project is released under the GNU Public License v3.
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#if defined(__linux__)
|
|
# include "../../../../include/SDK/HyperDbgSdk.h"
|
|
#endif // defined(__linux__)
|
|
|
|
#if defined(__linux__)
|
|
|
|
//
|
|
// NT's global event object-type pointer (ntddk). Shared code passes
|
|
// *ExEventObjectType when referencing a user-mode event handle; Linux has no
|
|
// object manager, so this is a placeholder token that the (fail-closed)
|
|
// PlatformObjectReferenceByHandle stub ignores. Defined in PlatformEvent.c.
|
|
//
|
|
extern POBJECT_TYPE * ExEventObjectType;
|
|
|
|
#endif // defined(__linux__)
|
|
|
|
//////////////////////////////////////////////////
|
|
// Functions //
|
|
//////////////////////////////////////////////////
|
|
|
|
VOID
|
|
PlatformObjectDereference(PVOID Object);
|
|
|
|
LONG
|
|
PlatformEventSet(PKEVENT Event, KPRIORITY Increment, BOOLEAN Wait);
|
|
|
|
NTSTATUS
|
|
PlatformObjectReferenceByHandle(HANDLE Handle,
|
|
ACCESS_MASK DesiredAccess,
|
|
POBJECT_TYPE ObjectType,
|
|
KPROCESSOR_MODE AccessMode,
|
|
PVOID * Object,
|
|
POBJECT_HANDLE_INFORMATION HandleInformation);
|