A Python utility to patch Xbox 360 XEX2 executables by clearing the PAL-50 incompatibility bit (0x00000400) in Title Privileges (key 0x00030000).
This removes the "PAL-50 Incompatible" flag from the XEX header, which can help with region compatibility.
⚠️ This tool only modifies the header directory entry. It does not decrypt, decompress, or alter the code segment. Use at your own risk and always keep backups.
- Reads XEX2 header and directory entries (big-endian format).
- Locates the
Privilegesentry (key = 0x00030000). - Clears the
PAL-50mask (0x00000400) if present. - Supports dry-run mode for safe preview.
- Verbose mode for detailed header and directory info.
- Writes a patched copy (
*.patched.xex) by default.
- Python 3.8+
- No external dependencies (uses only standard library).
- Works on Windows, macOS, and Linux.
No installation required. Just download or copy the script locally.
# Optional: make it executable on Unix-like systems
chmod +x xex2-pal50-clear.pypython3 xex2-pal50-clear.py INPUT.xex [-o OUTPUT.xex] [--dry-run] [-v]-
INPUT.xex
Path to the XEX file (encrypted/compressed is fine; header directory is always readable). -
-o, --output OUTPUT.xex
Output path. Default:<INPUT>.patched.xex. -
--dry-run
Do not write changes; only display what would be patched. -
-v, --verbose
Print extra details (header fields and directory entries).
Basic patch:
python3 xex2-pal50-clear.py game.xexDry-run (no writing):
python3 xex2-pal50-clear.py game.xex --dry-run -vCustom output file:
python3 xex2-pal50-clear.py game.xex -o game_no_pal50.xex-
When the
Privilegesentry is found:[OK] Privileges @ 0x00000080 key=0x00030000 value=0x00000C00 -
If PAL-50 bit is already clear:
[INFO] PAL-50 bit (0x00000400) is already 0: no patch needed. -
Patch action:
[PATCH] 0x00000C00 -> 0x00000800 (clear TitlePal50Incompatible) [DONE] Saved: game.xex.patched.xex
0— Success (patched or nothing to do).1— Input file not found.3—Privilegesentry not found in header directory.- Other — Unexpected errors (e.g., truncated header).
- Reads the first
0x18bytes (XEX2 header) and validates magicXEX2. - Parses the header directory (list of BE
(key, value)pairs). - Searches for
KEY_PRIVILEGES = 0x00030000. - If bit
PAL50_MASK = 0x00000400is set invalue, clears it and writes the updated big-endian value back to the file atentry_offset + 4. - Writes to the specified output path (or default
*.patched.xex).
You can verify the patched header with tools like xex1tool:
xex1tool -l "game.xex.patched.xex"You should no longer see:
0xA: PAL-50 Incompatible
- Works only with XEX2 files (magic
XEX2). - Does not decompress or decrypt payloads; modifies header directory value only.
- If a title enforces PAL-50 through other means (e.g., runtime checks), removing the flag may not change behavior.
- Always back up your original XEX file before patching.
Q: Will this fix all PAL-50 issues?
A: No. It only clears the header flag. Any runtime enforcement or engine-level checks remain.
Q: Can I use this on XEX1?
A: No. This tool expects the XEX2 header format and magic.
Q: Is it safe for compressed/encrypted XEX files?
A: Yes. The header directory is readable regardless. The payload is untouched.