#pragma once // ke_userenv.h - kernel view of the user-mode process/thread environment. // This is this OS' ABI, not a Windows compatibility structure. #include #include #define SYS_PEB_MAGIC 0x30424550u /* "PEB0" */ #define SYS_TEB_MAGIC 0x30424554u /* "TEB0" */ #define SYS_ENV_VERSION 1u #define SYS_CWD_MAX 520u typedef struct SYS_PEB { uint32_t Magic; uint32_t Version; uint32_t ProcessId; const char* ImagePath; size_t ImagePathLength; const char* CommandLine; size_t CommandLineLength; const char* CurrentDirectory; size_t CurrentDirectoryLength; } SYS_PEB; typedef struct SYS_TEB { SYS_PEB* Peb; void* StackBase; void* StackLimit; struct SYS_TEB* Self; uint32_t ThreadId; uint32_t Magic; } SYS_TEB;