Skip to content

Commit

Permalink
xex1tool: move XEX privileges section
Browse files Browse the repository at this point in the history
  • Loading branch information
emoose committed May 28, 2021
1 parent c3c07ad commit 041f299
Showing 1 changed file with 113 additions and 113 deletions.
226 changes: 113 additions & 113 deletions xex1tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,119 +270,6 @@ void PrintInfo(XEXFile& xex, bool print_mem_pages)
if (addt_mem)
printf(" Requires %dMB Extra Debug Memory\n", addt_mem);

auto privileges = xex.opt_header(XEX_HEADER_PRIVILEGES);
auto privileges32 = xex.opt_header(XEX_HEADER_PRIVILEGES_32);
if (privileges || privileges32)
{
printf("\nXEX Privileges\n");
if (privileges)
{
auto* privs = (xex_opt::XexPrivileges*)&privileges;
if (privs->NoForceReboot)
printf(" 0x00: No Force Reboot\n");
if (privs->ForegroundTasks)
printf(" 0x01: Foreground Tasks\n");
if (privs->NoOddMapping)
printf(" 0x02: No ODD Mapping\n");
if (privs->HandleMceInput)
printf(" 0x03: Handles MCE Input\n");
if (privs->RestrictHudFeatures)
printf(" 0x04: Restricted HUD Features\n");
if (privs->HandleGamepadDisconnect)
printf(" 0x05: Handles Gamepad Disconnect\n");
if (privs->InsecureSockets)
printf(" 0x06: Has Insecure Sockets\n");
if (privs->Xbox1XspInterop)
printf(" 0x07: Xbox1 XSP Interoperability\n");
if (privs->SetDashContext)
printf(" 0x08: Can Set Dash Context\n");
if (privs->TitleUsesGameVoiceChannel)
printf(" 0x09: Uses Game Voice Channel\n");
if (privs->TitlePal50Incompatible)
printf(" 0x0A: PAL-50 Incompatible\n");
if (privs->TitleInsecureUtilityDrive)
printf(" 0x0B: Supports Insecure Utility Drive\n");
if (privs->TitleXamHooks)
printf(" 0x0C: Xam Hooks\n");
if (privs->TitlePii)
printf(" 0x0D: PII\n");
if (privs->CrossplatformSystemLink)
printf(" 0x0E: Crossplatform System Link\n");
if (privs->MultidiscSwap)
printf(" 0x0F: Multidisc Swap\n");
if (privs->MultidiscInsecureMedia)
printf(" 0x10: Supports Insecure Multidisc Media\n");
if (privs->Ap25Media)
printf(" 0x11: AP25 Media\n");
if (privs->NoConfirmExit)
printf(" 0x12: No Confirm Exit\n");
if (privs->AllowBackgroundDownload)
printf(" 0x13: Allows Background Downloads\n");
if (privs->CreatePersistableRamdrive)
printf(" 0x14: Creates Persistable Ramdrive\n");
if (privs->InheritPersistedRamdrive)
printf(" 0x15: Inherits Persisted Ramdrive\n");
if (privs->AllowHudVibration)
printf(" 0x16: Allows HUD Vibration\n");
if (privs->TitleBothUtilityPartitions)
printf(" 0x17: Can Use Both Utility Partitions\n");
if (privs->HandleIPTVInput)
printf(" 0x18: Handles IPTV Input\n");
if (privs->PreferBigButtonInput)
printf(" 0x19: Prefers Big Button Input\n");
if (privs->AllowXsamReservation)
printf(" 0x1A: Allow Xsam Reservation\n");
if (privs->MultidiscCrossTitle)
printf(" 0x1B: Multidisc Cross Title\n");
if (privs->TitleInstallIncompatible)
printf(" 0x1C: Title Install Incompatible\n");
if (privs->AllowAvatarGetMetadataByXUID)
printf(" 0x1D: Allow Avatar Get Metadata By XUID\n");
if (privs->AllowControllerSwapping)
printf(" 0x1E: Allow Controller Swapping\n");
if (privs->DashExtensibilityModule)
printf(" 0x1F: Dash Extensibility Module\n");
}

if (privileges32)
{
auto* privs = (xex_opt::XexPrivileges32*)&privileges32;
if (privs->AllowNetworkReadCancel)
printf(" 0x20: Allow Network Read Cancel\n");
if (privs->UninterruptableReads)
printf(" 0x21: Uninterruptable Reads\n");
if (privs->RequireExperienceFull)
printf(" 0x22: Requires NXE\n");
if (privs->GameVoiceRequiredUI)
printf(" 0x23: Game Voice Required UI\n");
if (privs->TitleSetPresenceString)
printf(" 0x24: Sets Presence String\n");
if (privs->NatalTiltControl)
printf(" 0x25: Natal Tilt Control\n");
if (privs->TitleRequiresSkeletalTracking)
printf(" 0x26: Requires Skeletal Tracking\n");
if (privs->TitleSupportsSkeletalTracking)
printf(" 0x27: Supports Skeletal Tracking\n");
if (privs->UseLargeHDsFileCache)
printf(" 0x28: Uses Large HDs File Cache\n");
if (privs->TitleSupportsDeepLink)
printf(" 0x29: Supports Deep Link\n");
if (privs->TitleBodyProfile)
printf(" 0x2A: Supports Body Profile\n");
if (privs->TitleWinUSB)
printf(" 0x2B: Supports WinUSB\n");
if (privs->TitleSupportsDeepLinkRefresh)
printf(" 0x2C: Supports Deep Link Refresh\n");
if (privs->LocalOnlySockets)
printf(" 0x2D: Local Only Sockets\n");
if (privs->TitleContentAcquireAndDownload)
printf(" 0x2E: Title Content Acquire And Download\n");
if (privs->AllowSystemForeground)
printf(" 0x2F: Allow System Foreground\n");
}
}


printf("\nBasefile Info\n");
auto& pe_name = xex.pe_module_name();
if (pe_name.length())
Expand Down Expand Up @@ -518,6 +405,119 @@ void PrintInfo(XEXFile& xex, bool print_mem_pages)
}
}


auto privileges = xex.opt_header(XEX_HEADER_PRIVILEGES);
auto privileges32 = xex.opt_header(XEX_HEADER_PRIVILEGES_32);
if (privileges || privileges32)
{
printf("\nXEX Privileges\n");
if (privileges)
{
auto* privs = (xex_opt::XexPrivileges*)&privileges;
if (privs->NoForceReboot)
printf(" 0x0: No Force Reboot\n");
if (privs->ForegroundTasks)
printf(" 0x1: Foreground Tasks\n");
if (privs->NoOddMapping)
printf(" 0x2: No ODD Mapping\n");
if (privs->HandleMceInput)
printf(" 0x3: Handles MCE Input\n");
if (privs->RestrictHudFeatures)
printf(" 0x4: Restricted HUD Features\n");
if (privs->HandleGamepadDisconnect)
printf(" 0x5: Handles Gamepad Disconnect\n");
if (privs->InsecureSockets)
printf(" 0x6: Has Insecure Sockets\n");
if (privs->Xbox1XspInterop)
printf(" 0x7: Xbox1 XSP Interoperability\n");
if (privs->SetDashContext)
printf(" 0x8: Can Set Dash Context\n");
if (privs->TitleUsesGameVoiceChannel)
printf(" 0x9: Uses Game Voice Channel\n");
if (privs->TitlePal50Incompatible)
printf(" 0xA: PAL-50 Incompatible\n");
if (privs->TitleInsecureUtilityDrive)
printf(" 0xB: Supports Insecure Utility Drive\n");
if (privs->TitleXamHooks)
printf(" 0xC: Xam Hooks\n");
if (privs->TitlePii)
printf(" 0xD: PII\n");
if (privs->CrossplatformSystemLink)
printf(" 0xE: Crossplatform System Link\n");
if (privs->MultidiscSwap)
printf(" 0xF: Multidisc Swap\n");
if (privs->MultidiscInsecureMedia)
printf(" 0x10: Supports Insecure Multidisc Media\n");
if (privs->Ap25Media)
printf(" 0x11: AP25 Media\n");
if (privs->NoConfirmExit)
printf(" 0x12: No Confirm Exit\n");
if (privs->AllowBackgroundDownload)
printf(" 0x13: Allows Background Downloads\n");
if (privs->CreatePersistableRamdrive)
printf(" 0x14: Creates Persistable Ramdrive\n");
if (privs->InheritPersistedRamdrive)
printf(" 0x15: Inherits Persisted Ramdrive\n");
if (privs->AllowHudVibration)
printf(" 0x16: Allows HUD Vibration\n");
if (privs->TitleBothUtilityPartitions)
printf(" 0x17: Can Use Both Utility Partitions\n");
if (privs->HandleIPTVInput)
printf(" 0x18: Handles IPTV Input\n");
if (privs->PreferBigButtonInput)
printf(" 0x19: Prefers Big Button Input\n");
if (privs->AllowXsamReservation)
printf(" 0x1A: Allow Xsam Reservation\n");
if (privs->MultidiscCrossTitle)
printf(" 0x1B: Multidisc Cross Title\n");
if (privs->TitleInstallIncompatible)
printf(" 0x1C: Title Install Incompatible\n");
if (privs->AllowAvatarGetMetadataByXUID)
printf(" 0x1D: Allow Avatar Get Metadata By XUID\n");
if (privs->AllowControllerSwapping)
printf(" 0x1E: Allow Controller Swapping\n");
if (privs->DashExtensibilityModule)
printf(" 0x1F: Dash Extensibility Module\n");
}

if (privileges32)
{
auto* privs = (xex_opt::XexPrivileges32*)&privileges32;
if (privs->AllowNetworkReadCancel)
printf(" 0x20: Allow Network Read Cancel\n");
if (privs->UninterruptableReads)
printf(" 0x21: Uninterruptable Reads\n");
if (privs->RequireExperienceFull)
printf(" 0x22: Requires NXE\n");
if (privs->GameVoiceRequiredUI)
printf(" 0x23: Game Voice Required UI\n");
if (privs->TitleSetPresenceString)
printf(" 0x24: Sets Presence String\n");
if (privs->NatalTiltControl)
printf(" 0x25: Natal Tilt Control\n");
if (privs->TitleRequiresSkeletalTracking)
printf(" 0x26: Requires Skeletal Tracking\n");
if (privs->TitleSupportsSkeletalTracking)
printf(" 0x27: Supports Skeletal Tracking\n");
if (privs->UseLargeHDsFileCache)
printf(" 0x28: Uses Large HDs File Cache\n");
if (privs->TitleSupportsDeepLink)
printf(" 0x29: Supports Deep Link\n");
if (privs->TitleBodyProfile)
printf(" 0x2A: Supports Body Profile\n");
if (privs->TitleWinUSB)
printf(" 0x2B: Supports WinUSB\n");
if (privs->TitleSupportsDeepLinkRefresh)
printf(" 0x2C: Supports Deep Link Refresh\n");
if (privs->LocalOnlySockets)
printf(" 0x2D: Local Only Sockets\n");
if (privs->TitleContentAcquireAndDownload)
printf(" 0x2E: Title Content Acquire And Download\n");
if (privs->AllowSystemForeground)
printf(" 0x2F: Allow System Foreground\n");
}
}

if (header.Magic == MAGIC_XEX2 || header.Magic == MAGIC_XEX1)
{
printf("\nMedia ID\n ");
Expand Down

0 comments on commit 041f299

Please sign in to comment.