|
HyperDbg Debugger
|
User mode Cross platform APIs for platofrm dependend library calls. More...
#include <stdarg.h>#include <stddef.h>Go to the source code of this file.
Functions | |
| INT | PlatformVsnprintf (char *Buffer, SIZE_T BufferSize, const char *Format, va_list ArgList) |
| Platform independent wrapper for vsprintf_s / vsnprintf. | |
| char * | PlatformStrDup (const char *Str) |
| Platform independent wrapper for _strdup / strdup. | |
| VOID | PlatformZeroMemory (PVOID Buffer, SIZE_T Size) |
| Zeros a memory block. | |
| INT | PlatformSprintf (char *Buffer, SIZE_T BufferSize, const char *Format,...) |
| Platform independent wrapper for sprintf_s / snprintf. | |
| BOOLEAN | PlatformQueryPerformanceFrequency (LARGE_INTEGER *Frequency) |
| Platform independent wrapper for QueryPerformanceFrequency. | |
| BOOLEAN | PlatformQueryPerformanceCounter (LARGE_INTEGER *Count) |
| Platform independent wrapper for QueryPerformanceCounter. | |
| HANDLE | PlatformCreateEvent (BOOLEAN ManualReset, BOOLEAN InitialState) |
| Platform independent wrapper for CreateEvent. | |
| BOOLEAN | PlatformSetEvent (HANDLE EventHandle) |
| Platform independent wrapper for SetEvent. | |
| BOOLEAN | PlatformResetEvent (HANDLE EventHandle) |
| Platform independent wrapper for ResetEvent. | |
| DWORD | PlatformWaitForSingleObject (HANDLE Handle, DWORD TimeoutMilliseconds) |
| Platform independent wrapper for WaitForSingleObject. | |
| BOOLEAN | PlatformCloseHandle (HANDLE Handle) |
| Platform independent wrapper for CloseHandle. | |
| DWORD | PlatformGetLastError (VOID) |
| Platform independent wrapper for GetLastError. | |
| BOOLEAN | PlatformWriteConsole (const VOID *Buffer, DWORD NumberOfBytes) |
| Platform independent wrapper to write raw bytes to the console. | |
| HANDLE | PlatformOpenFileForWriting (const WCHAR *Path) |
| Platform independent wrapper to create/open a file for writing. | |
| BOOLEAN | PlatformWriteFile (HANDLE FileHandle, const VOID *Buffer, DWORD NumberOfBytes) |
| Platform independent wrapper to write a buffer to an open file. | |
| BOOLEAN | PlatformCloseFile (HANDLE FileHandle) |
| Platform independent wrapper to close a file opened by PlatformOpenFileForWriting. | |
| VOID * | PlatformMapFileReadOnly (const WCHAR *Path, PSIZE_T OutFileSize, PHANDLE OutFileHandle) |
| Platform independent wrapper to map an entire file read-only into memory. | |
| BOOLEAN | PlatformReadFileAtOffset (HANDLE FileHandle, UINT64 Offset, VOID *Buffer, DWORD NumberOfBytes, LPDWORD BytesRead) |
| Platform independent wrapper for a positioned (seek + read) file read. | |
| VOID | PlatformUnmapFile (VOID *BaseAddress, SIZE_T FileSize, HANDLE FileHandle) |
| Platform independent wrapper to release a mapping from PlatformMapFileReadOnly. | |
| UINT32 | PlatformGetCurrentThreadId (VOID) |
| Platform independent wrapper for GetCurrentThreadId / gettid. | |
| UINT32 | PlatformGetCurrentProcessorNumber (VOID) |
| Platform independent wrapper for GetCurrentProcessorNumber / sched_getcpu. | |
| UINT32 | PlatformGetCurrentProcessId (VOID) |
| Platform independent wrapper for GetCurrentProcessId / getpid. | |
| CHAR * | PlatformGetCurrentProcessName (VOID) |
| Platform independent wrapper to get the current process name. | |
User mode Cross platform APIs for platofrm dependend library calls.
| BOOLEAN PlatformCloseFile | ( | HANDLE | FileHandle | ) |
Platform independent wrapper to close a file opened by PlatformOpenFileForWriting.
| FileHandle | handle to close |
| BOOLEAN PlatformCloseHandle | ( | HANDLE | Handle | ) |
Platform independent wrapper for CloseHandle.
Platform independent wrapper for CreateEvent.
| ManualReset | TRUE for a manual-reset event, FALSE for auto-reset |
| InitialState | TRUE if the event starts signaled |
| UINT32 PlatformGetCurrentProcessId | ( | VOID | ) |
Platform independent wrapper for GetCurrentProcessId / getpid.
| CHAR * PlatformGetCurrentProcessName | ( | VOID | ) |
Platform independent wrapper to get the current process name.
| UINT32 PlatformGetCurrentProcessorNumber | ( | VOID | ) |
Platform independent wrapper for GetCurrentProcessorNumber / sched_getcpu.
| UINT32 PlatformGetCurrentThreadId | ( | VOID | ) |
Platform independent wrapper for GetCurrentThreadId / gettid.
| DWORD PlatformGetLastError | ( | VOID | ) |
| VOID * PlatformMapFileReadOnly | ( | const WCHAR * | Path, |
| PSIZE_T | OutFileSize, | ||
| PHANDLE | OutFileHandle ) |
Platform independent wrapper to map an entire file read-only into memory.
The returned pointer stays valid until released with PlatformUnmapFile; the underlying file/descriptor is closed before returning (the mapping outlives it on both platforms).
| Path | wide path of the file to map |
| OutFileSize | output — size of the file in bytes (0 on failure) |
| HANDLE PlatformOpenFileForWriting | ( | const WCHAR * | Path | ) |
Platform independent wrapper to create/open a file for writing.
| Path | wide path of the file to create (truncated if it exists) |
| BOOLEAN PlatformQueryPerformanceCounter | ( | LARGE_INTEGER * | Count | ) |
Platform independent wrapper for QueryPerformanceCounter.
| Count | output — current tick count |
| BOOLEAN PlatformQueryPerformanceFrequency | ( | LARGE_INTEGER * | Frequency | ) |
Platform independent wrapper for QueryPerformanceFrequency.
| Frequency | output — ticks per second |
| BOOLEAN PlatformReadFileAtOffset | ( | HANDLE | FileHandle, |
| UINT64 | Offset, | ||
| VOID * | Buffer, | ||
| DWORD | NumberOfBytes, | ||
| LPDWORD | BytesRead ) |
Platform independent wrapper for a positioned (seek + read) file read.
| FileHandle | handle handed back by PlatformMapFileReadOnly |
| Offset | byte offset to read from (absolute, from start of file) |
| Buffer | destination buffer |
| NumberOfBytes | number of bytes to read |
| BytesRead | output — number of bytes actually read |
| BOOLEAN PlatformResetEvent | ( | HANDLE | EventHandle | ) |
| BOOLEAN PlatformSetEvent | ( | HANDLE | EventHandle | ) |
| INT PlatformSprintf | ( | char * | Buffer, |
| SIZE_T | BufferSize, | ||
| const char * | Format, | ||
| ... ) |
Platform independent wrapper for sprintf_s / snprintf.
| Buffer | output buffer |
| BufferSize | size of the output buffer |
| Format | format string |
| char * PlatformStrDup | ( | const char * | Str | ) |
Platform independent wrapper for _strdup / strdup.
| Str | string to duplicate |
| VOID PlatformUnmapFile | ( | VOID * | BaseAddress, |
| SIZE_T | FileSize, | ||
| HANDLE | FileHandle ) |
Platform independent wrapper to release a mapping from PlatformMapFileReadOnly.
| BaseAddress | base address returned by PlatformMapFileReadOnly |
| FileSize | size that was reported by PlatformMapFileReadOnly (needed by munmap) |
| FileHandle | file handle handed back by PlatformMapFileReadOnly |
| INT PlatformVsnprintf | ( | char * | Buffer, |
| SIZE_T | BufferSize, | ||
| const char * | Format, | ||
| va_list | ArgList ) |
Platform independent wrapper for vsprintf_s / vsnprintf.
| Buffer | output buffer |
| BufferSize | size of the output buffer |
| Format | format string |
| ArgList | variadic argument list |
Platform independent wrapper for WaitForSingleObject.
Platform independent wrapper to write raw bytes to the console.
Used to emit pre-encoded UTF-8 byte sequences (e.g. box-drawing characters) directly to standard output. On Windows this goes through WriteConsoleA so the console code page is bypassed; on Linux the terminal is UTF-8 native so the bytes are written as-is.
| Buffer | pointer to the bytes to write |
| NumberOfBytes | number of bytes to write |
Platform independent wrapper to write a buffer to an open file.
| FileHandle | handle returned by PlatformOpenFileForWriting |
| Buffer | pointer to the bytes to write |
| NumberOfBytes | number of bytes to write |
| VOID PlatformZeroMemory | ( | PVOID | Destination, |
| SIZE_T | Size ) |
Zeros a memory block.
| Destination | Memory address. |
| Size | Number of bytes. |