ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel Namespace Reference

Namespaces

namespace  shim

Classes

struct  AddOptions
class  BaseHeap
struct  be_ptr
struct  BinarySection
struct  BinarySymbol
struct  CompletionOptions
struct  DPCSaveArea
class  ELFModule
struct  EventObject
struct  ExportEntry
class  ExportVariableTable
struct  FileObject
class  FunctionDispatcher
class  GuestAddressSpace
class  GuestAllocator
struct  GuestFiber
struct  GuestGlobal
class  GuestMemory
class  GuestModule
struct  GuestVector
struct  HeapAllocation
class  ICallingThread
class  IDPCQueue
class  IFunctionRegistrar
class  IGuestEvent
class  ILoadedModule
class  IModuleRegistry
class  INotificationBroadcaster
class  INotifyListenerQueue
class  IObjectTable
class  IObjectWaiter
struct  IOCompletionObject
struct  IONotification
class  IOpenedFile
class  IOverlappedDispatcher
class  ISystemHeap
class  IThreadRegistry
class  ITitleDebugOutput
class  ITitleExit
class  ITitleWorkspace
class  IXAMObject
struct  KernelGuestGlobals
struct  KernelModuleState
struct  KernelObject
class  KernelSettings
class  KernelThread
struct  MapParseOptions
class  MemoryView
struct  ModuleImport
struct  ModuleObject
struct  MutantObject
struct  NotifyListenerObject
struct  ObjectBlock
class  ObjectPin
struct  ObjectViewOf
struct  ObjectViewOf< IGuestEvent >
struct  ObjectViewOf< ILoadedModule >
struct  ObjectViewOf< INotifyListenerQueue >
struct  ObjectViewOf< IOpenedFile >
union  PageEntry
class  PhysicalHeap
class  PinCount
class  Pinned
class  PublishedPtr
class  RuntimeSettings
struct  SemaphoreObject
struct  SymbolicLinkObject
class  ThreadPin
struct  ThreadRef
class  ThreadState
struct  TimerObject
class  TitlePaths
class  TitleRuntime
struct  UserModuleState
class  VirtualHeap
class  WorkspaceHeap
struct  X_ANSI_STRING
struct  X_DISPATCH_HEADER
struct  X_EX_TITLE_TERMINATE_REGISTRATION
struct  X_EXCEPTION_RECORD
struct  X_FIBER_CONTEXT
struct  X_FILE_ALLOCATION_INFORMATION
struct  X_FILE_BASIC_INFORMATION
struct  X_FILE_COMPLETION_INFORMATION
class  X_FILE_DIRECTORY_INFORMATION
struct  X_FILE_DISPOSITION_INFORMATION
struct  X_FILE_END_OF_FILE_INFORMATION
struct  X_FILE_FS_ATTRIBUTE_INFORMATION
struct  X_FILE_FS_DEVICE_INFORMATION
struct  X_FILE_FS_SIZE_INFORMATION
struct  X_FILE_FS_VOLUME_INFORMATION
struct  X_FILE_INTERNAL_INFORMATION
struct  X_FILE_NETWORK_OPEN_INFORMATION
struct  X_FILE_POSITION_INFORMATION
struct  X_FILE_RENAME_INFORMATION
struct  X_FILE_XCTD_COMPRESSION_INFORMATION
struct  X_IMAGE_EXPORT_DIRECTORY
struct  X_IO_STATUS_BLOCK
struct  X_KDPC
struct  X_KEVENT
struct  X_KMUTANT
struct  X_KPCR
struct  X_KPRCB
struct  X_KPROCESS
struct  X_KSEMAPHORE
struct  X_KSPINLOCK
struct  X_KTHREAD
struct  X_KTIMER
struct  X_KWAIT_BLOCK
struct  X_LDR_DATA_TABLE_ENTRY
struct  X_LIST_ENTRY
struct  X_OBJECT_ATTRIBUTES
struct  X_OBJECT_HEADER
struct  X_OBJECT_TYPE
struct  X_SINGLE_LIST_ENTRY
struct  X_SLIST_HEADER
struct  X_THREAD_NOTIFICATION
struct  X_TYPED_LIST
struct  X_UNICODE_STRING
struct  X_UNKNOWN_TYPE_REFED
struct  X_VIDEO_MODE
struct  XAMObject
struct  XAPC
struct  XCONTENT_AGGREGATE_DATA
struct  XCONTENT_DATA
struct  XEX1SecurityInfo
struct  XEXCompressedBlockInfo
struct  XEXDeltaPatch
struct  XEXExportTable
struct  XEXFileBasicCompressionBlock
struct  XEXFileBasicCompressionInfo
struct  XEXFileNormalCompressionInfo
struct  XEXGameRatings
struct  XEXHeader
struct  XEXImportLibraryHeader
class  XEXModule
struct  XEXOptBoundPath
struct  XEXOptDataDirectory
struct  XEXOptDeltaPatchDescriptor
struct  XEXOptExecutionInfo
struct  XEXOptFileFormatInfo
struct  XEXOptHeader
struct  XEXOptImportLibraries
struct  XEXOptLANKey
struct  XEXOptOriginalPEName
struct  XEXOptResourceInfo
struct  XEXOptStaticLibraries
struct  XEXOptStaticLibrary
struct  XEXOptTLSInfo
struct  XEXOptU32Words
struct  XEXPageDescriptor
struct  XEXResource
struct  XEXSecurityInfoHeader
union  XEXVersion
struct  XFileObject
struct  XKQueue
union  XNotificationKey
struct  XOVERLAPPED

Concepts

concept  XAMObjectClass

Typedefs

using ObjectData
using XNotificationID = u32
using X_HANDLE = u32
using X_STATUS = u32
using X_RESULT = u32
using X_HRESULT = u32

Enumerations

enum class  ExportModule : u8 { kXboxkrnl , kXAM , kXBDM }
enum class  ExportType : u8 { kFunction , kVariable }
enum class  GuestPool : u8 { kHeap , kWorkspace , kTitle , kCount }
enum class  GuestProtect : u8 { kReadOnly , kReadWrite }
enum class  GuestHeap : u8 { kTitle , kSystem , kPhysical }
enum  SystemHeapFlag : u8 { kSystemHeapVirtual = 1 << 0 , kSystemHeapPhysical = 1 << 1 , kSystemHeapDefault = kSystemHeapVirtual }
enum class  HeapType : u8 { kGuestVirtual , kGuestXEX , kGuestPhysical }
enum  MemoryAllocationFlag : u8 { kMemoryAllocationReserve = 1 << 0 , kMemoryAllocationCommit = 1 << 1 , kMemoryAllocationTitle = 1 << 2 }
enum  MemoryProtectFlag : u8 {
  kMemoryProtectRead = 1 << 0 , kMemoryProtectWrite = 1 << 1 , kMemoryProtectNoCache = 1 << 2 , kMemoryProtectWriteCombine = 1 << 3 ,
  kMemoryProtectNoAccess = 0
}
enum class  AccessViolationResult : u8 { kResumed , kMMIOMiss , kUnhandled }
enum class  SeekOrigin : u8 { kBegin = 0 , kCurrent = 1 , kEnd = 2 }
enum class  ModuleType : u8 { kKernel , kUser }
enum class  ModuleFormat : u8 { kUndefined , kXEX , kELF }
enum class  ObjectType : u8 {
  kEvent , kSemaphore , kMutant , kTimer ,
  kFile , kNotifyListener , kIOCompletion , kSymbolicLink ,
  kModule , kThread , kXAM
}
enum class  ObjectBlockHeap : u8 { kSystem , kWorkspace }
enum class  BinarySymbolType : u8 { kFunction , kData , kImport , kUnknown }
enum class  TitleExitReason : u8 { kNormalExit , kHardExit , kTitleDataError , kBugCheck }
enum class  XContentType : u32 {
  kInvalid = 0x00000000 , kSavedGame = 0x00000001 , kMarketplaceContent = 0x00000002 , kPublisher = 0x00000003 ,
  kXbox360Title = 0x00001000 , kIPTVPauseBuffer = 0x00002000 , kXNACommunity = 0x00003000 , kInstalledGame = 0x00004000 ,
  kXboxTitle = 0x00005000 , kSocialTitle = 0x00006000 , kGamesOnDemand = 0x00007000 , kSUStoragePack = 0x00008000 ,
  kAvatarItem = 0x00009000 , kProfile = 0x00010000 , kGamerPicture = 0x00020000 , kTheme = 0x00030000 ,
  kCacheFile = 0x00040000 , kStorageDownload = 0x00050000 , kXboxSavedGame = 0x00060000 , kXboxDownload = 0x00070000 ,
  kGameDemo = 0x00080000 , kVideo = 0x00090000 , kGameTitle = 0x000A0000 , kInstaller = 0x000B0000 ,
  kGameTrailer = 0x000C0000 , kArcadeTitle = 0x000D0000 , kXNA = 0x000E0000 , kLicenseStore = 0x000F0000 ,
  kMovie = 0x00100000 , kTV = 0x00200000 , kMusicVideo = 0x00300000 , kGameVideo = 0x00400000 ,
  kPodcastVideo = 0x00500000 , kViralVideo = 0x00600000 , kCommunityGame = 0x02000000
}
enum class  XLanguage : u8 {
  kInvalid = 0 , kEnglish = 1 , kJapanese = 2 , kGerman = 3 ,
  kFrench = 4 , kSpanish = 5 , kItalian = 6 , kKorean = 7 ,
  kTChinese = 8 , kPortuguese = 9 , kSChineseDeprecated = 10 , kPolish = 11 ,
  kRussian = 12 , kSwedish = 13 , kTurkish = 14 , kNorwegian = 15 ,
  kDutch = 16 , kSChinese = 17 , kMaxLanguages = 18
}
enum  X_FILE_ATTRIBUTES : u16 {
  kXFileAttributeNone = 0x0000 , kXFileAttributeReadOnly = 0x0001 , kXFileAttributeHidden = 0x0002 , kXFileAttributeSystem = 0x0004 ,
  kXFileAttributeDirectory = 0x0010 , kXFileAttributeArchive = 0x0020 , kXFileAttributeDevice = 0x0040 , kXFileAttributeNormal = 0x0080 ,
  kXFileAttributeTemporary = 0x0100 , kXFileAttributeCompressed = 0x0800 , kXFileAttributeEncrypted = 0x4000
}
enum  X_FILE_INFORMATION_CLASS : u8 {
  XFileDirectoryInformation = 1 , XFileFullDirectoryInformation , XFileBothDirectoryInformation , XFileBasicInformation ,
  XFileStandardInformation , XFileInternalInformation , XFileEaInformation , XFileAccessInformation ,
  XFileNameInformation , XFileRenameInformation , XFileLinkInformation , XFileNamesInformation ,
  XFileDispositionInformation , XFilePositionInformation , XFileFullEaInformation , XFileModeInformation ,
  XFileAlignmentInformation , XFileAllInformation , XFileAllocationInformation , XFileEndOfFileInformation ,
  XFileAlternateNameInformation , XFileStreamInformation , XFileMountPartitionInformation , XFileMountPartitionsInformation ,
  XFilePipeRemoteInformation , XFileSectorInformation , XFileXctdCompressionInformation , XFileCompressionInformation ,
  XFileObjectIdInformation , XFileCompletionInformation , XFileMoveClusterInformation , XFileIoPriorityInformation ,
  XFileReparsePointInformation , XFileNetworkOpenInformation , XFileAttributeTagInformation , XFileTrackingInformation ,
  XFileMaximumInformation
}
enum  X_FILE_FS_INFORMATION_CLASS : u8 { XFileFsVolumeInformation = 1 , XFileFsSizeInformation = 3 , XFileFsDeviceInformation , XFileFsAttributeInformation = 5 }
enum  X_FILE_DEVICE_TYPE : u32 { kFileDeviceUnknown = 0x00000022 , kFileDeviceEHSTOR = 0x00000046 }
enum  X_MEM : u32 {
  kXMemCommit = 0x00001000 , kXMemReserve = 0x00002000 , kXMemDecommit = 0x00004000 , kXMemRelease = 0x00008000 ,
  kXMemFree = 0x00010000 , kXMemPrivate = 0x00020000 , kXMemReset = 0x00080000 , kXMemTopDown = 0x00100000 ,
  kXMemNoZero = 0x00800000 , kXMemLargePages = 0x20000000 , kXMemHeap = 0x40000000 , kXMem16MBPages = 0x80000000
}
enum  X_PAGE : u16 {
  kXPageNoAccess = 0x00000001 , kXPageReadOnly = 0x00000002 , kXPageReadWrite = 0x00000004 , kXPageWriteCopy = 0x00000008 ,
  kXPageExecute = 0x00000010 , kXPageExecuteRead = 0x00000020 , kXPageExecuteReadWrite = 0x00000040 , kXPageExecuteWriteCopy ,
  kXPageGuard = 0x00000100 , kXPageNoCache = 0x00000200 , kXPageWriteCombine
}
enum  IRQL_FLAGS : u8 {
  kIRQLPassive = 0 , kIRQLAPC = 1 , kIRQLDispatch = 2 , kIRQLDPC = 3 ,
  kIRQLAudio = 68 , kIRQLClock = 116 , kIRQLHighest = 124
}
enum  X_DISPATCHER_FLAGS : u8 {
  kDispatcherManualResetEvent = 0 , kDispatcherAutoResetEvent = 1 , kDispatcherMutant = 2 , kDispatcherQueue = 4 ,
  kDispatcherSemaphore = 5 , kDispatcherThread = 6 , kDispatcherManualResetTimer = 8 , kDispatcherAutoResetTimer = 9
}
enum  X_KTHREAD_STATE_FLAGS : u8 {
  kKThreadStateInitialized = 0 , kKThreadStateReady = 1 , kKThreadStateRunning = 2 , kKThreadStateStandby = 3 ,
  kKThreadStateTerminated = 4 , kKThreadStateWaiting = 5 , kKThreadStateUnknown = 6
}
enum  XEXSectionType { kXEXSectionCode = 1 , kXEXSectionData = 2 , kXEXSectionReadOnlyData = 3 }
enum  XEXImageFlags : u32 {
  kXEXImageManufacturingUtility = 0x00000002 , kXEXImageManufacturingSupportTools = 0x00000004 , kXEXImageXGD2MediaOnly = 0x00000008 , kXEXImageCardeaKey = 0x00000100 ,
  kXEXImageXeikaKey = 0x00000200 , kXEXImageUserModeTitle = 0x00000400 , kXEXImageUserModeSystem = 0x00000800 , kXEXImageOrange0 = 0x00001000 ,
  kXEXImageOrange1 = 0x00002000 , kXEXImageOrange2 = 0x00004000 , kXEXImageIPTVSignupApplication = 0x00010000 , kXEXImageIPTVTitleApplication = 0x00020000 ,
  kXEXImageKeyVaultPrivilegesRequired = 0x04000000 , kXEXImageOnlineActivationRequired = 0x08000000 , kXEXImagePageSize4KB = 0x10000000 , kXEXImageRegionFree = 0x20000000 ,
  kXEXImageRevocationCheckOptional = 0x40000000 , kXEXImageRevocationCheckRequired = 0x80000000
}
enum  XEXMediaFlags : u32 {
  kXEXMediaHardDisk = 0x00000001 , kXEXMediaDVDX2 = 0x00000002 , kXEXMediaDVDCD = 0x00000004 , kXEXMediaDVD5 = 0x00000008 ,
  kXEXMediaDVD9 = 0x00000010 , kXEXMediaSystemFlash = 0x00000020 , kXEXMediaMemoryUnit = 0x00000080 , kXEXMediaUSBMassStorageDevice = 0x00000100 ,
  kXEXMediaNetwork = 0x00000200 , kXEXMediaDirectFromMemory = 0x00000400 , kXEXMediaRAMDrive = 0x00000800 , kXEXMediaSVOD = 0x00001000 ,
  kXEXMediaInsecurePackage = 0x01000000 , kXEXMediaSaveGamePackage = 0x02000000 , kXEXMediaLocallySignedPackage = 0x04000000 , kXEXMediaLiveSignedPackage = 0x08000000 ,
  kXEXMediaXboxPackage = 0x10000000
}
enum  XEXRegionFlags : u32 {
  kXEXRegionNTSCU = 0x000000FF , kXEXRegionNTSCJ = 0x0000FF00 , kXEXRegionNTSCJJapan = 0x00000100 , kXEXRegionNTSCJChina = 0x00000200 ,
  kXEXRegionPAL = 0x00FF0000 , kXEXRegionPALAUNZ = 0x00010000 , kXEXRegionOther = 0xFF000000 , kXEXRegionAll = 0xFFFFFFFF
}
enum  XEXModuleFlags : u32 {
  kXEXModuleTitle = 0x00000001 , kXEXModuleExportsToTitle = 0x00000002 , kXEXModuleSystemDebugger = 0x00000004 , kXEXModuleDLLModule = 0x00000008 ,
  kXEXModuleModulePatch = 0x00000010 , kXEXModulePatchFull = 0x00000020 , kXEXModulePatchDelta = 0x00000040 , kXEXModuleUserMode = 0x00000080
}
enum  XEXSystemFlags : u32 {
  kXEXSystemNoForcedReboot = 0x00000001 , kXEXSystemForegroundTasks = 0x00000002 , kXEXSystemNoODDMapping = 0x00000004 , kXEXSystemHandleMCEInput = 0x00000008 ,
  kXEXSystemRestrictedHUDFeatures = 0x00000010 , kXEXSystemHandleGamepadDisconnect = 0x00000020 , kXEXSystemInsecureSockets = 0x00000040 , kXEXSystemXbox1Interoperability = 0x00000080 ,
  kXEXSystemDashContext = 0x00000100 , kXEXSystemUsesGameVoiceChannel = 0x00000200 , kXEXSystemPAL50Incompatible = 0x00000400 , kXEXSystemInsecureUtilityDrive = 0x00000800 ,
  kXEXSystemXAMHooks = 0x00001000 , kXEXSystemAccessPII = 0x00002000 , kXEXSystemCrossPlatformSystemLink = 0x00004000 , kXEXSystemMultiDiscSwap = 0x00008000 ,
  kXEXSystemMultiDiscInsecureMedia = 0x00010000 , kXEXSystemAP25Media = 0x00020000 , kXEXSystemNoConfirmExit = 0x00040000 , kXEXSystemAllowBackgroundDownload = 0x00080000 ,
  kXEXSystemCreatePersistableRAMDrive = 0x00100000 , kXEXSystemInheritPersistentRAMDrive = 0x00200000 , kXEXSystemAllowHUDVibration = 0x00400000 , kXEXSystemAccessUtilityPartitions = 0x00800000 ,
  kXEXSystemIPTVInputSupported = 0x01000000 , kXEXSystemPreferBigButtonInput = 0x02000000 , kXEXSystemAllowExtendedSystemReservation = 0x04000000 , kXEXSystemMultiDiscCrossTitle = 0x08000000 ,
  kXEXSystemInstallIncompatible = 0x10000000 , kXEXSystemAllowAvatarGetMetadataByXUID = 0x20000000 , kXEXSystemAllowControllerSwapping = 0x40000000 , kXEXSystemDashExtensibilityModule = 0x80000000
}
enum  XEXRatingESRBValue : u32 {
  kXEXRatingESRBEC = 0x00 , kXEXRatingESRBE = 0x02 , kXEXRatingESRBE10 = 0x04 , kXEXRatingESRBT = 0x06 ,
  kXEXRatingESRBM = 0x08 , kXEXRatingESRBAO = 0x0E , kXEXRatingESRBUnrated = 0xFF
}
enum  XEXRatingPEGIValue : u32 {
  kXEXRatingPEGI3Plus = 0 , kXEXRatingPEGI7Plus = 4 , kXEXRatingPEGI12Plus = 9 , kXEXRatingPEGI16Plus = 13 ,
  kXEXRatingPEGI18Plus = 14 , kXEXRatingPEGIUnrated = 0xFF
}
enum  XEXRatingPEGIFIValue : u32 {
  kXEXRatingPEGIFI3Plus = 0 , kXEXRatingPEGIFI7Plus = 4 , kXEXRatingPEGIFI11Plus = 8 , kXEXRatingPEGIFI15Plus = 12 ,
  kXEXRatingPEGIFI18Plus = 14 , kXEXRatingPEGIFIUnrated = 0xFF
}
enum  XEXRatingPEGIPTValue : u32 {
  kXEXRatingPEGIPT4Plus = 1 , kXEXRatingPEGIPT6Plus = 3 , kXEXRatingPEGIPT12Plus = 9 , kXEXRatingPEGIPT16Plus = 13 ,
  kXEXRatingPEGIPT18Plus = 14 , kXEXRatingPEGIPTUnrated = 0xFF
}
enum  XEXRatingBBFCValue : u32 {
  kXEXRatingBBFCUniversal = 1 , kXEXRatingBBFCPG = 5 , kXEXRatingBBFC3Plus = 0 , kXEXRatingBBFC7Plus = 4 ,
  kXEXRatingBBFC12Plus = 9 , kXEXRatingBBFC15Plus = 12 , kXEXRatingBBFC16Plus = 13 , kXEXRatingBBFC18Plus = 14 ,
  kXEXRatingBBFCUnrated = 0xFF
}
enum  XEXRatingCEROValue : u32 {
  kXEXRatingCEROA = 0 , kXEXRatingCEROB = 2 , kXEXRatingCEROC = 4 , kXEXRatingCEROD = 6 ,
  kXEXRatingCEROZ = 8 , kXEXRatingCEROUnrated = 0xFF
}
enum  XEXRatingUSKValue : u32 {
  kXEXRatingUSKAll = 0 , kXEXRatingUSK6Plus = 2 , kXEXRatingUSK12Plus = 4 , kXEXRatingUSK16Plus = 6 ,
  kXEXRatingUSK18Plus = 8 , kXEXRatingUSKUnrated = 0xFF
}
enum  XEXRatingOFLCAUValue : u32 {
  kXEXRatingOFLCAUG = 0 , kXEXRatingOFLCAUPG = 2 , kXEXRatingOFLCAUM = 4 , kXEXRatingOFLCAUMA15Plus = 6 ,
  kXEXRatingOFLCAUUnrated = 0xFF
}
enum  XEXRatingOFLCNZValue : u32 {
  kXEXRatingOFLCNZG = 0 , kXEXRatingOFLCNZPG = 2 , kXEXRatingOFLCNZM = 4 , kXEXRatingOFLCNZMA15Plus = 6 ,
  kXEXRatingOFLCNZUnrated = 0xFF
}
enum  XEXRatingKMRBValue : u32 {
  kXEXRatingKMRBAll = 0 , kXEXRatingKMRB12Plus = 2 , kXEXRatingKMRB15Plus = 4 , kXEXRatingKMRB18Plus = 6 ,
  kXEXRatingKMRBUnrated = 0xFF
}
enum  XEXRatingBrazilValue : u32 {
  kXEXRatingBrazilAll = 0 , kXEXRatingBrazil12Plus = 2 , kXEXRatingBrazil14Plus = 4 , kXEXRatingBrazil16Plus = 5 ,
  kXEXRatingBrazil18Plus = 8 , kXEXRatingBrazilUnrated = 0xFF
}
enum  XEXRatingFPBValue : u32 {
  kXEXRatingFPBAll = 0 , kXEXRatingFPBPG = 6 , kXEXRatingFPB10Plus = 7 , kXEXRatingFPB13Plus = 10 ,
  kXEXRatingFPB16Plus = 13 , kXEXRatingFPB18Plus = 14 , kXEXRatingFPBUnrated = 0xFF
}
enum  XEXHeaderKey : u32 {
  kXEXHeaderResourceInfo = 0x000002FF , kXEXHeaderFileFormatInfo = 0x000003FF , kXEXHeaderDeltaPatchDescriptor = 0x000005FF , kXEXHeaderBaseReference = 0x00000405 ,
  kXEXHeaderBoundPath = 0x000080FF , kXEXHeaderDeviceId = 0x00008105 , kXEXHeaderOriginalBaseAddress = 0x00010001 , kXEXHeaderEntryPoint = 0x00010100 ,
  kXEXHeaderImageBaseAddress = 0x00010201 , kXEXHeaderImportLibraries = 0x000103FF , kXEXHeaderChecksumTimestamp = 0x00018002 , kXEXHeaderEnabledForCallCap = 0x00018102 ,
  kXEXHeaderEnabledForFastCap = 0x00018200 , kXEXHeaderOriginalPEName = 0x000183FF , kXEXHeaderStaticLibraries = 0x000200FF , kXEXHeaderTLSInfo = 0x00020104 ,
  kXEXHeaderDefaultStackSize = 0x00020200 , kXEXHeaderDefaultFilesystemCacheSize = 0x00020301 , kXEXHeaderDefaultHeapSize = 0x00020401 , kXEXHeaderPageHeapSizeAndFlags = 0x00028002 ,
  kXEXHeaderSystemFlags = 0x00030000 , kXEXHeaderExecutionInfo = 0x00040006 , kXEXHeaderTitleWorkspaceSize = 0x00040201 , kXEXHeaderGameRatings = 0x00040310 ,
  kXEXHeaderLANKey = 0x00040404 , kXEXHeaderXbox360Logo = 0x000405FF , kXEXHeaderMultiDiscMediaIDs = 0x000406FF , kXEXHeaderAlternateTitleIDs = 0x000407FF ,
  kXEXHeaderAdditionalTitleMemory = 0x00040801 , kXEXHeaderExportsByName = 0x00E10402
}
enum  XEXEncryptionType : u16 { kXEXEncryptionNone = 0 , kXEXEncryptionNormal = 1 }
enum  XEXCompressionType : u16 { kXEXCompressionNone = 0 , kXEXCompressionBasic = 1 , kXEXCompressionNormal = 2 , kXEXCompressionDelta = 3 }
enum  XEXApprovalType : u8 { kXEXApprovalUnapproved = 0 , kXEXApprovalPossible = 1 , kXEXApprovalApproved = 2 , kXEXApprovalExpired = 3 }

Functions

std::span< const ExportEntry > GetExports (ExportModule module)
const ExportEntry * FindByOrdinal (ExportModule module, u16 ordinal)
bool IsNoReturnExport (ExportModule module, u16 ordinal)
std::optional< ExportModule > ModuleFromName (std::string_view name)
PPCFunc * ResolveModuleImport (ModuleImport &target)
template<typename T, typename... Args>
std::unique_ptr< KernelObject > MakeObject (Args &&... args)
X_HANDLE CreateModule (TitleRuntime &runtime, ModuleType type)
std::chrono::milliseconds TimeoutFromTicks (i64 timeout_ticks)
std::chrono::microseconds DelayFromTicks (i64 delay_ticks)
std::string NameFromAttributes (kernel::GuestAddressSpace *memory, u32 obj_attributes_ptr)
X_STATUS Wait (TitleRuntime &runtime, const ObjectPin &object, u32 wait_reason, u32 processor_mode, u32 alertable, u64 *opt_timeout)
X_STATUS WaitMultiple (TitleRuntime &runtime, std::span< const ObjectPin > objects, u32 wait_type, u32 wait_reason, u32 processor_mode, u32 alertable, u64 *opt_timeout)
X_STATUS SignalAndWait (TitleRuntime &runtime, const ObjectPin &signal_object, const ObjectPin &wait_object, u32 wait_reason, u32 processor_mode, u32 alertable, u64 *opt_timeout)
ObjectBlock AllocObjectBlock (kernel::GuestAddressSpace *memory, u32 size, u32 type_address, WorkspaceHeap *workspace=nullptr)
void FreeObjectBlock (kernel::GuestAddressSpace *memory, u32 address, WorkspaceHeap *workspace=nullptr)
void CloseOwned (IObjectTable &table, X_HANDLE handle) noexcept
Result< std::vector< BinarySymbol > > ParseNmMap (const std::filesystem::path &map_path, const MapParseOptions &options={})
Result< std::vector< BinarySymbol > > ParseNmMapString (std::string_view map_data, const MapParseOptions &options={})
TitleRuntime & GetCurrent ()
TitleRuntime * GetProcessRuntime ()
constexpr XLanguage ToXLanguage (u32 value) noexcept
void XOverlappedSetResult (void *ptr, u32 value)
u32 XOverlappedGetResult (void *ptr)
void XOverlappedSetLength (void *ptr, u32 value)
u32 XOverlappedGetContext (void *ptr)
void XOverlappedSetContext (void *ptr, u32 value)
X_HANDLE XOverlappedGetEvent (void *ptr)
u32 XOverlappedGetCompletionRoutine (void *ptr)
void XOverlappedSetExtendedError (void *ptr, u32 value)
std::string_view TranslateAnsiString (const kernel::GuestAddressSpace *memory, const X_ANSI_STRING *ansi_string)
std::string TranslateAnsiPath (const kernel::GuestAddressSpace *memory, const X_ANSI_STRING *ansi_string)
std::string_view TranslateAnsiStringAddress (const kernel::GuestAddressSpace *memory, u32 guest_address)
std::u16string TranslateUnicodeString (const kernel::GuestAddressSpace *memory, const X_UNICODE_STRING *unicode_string)
template<typename VirtualTranslator>
X_LIST_ENTRY * HostListEntry (u32 ptr, VirtualTranslator context)
template<typename VirtualTranslator>
u32 GuestListAddress (X_LIST_ENTRY *ptr, VirtualTranslator context)
template<typename VirtualTranslator>
void InitializeListHead (X_LIST_ENTRY *entry, VirtualTranslator context)
template<typename VirtualTranslator>
bool IsListEmpty (X_LIST_ENTRY *entry, VirtualTranslator context)
template<typename VirtualTranslator>
void RemoveEntryList (X_LIST_ENTRY *entry, VirtualTranslator context)
template<typename VirtualTranslator>
void RemoveEntryList (u32 entry, VirtualTranslator context)
template<typename VirtualTranslator>
u32 RemoveHeadList (X_LIST_ENTRY *entry, VirtualTranslator context)
template<typename VirtualTranslator>
void InsertTailList (X_LIST_ENTRY *list_head, u32 list_head_guest, X_LIST_ENTRY *host_entry, u32 entry, VirtualTranslator context)
template<typename VirtualTranslator>
void InsertTailList (u32 list_head, u32 entry, VirtualTranslator context)
template<typename VirtualTranslator>
void InsertTailList (X_LIST_ENTRY *list_head, X_LIST_ENTRY *entry, VirtualTranslator context)
template<typename VirtualTranslator>
void InsertHeadList (X_LIST_ENTRY *list_head, u32 list_head_guest, X_LIST_ENTRY *host_entry, u32 entry, VirtualTranslator context)
template<typename VirtualTranslator>
void InsertHeadList (u32 list_head, X_LIST_ENTRY *entry, VirtualTranslator context)
template<typename VirtualTranslator>
void InsertHeadList (X_LIST_ENTRY *list_head, X_LIST_ENTRY *entry, VirtualTranslator context)
constexpr bool XSUCCEEDED (X_STATUS s)
constexpr bool XFAILED (X_STATUS s)
constexpr X_RESULT XResultFromWin32 (u32 x)
constexpr X_HRESULT XHRESULTFromWin32 (u32 x)
rex::Error StatusError (X_STATUS status)
rex::Error XResultError (X_RESULT result)
X_STATUS ToXStatus (const rex::Error &error, X_STATUS unsupported=X_STATUS_NOT_IMPLEMENTED)
X_RESULT ToXResult (const rex::Error &error, X_RESULT unsupported=X_ERROR_FUNCTION_FAILED)
template<typename T>
X_STATUS ToXStatus (const Result< T > &result)
template<typename T>
X_RESULT ToXResult (const Result< T > &result)
void FillXVideoMode (const VideoMode &mode, X_VIDEO_MODE &out)

Variables

constexpr u32 kPageSize4KiB = 4 * 1024
constexpr u32 kPageSize64KiB = 64 * 1024
constexpr u32 kPageSize16MiB = 16 * 1024 * 1024
constexpr memory::FourCCT kXEX1Signature = memory::make_fourcc("XEX1")
constexpr memory::FourCCT kXEX2Signature = memory::make_fourcc("XEX2")
constexpr memory::FourCCT kELFSignature = memory::make_fourcc(0x7F, 'E', 'L', 'F')
constexpr u32 kNotifyListenerObjectSize = 0x30
constexpr memory::FourCCT kStashSignature = memory::make_fourcc('R', 'E', 'X', '\0')
constexpr u32 kHandleBase = 0xF8000000
constexpr memory::Tag kRuntime {2}
constexpr u32 kRunningTitleID = 0xFFFFFFFF
constexpr u32 kObjOpenIf = 0x80
constexpr u32 kFileObjectSize = 0x68
constexpr u16 kFileObjectTypeId = 5
constexpr u32 kIOCompletionObjectSize = 0x28
constexpr u32 kSymbolicLinkObjectSize = 0xC
constexpr X_HANDLE kXInvalidHandleValue = static_cast<X_HANDLE>(-1)
constexpr X_STATUS X_STATUS_SUCCESS = 0x00000000
constexpr X_STATUS X_STATUS_ABANDONED_WAIT_0 = 0x00000080
constexpr X_STATUS X_STATUS_USER_APC = 0x000000C0
constexpr X_STATUS X_STATUS_ALERTED = 0x00000101
constexpr X_STATUS X_STATUS_TIMEOUT = 0x00000102
constexpr X_STATUS X_STATUS_PENDING = 0x00000103
constexpr X_STATUS X_STATUS_OBJECT_NAME_EXISTS = 0x40000000
constexpr X_STATUS X_STATUS_TIMER_RESUME_IGNORED = 0x40000025
constexpr X_STATUS X_STATUS_BUFFER_OVERFLOW = 0x80000005
constexpr X_STATUS X_STATUS_NO_MORE_FILES = 0x80000006
constexpr X_STATUS X_STATUS_UNSUCCESSFUL = 0xC0000001
constexpr X_STATUS X_STATUS_NOT_IMPLEMENTED = 0xC0000002
constexpr X_STATUS X_STATUS_INVALID_INFO_CLASS = 0xC0000003
constexpr X_STATUS X_STATUS_INFO_LENGTH_MISMATCH = 0xC0000004
constexpr X_STATUS X_STATUS_ACCESS_VIOLATION = 0xC0000005
constexpr X_STATUS X_STATUS_INVALID_HANDLE = 0xC0000008
constexpr X_STATUS X_STATUS_INVALID_PARAMETER = 0xC000000D
constexpr X_STATUS X_STATUS_NO_SUCH_FILE = 0xC000000F
constexpr X_STATUS X_STATUS_END_OF_FILE = 0xC0000011
constexpr X_STATUS X_STATUS_NO_MEMORY = 0xC0000017
constexpr X_STATUS X_STATUS_ALREADY_COMMITTED = 0xC0000021
constexpr X_STATUS X_STATUS_ACCESS_DENIED = 0xC0000022
constexpr X_STATUS X_STATUS_BUFFER_TOO_SMALL = 0xC0000023
constexpr X_STATUS X_STATUS_OBJECT_TYPE_MISMATCH = 0xC0000024
constexpr X_STATUS X_STATUS_OBJECT_NAME_INVALID = 0xC0000033
constexpr X_STATUS X_STATUS_OBJECT_NAME_NOT_FOUND = 0xC0000034
constexpr X_STATUS X_STATUS_OBJECT_NAME_COLLISION = 0xC0000035
constexpr X_STATUS X_STATUS_OBJECT_PATH_NOT_FOUND = 0xC000003A
constexpr X_STATUS X_STATUS_SHARING_VIOLATION = 0xC0000043
constexpr X_STATUS X_STATUS_INVALID_PAGE_PROTECTION = 0xC0000045
constexpr X_STATUS X_STATUS_MUTANT_NOT_OWNED = 0xC0000046
constexpr X_STATUS X_STATUS_THREAD_IS_TERMINATING = 0xC000004B
constexpr X_STATUS X_STATUS_PROCESS_IS_TERMINATING = 0xC000010A
constexpr X_STATUS X_STATUS_PROCEDURE_NOT_FOUND = 0xC000007A
constexpr X_STATUS X_STATUS_INSUFFICIENT_RESOURCES = 0xC000009A
constexpr X_STATUS X_STATUS_NOT_SAME_DEVICE = 0xC00000D4
constexpr X_STATUS X_STATUS_MEMORY_NOT_ALLOCATED = 0xC00000A0
constexpr X_STATUS X_STATUS_FILE_IS_A_DIRECTORY = 0xC00000BA
constexpr X_STATUS X_STATUS_NOT_SUPPORTED = 0xC00000BB
constexpr X_STATUS X_STATUS_NOT_A_DIRECTORY = 0xC0000103
constexpr X_STATUS X_STATUS_INVALID_PARAMETER_1 = 0xC00000EF
constexpr X_STATUS X_STATUS_INVALID_PARAMETER_2 = 0xC00000F0
constexpr X_STATUS X_STATUS_INVALID_PARAMETER_3 = 0xC00000F1
constexpr X_STATUS X_STATUS_DLL_NOT_FOUND = 0xC0000135
constexpr X_STATUS X_STATUS_ENTRYPOINT_NOT_FOUND = 0xC0000139
constexpr X_STATUS X_STATUS_SEMAPHORE_LIMIT_EXCEEDED = 0xC000012B
constexpr X_STATUS X_STATUS_MAPPED_ALIGNMENT = 0xC0000220
constexpr X_STATUS X_STATUS_NOT_FOUND = 0xC0000225
constexpr X_STATUS X_STATUS_DRIVER_ORDINAL_NOT_FOUND = 0xC0000262
constexpr X_STATUS X_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND = 0xC0000263
constexpr i32 kFacilityWin32 = 0x0007
constexpr X_RESULT X_ERROR_SUCCESS = XResultFromWin32(0x00000000)
constexpr X_RESULT X_ERROR_FILE_NOT_FOUND = XResultFromWin32(0x00000002)
constexpr X_RESULT X_ERROR_PATH_NOT_FOUND = XResultFromWin32(0x00000003)
constexpr X_RESULT X_ERROR_ACCESS_DENIED = XResultFromWin32(0x00000005)
constexpr X_RESULT X_ERROR_INVALID_HANDLE = XResultFromWin32(0x00000006)
constexpr X_RESULT X_ERROR_NOT_ENOUGH_MEMORY = XResultFromWin32(0x00000008)
constexpr X_RESULT X_ERROR_NO_MORE_FILES = XResultFromWin32(0x00000012)
constexpr X_RESULT X_ERROR_INVALID_PARAMETER = XResultFromWin32(0x00000057)
constexpr X_RESULT X_ERROR_INSUFFICIENT_BUFFER = XResultFromWin32(0x0000007A)
constexpr X_RESULT X_ERROR_INVALID_NAME = XResultFromWin32(0x0000007B)
constexpr X_RESULT X_ERROR_BAD_ARGUMENTS = XResultFromWin32(0x000000A0)
constexpr X_RESULT X_ERROR_BUSY = XResultFromWin32(0x000000AA)
constexpr X_RESULT X_ERROR_ALREADY_EXISTS = XResultFromWin32(0x000000B7)
constexpr X_RESULT X_ERROR_IO_INCOMPLETE = XResultFromWin32(0x000003E4)
constexpr X_RESULT X_ERROR_IO_PENDING = XResultFromWin32(0x000003E5)
constexpr X_RESULT X_ERROR_DEVICE_NOT_CONNECTED = XResultFromWin32(0x0000048F)
constexpr X_RESULT X_ERROR_NOT_FOUND = XResultFromWin32(0x00000490)
constexpr X_RESULT X_ERROR_CANCELLED = XResultFromWin32(0x000004C7)
constexpr X_RESULT X_ERROR_NOT_LOGGED_ON = XResultFromWin32(0x000004DD)
constexpr X_RESULT X_ERROR_NO_SUCH_USER = XResultFromWin32(0x00000525)
constexpr X_RESULT X_ERROR_FUNCTION_FAILED = XResultFromWin32(0x0000065B)
constexpr X_RESULT X_ERROR_EMPTY = XResultFromWin32(0x000010D2)
constexpr X_HRESULT X_E_FALSE = 0x80000000
constexpr X_HRESULT X_E_SUCCESS = XHRESULTFromWin32(X_ERROR_SUCCESS)
constexpr X_HRESULT X_E_FAIL = 0x80004005
constexpr X_HRESULT kXEUnexpected = 0x8000FFFF
constexpr X_HRESULT kXEOutOfMemory = 0x8007000E
constexpr X_HRESULT X_E_NO_MORE_FILES = XHRESULTFromWin32(X_ERROR_NO_MORE_FILES)
constexpr X_HRESULT X_E_INVALIDARG = XHRESULTFromWin32(X_ERROR_INVALID_PARAMETER)
constexpr X_HRESULT X_E_DEVICE_NOT_CONNECTED
constexpr X_HRESULT X_E_NOTFOUND = XHRESULTFromWin32(X_ERROR_NOT_FOUND)
constexpr X_HRESULT X_E_NO_SUCH_USER = XHRESULTFromWin32(X_ERROR_NO_SUCH_USER)
constexpr u32 kXCreateSuspended = 0x00000001
constexpr u32 kXTLSOutOfIndexes = UINT32_MAX
constexpr u32 kXProcTypeIdle = 0
constexpr u32 kXProcTypeUser = 1
constexpr u32 kXProcTypeSystem = 2

Detailed Description

Kernel exports, shims and the kernel initializer.

Typedef Documentation

◆ ObjectData

Initial value:
Definition event_object.h:59
Definition file_object.h:161
Definition io_completion_object.h:49
Definition module_object.h:189
Definition mutant_object.h:54
Definition notify_listener_object.h:68
Definition semaphore_object.h:38
Definition symbolic_link_object.h:27
Definition kernel_thread.h:48
Definition timer_object.h:45
Definition xam_object.h:28

The data of a KernelObject, one alternative per ObjectType in enumerator order.

◆ X_RESULT

using rex::kernel::X_RESULT = u32

Win32 error code type, holding ERROR_* values.

◆ X_STATUS

using rex::kernel::X_STATUS = u32

NT status code type, holding STATUS_* values.

◆ XNotificationID

ID of a notification, split into fields by XNotificationKey.

Enumeration Type Documentation

◆ AccessViolationResult

enum class rex::kernel::AccessViolationResult : u8
strong
Enumerator
kResumed 

The write watch resolved the fault, so the access runs again.

kMMIOMiss 

The access reached a register block that generated code did not route.

kUnhandled 

GuestAddressSpace makes no claim on the fault.

◆ ExportType

enum class rex::kernel::ExportType : u8
strong
Enumerator
kFunction 

A translated function, ExportEntry::fn is set.

kVariable 

A data export, ExportEntry::fn is null.

◆ GuestHeap

enum class rex::kernel::GuestHeap : u8
strong
Enumerator
kTitle 

Virtual memory in 64 KiB pages, which does not count against the title budget.

kSystem 

System memory, kept apart from title memory and zeroed.

kPhysical 

Physical memory in 64 KiB pages, which counts against the title budget.

◆ GuestPool

enum class rex::kernel::GuestPool : u8
strong

Profiler pool that the blocks of a guest allocator are reported to.

Enumerator
kHeap 

The shim Rtl heap.

kCount 

Number of pools, not a pool.

◆ HeapType

enum class rex::kernel::HeapType : u8
strong
Enumerator
kGuestXEX 

Memory that executable images are mapped into.

◆ IRQL_FLAGS

Interrupt request levels stored in X_KPCR::current_irql.

Enumerator
kIRQLDispatch 

Level held while a spinlock is acquired and while queued DPCs run.

kIRQLDPC 

Level held while an interrupt routine runs.

kIRQLAudio 

No code uses it.

kIRQLClock 

No code uses it.

◆ MemoryAllocationFlag

Enumerator
kMemoryAllocationTitle 

Counts the newly committed pages against the title memory budget.

◆ ModuleType

enum class rex::kernel::ModuleType : u8
strong

Module type, HLE kernel code or a loaded title image.

◆ SystemHeapFlag

Selects the heap that SystemHeapAlloc takes memory from.

◆ TitleExitReason

enum class rex::kernel::TitleExitReason : u8
strong

Why a title exited on its own.

Enumerator
kNormalExit 

The title's main thread returned.

kHardExit 

The title called HalReturnToFirmware.

kTitleDataError 

XAM reported that title data could not be read from the disc.

kBugCheck 

The title called KeBugCheck or KeBugCheckEx.

◆ X_DISPATCHER_FLAGS

Object types stored in the type byte of X_DISPATCH_HEADER.

◆ X_FILE_ATTRIBUTES

File attribute flags. Hidden, system, temporary, compressed and encrypted are NT bits the XDK does not list.

Enumerator
kXFileAttributeDevice 

Reserved, titles do not use it.

kXFileAttributeNormal 

The file has no other attribute, valid only on its own.

◆ X_FILE_DEVICE_TYPE

Device type reported for a volume.

Enumerator
kFileDeviceUnknown 

Device type the volume device query reports.

◆ X_FILE_FS_INFORMATION_CLASS

Volume information class selecting the layout of a query request.

Enumerator
XFileFsVolumeInformation 

Volume label and serial number.

XFileFsSizeInformation 

Volume size and allocation unit geometry.

XFileFsAttributeInformation 

File system name and capabilities.

◆ X_FILE_INFORMATION_CLASS

File information class selecting the layout of a query or set request.

Enumerator
XFileMaximumInformation 

1 past the last class.

◆ X_KTHREAD_STATE_FLAGS

Values of X_KTHREAD::thread_state.

Enumerator
kKThreadStateInitialized 

Written as literal 0 at thread creation.

kKThreadStateReady 

Never written or compared.

kKThreadStateStandby 

Never written or compared.

kKThreadStateTerminated 

Written when the thread exits.

kKThreadStateWaiting 

Never written or compared.

kKThreadStateUnknown 

Never written or compared.

◆ X_MEM

enum rex::kernel::X_MEM : u32

MEM_* flags used by NtAllocateVirtualMemory.

Enumerator
kXMemDecommit 

Decommits the pages and keeps the reservation.

kXMemRelease 

Releases the whole reservation.

kXMemFree 

State reported for pages neither reserved nor committed.

kXMemPrivate 

Type NtQueryVirtualMemory reports for every region.

kXMemReset 

Valid only alone. NtAllocateVirtualMemory logs it as a stub.

kXMemLargePages 

Backs the allocation with 64 KB pages instead of 4 KB pages.

kXMemHeap 

No code reads it.

kXMem16MBPages 

Backs the allocation with 16 MB pages.

◆ X_PAGE

enum rex::kernel::X_PAGE : u16

PAGE_* flags used by NtAllocateVirtualMemory.

Enumerator
kXPageNoAccess 

Any access faults.

kXPageWriteCopy 

No code reads it.

kXPageExecute 

Equivalent to kXPageReadOnly.

kXPageExecuteRead 

Equivalent to kXPageReadOnly.

kXPageExecuteReadWrite 

Equivalent to kXPageReadWrite.

kXPageExecuteWriteCopy 

NtAllocateVirtualMemory logs it as an execute request.

kXPageGuard 

First access raises a guard page exception and clears the flag.

kXPageNoCache 

Pages are not cached, which the XDK says is slow.

kXPageWriteCombine 

Pages are not cached and writes are combined into larger batches.

◆ XContentType

enum class rex::kernel::XContentType : u32
strong

Type of a content package and the hex folder name of its path.

Enumerator
kInvalid 

No content type.

◆ XEXCompressionType

Enumerator
kXEXCompressionBasic 

Image data is stored as the runs of XEXFileBasicCompressionInfo.

kXEXCompressionNormal 

Image data is LZX compressed per XEXFileNormalCompressionInfo.

kXEXCompressionDelta 

The image is a delta patch applied to a base image.

◆ XEXHeaderKey

Enumerator
kXEXHeaderEntryPoint 

Inline value holding the guest address of the entry point.

kXEXHeaderImageBaseAddress 

Inline value holding the guest address the image loads at.

kXEXHeaderDefaultStackSize 

Inline value holding the default thread stack size in bytes.

kXEXHeaderDefaultFilesystemCacheSize 

Inline value holding the default filesystem cache size.

kXEXHeaderDefaultHeapSize 

Inline value holding the default heap size.

kXEXHeaderTitleWorkspaceSize 

Inline value holding the title workspace size.

kXEXHeaderAlternateTitleIDs 

Selects XEXOptU32Words holding alternate title IDs.

kXEXHeaderExportsByName 

Selects XEXOptDataDirectory locating the named export table.

◆ XEXImageFlags

Image flag bits of the XEX security info.

Enumerator
kXEXImageManufacturingUtility 

Set for 4KB pages, otherwise 64KB.

kXEXImageManufacturingSupportTools 

Set for 4KB pages, otherwise 64KB.

kXEXImageXGD2MediaOnly 

Set for 4KB pages, otherwise 64KB.

kXEXImageCardeaKey 

Set for 4KB pages, otherwise 64KB.

kXEXImageXeikaKey 

Set for 4KB pages, otherwise 64KB.

kXEXImageUserModeTitle 

Set for 4KB pages, otherwise 64KB.

kXEXImageUserModeSystem 

Set for 4KB pages, otherwise 64KB.

kXEXImageOrange0 

Set for 4KB pages, otherwise 64KB.

kXEXImageOrange1 

Set for 4KB pages, otherwise 64KB.

kXEXImageOrange2 

Set for 4KB pages, otherwise 64KB.

kXEXImageIPTVSignupApplication 

Set for 4KB pages, otherwise 64KB.

kXEXImageIPTVTitleApplication 

Set for 4KB pages, otherwise 64KB.

kXEXImageKeyVaultPrivilegesRequired 

Set for 4KB pages, otherwise 64KB.

kXEXImageOnlineActivationRequired 

Set for 4KB pages, otherwise 64KB.

kXEXImagePageSize4KB 

Set for 4KB pages, otherwise 64KB.

kXEXImageRegionFree 

Set for 4KB pages, otherwise 64KB.

kXEXImageRevocationCheckOptional 

Set for 4KB pages, otherwise 64KB.

kXEXImageRevocationCheckRequired 

Set for 4KB pages, otherwise 64KB.

◆ XEXRatingBBFCValue

BBFC (British Board of Film Classification) for UK and Ireland

◆ XEXRatingBrazilValue

Brazil ratings

◆ XEXRatingCEROValue

CERO (Computer Entertainment Rating Organization)

◆ XEXRatingESRBValue

ESRB (Entertainment Software Rating Board)

◆ XEXRatingFPBValue

FPB (Film and Publication Board)

◆ XEXRatingKMRBValue

KMRB (Korea Media Rating Board)

◆ XEXRatingOFLCAUValue

OFLC (Office of Film and Literature Classification) for Australia

◆ XEXRatingOFLCNZValue

OFLC (Office of Film and Literature Classification) for New Zealand

◆ XEXRatingPEGIFIValue

PEGI (Pan European Game Information) for Finland

◆ XEXRatingPEGIPTValue

PEGI (Pan European Game Information) for Portugal

◆ XEXRatingPEGIValue

PEGI (Pan European Game Information)

◆ XEXRatingUSKValue

USK (Unterhaltungssoftware SelbstKontrolle)

◆ XEXRegionFlags

Enumerator
kXEXRegionNTSCU 

North America region bits.

kXEXRegionNTSCJ 

Japan and Asia region bits.

kXEXRegionNTSCJJapan 

Japan subset of the NTSCJ bits.

kXEXRegionNTSCJChina 

China subset of the NTSCJ bits.

kXEXRegionPAL 

Europe region bits.

kXEXRegionPALAUNZ 

Australia and New Zealand subset of the PAL bits.

kXEXRegionOther 

Rest of world region bits.

◆ XEXSectionType

Memory protection class of a run of pages in the image.

Enumerator
kXEXSectionCode 

Pages are mapped read only unless the writable code cvar is set.

kXEXSectionData 

Pages are mapped read and write.

kXEXSectionReadOnlyData 

Pages are mapped read only, as for code.

◆ XLanguage

enum class rex::kernel::XLanguage : u8
strong

Title language IDs, the XC_LANGUAGE_ values of the XDK header xconfig.h.

Enumerator
kSChineseDeprecated 

Placeholder the SDK keeps for backward compatibility.

kMaxLanguages 

Number of language IDs, not a language.

Function Documentation

◆ AllocObjectBlock()

ObjectBlock rex::kernel::AllocObjectBlock ( kernel::GuestAddressSpace * memory,
u32 size,
u32 type_address,
WorkspaceHeap * workspace = nullptr )

Allocates a guest block for an object, with its X_OBJECT_HEADER pointing at the type.

Parameters
type_addressThe guest address of the exported type object of the object, such as ExEventObjectType, 0 for an object that has none.
workspaceThe workspace for the header and body, null for the system heap.
Returns
The block with owned set, address 0 when the allocation failed.

◆ CloseOwned()

void rex::kernel::CloseOwned ( IObjectTable & table,
X_HANDLE handle )
inlinenoexcept

Closes a handle the caller owns and logs a close that fails, for teardown and error unwinding.

Parameters
tableThe table that issued the handle.

◆ CreateModule()

X_HANDLE rex::kernel::CreateModule ( TitleRuntime & runtime,
ModuleType type )

Creates a KernelObject with its first handle and stores that handle in the loader data entry.

Parameters
typeWhether the module is kernel or user.
Returns
The handle with a count of 1, 0 when the table cannot grow.

◆ DelayFromTicks()

std::chrono::microseconds rex::kernel::DelayFromTicks ( i64 delay_ticks)

Converts a delay interval in 100 nanosecond ticks to microseconds, scaled by the guest clock and rounded up.

Parameters
delay_ticksA negative relative interval, a positive absolute system time, or 0.
Returns
The time until the interval ends, 0 when it has passed.

◆ FillXVideoMode()

void rex::kernel::FillXVideoMode ( const VideoMode & mode,
X_VIDEO_MODE & out )
inline

Fills a guest video mode structure from a display mode.

Parameters
outReceives the guest structure.

◆ FindByOrdinal()

const ExportEntry * rex::kernel::FindByOrdinal ( ExportModule module,
u16 ordinal )

Finds a row by ordinal.

Returns
The row, or null when the module has no such ordinal.

◆ FreeObjectBlock()

void rex::kernel::FreeObjectBlock ( kernel::GuestAddressSpace * memory,
u32 address,
WorkspaceHeap * workspace = nullptr )

Frees a block made by AllocObjectBlock. The type object it points at is not freed.

Parameters
addressThe address of the object body, 0 for none.
workspaceThe workspace AllocObjectBlock used, null for the system heap.

◆ GetCurrent()

TitleRuntime & rex::kernel::GetCurrent ( )
inline

Returns the runtime the calling thread belongs to. Aborts on a host thread.

◆ GetExports()

std::span< const ExportEntry > rex::kernel::GetExports ( ExportModule module)

Returns the rows of a module table, sorted by ordinal.

◆ GetProcessRuntime()

TitleRuntime * rex::kernel::GetProcessRuntime ( )
nodiscard

Returns the runtime of the process, from any thread, null before Load completes and from the first step of Shutdown.

Valid only until Shutdown starts, because the call does not keep the runtime alive. Unlike GetCurrent(), it needs no title or worker thread and never aborts.

◆ HostListEntry()

template<typename VirtualTranslator>
X_LIST_ENTRY * rex::kernel::HostListEntry ( u32 ptr,
VirtualTranslator context )

Translates a guest list pointer to a host pointer. A translator is any type with TranslateVirtual<T*>(uint32_t) and HostToGuestVirtual(void*), such as kernel::GuestAddressSpace*.

Parameters
ptrThe guest address of the list entry.

◆ InitializeListHead()

template<typename VirtualTranslator>
void rex::kernel::InitializeListHead ( X_LIST_ENTRY * entry,
VirtualTranslator context )

Resets a list head to an empty list.

Parameters
contextThe translator, or the guest address of the list head as an unsigned integer.

◆ InsertHeadList() [1/2]

template<typename VirtualTranslator>
void rex::kernel::InsertHeadList ( u32 list_head,
X_LIST_ENTRY * entry,
VirtualTranslator context )

Links an entry at the head of a list.

Parameters
list_headThe guest address of the list head.

◆ InsertHeadList() [2/2]

template<typename VirtualTranslator>
void rex::kernel::InsertHeadList ( X_LIST_ENTRY * list_head,
u32 list_head_guest,
X_LIST_ENTRY * host_entry,
u32 entry,
VirtualTranslator context )

Links an entry at the head of a list.

Parameters
list_head_guestThe guest address of the list head.
entryThe guest address of the list entry.

◆ InsertTailList() [1/2]

template<typename VirtualTranslator>
void rex::kernel::InsertTailList ( u32 list_head,
u32 entry,
VirtualTranslator context )

Links an entry at the tail of a list.

Parameters
list_headThe guest address of the list head.
entryThe guest address of the list entry.

◆ InsertTailList() [2/2]

template<typename VirtualTranslator>
void rex::kernel::InsertTailList ( X_LIST_ENTRY * list_head,
u32 list_head_guest,
X_LIST_ENTRY * host_entry,
u32 entry,
VirtualTranslator context )

Links an entry at the tail of a list.

Parameters
list_head_guestThe guest address of the list head.
entryThe guest address of the list entry.

◆ IsListEmpty()

template<typename VirtualTranslator>
bool rex::kernel::IsListEmpty ( X_LIST_ENTRY * entry,
VirtualTranslator context )

Reports whether a list has no entries.

Returns
True when the list head links to itself.

◆ IsNoReturnExport()

bool rex::kernel::IsNoReturnExport ( ExportModule module,
u16 ordinal )

Reports whether an export never returns to its caller.

Returns
True when a call to the export ends the calling thread, or restarts the console.

◆ MakeObject()

template<typename T, typename... Args>
std::unique_ptr< KernelObject > rex::kernel::MakeObject ( Args &&... args)
nodiscard

Makes a KernelObject around an alternative of ObjectData, or around a class XAM owns.

Template Parameters
TAn alternative of ObjectData, or an XAMObjectClass.

◆ ModuleFromName()

std::optional< ExportModule > rex::kernel::ModuleFromName ( std::string_view name)

Maps a module name to a table.

Accepts xam or any name that begins with xam.xex, ignoring case.

Returns
The module, or nothing when the name is not a kernel module.

◆ NameFromAttributes()

std::string rex::kernel::NameFromAttributes ( kernel::GuestAddressSpace * memory,
u32 obj_attributes_ptr )

Reads the object name out of an X_OBJECT_ATTRIBUTES.

Parameters
memoryMemory containing the attributes and the name.
obj_attributes_ptrThe guest address of the attributes, or 0.
Returns
The name, empty when the attributes or the name pointer are null.

◆ ParseNmMap()

Result< std::vector< BinarySymbol > > rex::kernel::ParseNmMap ( const std::filesystem::path & map_path,
const MapParseOptions & options = {} )
nodiscard

Parses a map file in the nm format whose lines read "address type name", such as "00000010 T test_sub1". Types are T/t code, D/d data, B/b bss and U undefined.

Parameters
optionsThe base address and filters.
Returns
The symbols, or a not found, IO or corrupt map error.

◆ ParseNmMapString()

Result< std::vector< BinarySymbol > > rex::kernel::ParseNmMapString ( std::string_view map_data,
const MapParseOptions & options = {} )
nodiscard

Parses map data in the nm format from a string.

Parameters
optionsThe base address and filters.
Returns
The symbols, or a not found, IO or corrupt map error.

◆ RemoveEntryList()

template<typename VirtualTranslator>
void rex::kernel::RemoveEntryList ( u32 entry,
VirtualTranslator context )

Unlinks an entry from its list.

Parameters
entryThe guest address of the list entry.

◆ RemoveHeadList()

template<typename VirtualTranslator>
u32 rex::kernel::RemoveHeadList ( X_LIST_ENTRY * entry,
VirtualTranslator context )

Unlinks the first entry of a list.

Returns
The guest address of the removed entry.

◆ ResolveModuleImport()

PPCFunc * rex::kernel::ResolveModuleImport ( ModuleImport & target)

Resolves an import to the function of the exporting module, and resolves it again after a module loads or unloads. Stops the title when the module or the export is gone.

◆ SignalAndWait()

X_STATUS rex::kernel::SignalAndWait ( TitleRuntime & runtime,
const ObjectPin & signal_object,
const ObjectPin & wait_object,
u32 wait_reason,
u32 processor_mode,
u32 alertable,
u64 * opt_timeout )

Signals one pinned object and waits on another as a single operation.

Parameters
signal_objectA pin on the object to signal, which is not empty.
wait_objectA pin on the object to wait on, which is not empty.
alertableNonzero when a user APC ends the wait.
opt_timeoutThe timeout in 100 nanosecond ticks, null to wait forever.
Returns
The status as Wait returns it.

◆ StatusError()

rex::Error rex::kernel::StatusError ( X_STATUS status)
nodiscard

Builds the error a runtime interface returns when a platform call fails with an NT status.

Parameters
statusThe NT status the export returns.
Returns
The error, in category TitleRuntime, with the status as its code.

◆ TimeoutFromTicks()

std::chrono::milliseconds rex::kernel::TimeoutFromTicks ( i64 timeout_ticks)

Converts a wait timeout in 100 nanosecond ticks to milliseconds.

Parameters
timeout_ticksA negative relative timeout, a positive absolute system time, or 0.
Returns
The time until the timeout, 0 when it has passed.

◆ ToXLanguage()

XLanguage rex::kernel::ToXLanguage ( u32 value)
constexprnoexcept

Converts a language ID read from guest memory, a file or a config value.

Parameters
valueThe language ID.
Returns
The language, or XLanguage::kInvalid when value names none.

◆ ToXResult() [1/2]

template<typename T>
X_RESULT rex::kernel::ToXResult ( const Result< T > & result)
nodiscard

Maps a result to the Win32 code XAM reports.

Returns
X_ERROR_SUCCESS, or the code of its error.

◆ ToXResult() [2/2]

X_RESULT rex::kernel::ToXResult ( const rex::Error & error,
X_RESULT unsupported = X_ERROR_FUNCTION_FAILED )
nodiscard

Maps an error to the Win32 code XAM reports.

Parameters
errorAn error built by XResultError.
unsupportedThe code for an error of another category.
Returns
The code of a TitleRuntime error, otherwise unsupported.

◆ ToXStatus() [1/2]

template<typename T>
X_STATUS rex::kernel::ToXStatus ( const Result< T > & result)
nodiscard

Maps a result to the NT status the kernel reports.

Returns
X_STATUS_SUCCESS, or the status of its error.

◆ ToXStatus() [2/2]

X_STATUS rex::kernel::ToXStatus ( const rex::Error & error,
X_STATUS unsupported = X_STATUS_NOT_IMPLEMENTED )
nodiscard

Maps an error to the NT status the kernel reports.

Parameters
errorAn error built by StatusError or by filesystem::BuildError.
unsupportedThe status for the filesystem code kUnsupported.
Returns
The code of a TitleRuntime error, otherwise the status of the filesystem code.

◆ TranslateAnsiPath()

std::string rex::kernel::TranslateAnsiPath ( const kernel::GuestAddressSpace * memory,
const X_ANSI_STRING * ansi_string )
inline

Returns the text of a guest ANSI string with surrounding whitespace removed.

Parameters
ansi_stringThe guest string, may be null.

◆ TranslateAnsiString()

std::string_view rex::kernel::TranslateAnsiString ( const kernel::GuestAddressSpace * memory,
const X_ANSI_STRING * ansi_string )
inline

Returns the characters of a guest ANSI string without copying, empty when the string is null or has no length.

Parameters
ansi_stringThe guest string, may be null.

◆ TranslateAnsiStringAddress()

std::string_view rex::kernel::TranslateAnsiStringAddress ( const kernel::GuestAddressSpace * memory,
u32 guest_address )
inline

Returns the characters of the guest ANSI string at an address without copying, empty when the address is 0.

Parameters
guest_addressThe guest address of the string structure, 0 for none.

◆ TranslateUnicodeString()

std::u16string rex::kernel::TranslateUnicodeString ( const kernel::GuestAddressSpace * memory,
const X_UNICODE_STRING * unicode_string )
inline

Converts a guest UTF-16 string to host byte order.

Parameters
unicode_stringThe guest string, may be null.
Returns
The text, empty when the string is null or has no length.

◆ Wait()

X_STATUS rex::kernel::Wait ( TitleRuntime & runtime,
const ObjectPin & object,
u32 wait_reason,
u32 processor_mode,
u32 alertable,
u64 * opt_timeout )

Waits on a pinned object. A type without a wait handle succeeds at once.

Parameters
objectA pin on the object, which is not empty.
alertableNonzero when a user APC ends the wait.
opt_timeoutThe timeout in 100 nanosecond ticks, null to wait forever.
Returns
X_STATUS_SUCCESS, X_STATUS_USER_APC, X_STATUS_TIMEOUT, or X_STATUS_ABANDONED_WAIT_0.

◆ WaitMultiple()

X_STATUS rex::kernel::WaitMultiple ( TitleRuntime & runtime,
std::span< const ObjectPin > objects,
u32 wait_type,
u32 wait_reason,
u32 processor_mode,
u32 alertable,
u64 * opt_timeout )

Waits on several pinned objects.

Parameters
objectsPins on the objects, none of them empty.
wait_typeNonzero to wait for any object, 0 to wait for all.
alertableNonzero when a user APC ends the wait.
opt_timeoutThe timeout in 100 nanosecond ticks, null to wait forever.
Returns
The index of the signaled object for a wait on any, or the status Wait returns.

◆ XFAILED()

bool rex::kernel::XFAILED ( X_STATUS s)
nodiscardconstexpr

Reports whether a status code is a warning or error code.

Returns
True when bit 31 of the status is set.

◆ XHRESULTFromWin32()

X_HRESULT rex::kernel::XHRESULTFromWin32 ( u32 x)
nodiscardconstexpr

Returns the HRESULT for a Win32 error code, or the value unchanged when it is zero or negative.

Parameters
xWin32 error code.

◆ XOverlappedGetCompletionRoutine()

u32 rex::kernel::XOverlappedGetCompletionRoutine ( void * ptr)
inline

Returns the completion routine of an overlapped call, or 0 when there is none.

Parameters
ptrThe XOVERLAPPED block.

◆ XOverlappedGetEvent()

X_HANDLE rex::kernel::XOverlappedGetEvent ( void * ptr)
inline

Returns the event of an overlapped call, or 0 when there is none.

Parameters
ptrThe XOVERLAPPED block.

◆ XOverlappedGetResult()

u32 rex::kernel::XOverlappedGetResult ( void * ptr)
inline

Returns the result of an overlapped call.

Parameters
ptrThe XOVERLAPPED block.

◆ XOverlappedSetResult()

void rex::kernel::XOverlappedSetResult ( void * ptr,
u32 value )
inline

Publishes the result of an overlapped call.

Parameters
ptrThe XOVERLAPPED block.

◆ XResultError()

rex::Error rex::kernel::XResultError ( X_RESULT result)
nodiscard

Builds the error a runtime interface returns when a platform call fails with a Win32 code.

Parameters
resultThe Win32 code the export returns.
Returns
The error, in category TitleRuntime, with the Win32 code as its code.

◆ XResultFromWin32()

X_RESULT rex::kernel::XResultFromWin32 ( u32 x)
nodiscardconstexpr

Returns the Win32 error code unchanged.

◆ XSUCCEEDED()

bool rex::kernel::XSUCCEEDED ( X_STATUS s)
nodiscardconstexpr

Reports whether a status code is a success or informational code, like NT_SUCCESS.

Returns
True when bit 31 of the status is clear.

Variable Documentation

◆ kFileObjectSize

u32 rex::kernel::kFileObjectSize = 0x68
inlineconstexpr

Size of the guest body of a file object.

◆ kFileObjectTypeId

u16 rex::kernel::kFileObjectTypeId = 5
inlineconstexpr

Value of the Type field at the start of a file object body.

◆ kHandleBase

u32 rex::kernel::kHandleBase = 0xF8000000
inlineconstexpr

The value added to a table slot index, shifted left by 2, to form a handle.

◆ kIOCompletionObjectSize

u32 rex::kernel::kIOCompletionObjectSize = 0x28
inlineconstexpr

Size of the guest body of an IO completion object.

◆ kNotifyListenerObjectSize

u32 rex::kernel::kNotifyListenerObjectSize = 0x30
inlineconstexpr

Size of the guest body of a notify listener.

◆ kObjOpenIf

u32 rex::kernel::kObjOpenIf = 0x80
inlineconstexpr

Object attribute that opens an existing object of the same type when the name is taken.

◆ kPageSize64KiB

u32 rex::kernel::kPageSize64KiB = 64 * 1024
inlineconstexpr

The large page size and title allocation granularity, in bytes.

◆ kRunningTitleID

u32 rex::kernel::kRunningTitleID = 0xFFFFFFFF
constexpr

Placeholder in XCONTENT_AGGREGATE_DATA, substituted with the running title ID.

◆ kStashSignature

memory::FourCCT rex::kernel::kStashSignature = memory::make_fourcc('R', 'E', 'X', '\0')
constexpr

Magic value at the start of the extra block of an XAM enumerator.

◆ kSymbolicLinkObjectSize

u32 rex::kernel::kSymbolicLinkObjectSize = 0xC
inlineconstexpr

Size of a symbolic link body before the target name, which follows it.

◆ kXProcTypeIdle

u32 rex::kernel::kXProcTypeIdle = 0
constexpr

Process types KeGetCurrentProcessType reports.

◆ kXTLSOutOfIndexes

u32 rex::kernel::kXTLSOutOfIndexes = UINT32_MAX
constexpr

Index returned when no TLS slot is free.

◆ X_E_DEVICE_NOT_CONNECTED

X_HRESULT rex::kernel::X_E_DEVICE_NOT_CONNECTED
inlineconstexpr
Initial value:
=
XHRESULTFromWin32(X_ERROR_DEVICE_NOT_CONNECTED)
constexpr X_HRESULT XHRESULTFromWin32(u32 x)
Definition status.h:128