···1010 * BDES Header - The "BDES" header found at the start of system update XZP
1111 files.
12121313-* System Software
1414- * Security Overview - A rough high-level overview of the security features
1515- and system of the Xbox 360.
1616- * Software Updates - A rough overview of the software update process.
1717-1813* Hypervisor
1914 * Key Derivation - Notes on how the hypervisor derives decryption keys for
2015 various parts of the system.
···2217* Kernel
2318 * Memory Map - information about the way memory is mapped out in the official
2419 Xbox 360 kernel.
2020+2121+* Networking - **no information here is about Xbox Live.**
2222+ * System Link - The system link / LAN multiplayer connection and encryption
2323+ process.
2424+2525+* System Software
2626+ * Security Overview - A rough high-level overview of the security features
2727+ and system of the Xbox 360.
2828+ * Software Updates - A rough overview of the software update process.
+6-6
official-software/bootloaders/cd.md
···11**Emma's Xbox 360 Research Notes - Bootloaders**
2233-Updated 2nd February 2024.
33+Updated 23rd October 2024.
4455Stub page, for the most part. Needs some work.
66···1717## Launching the Hypervisor
18181919Since CD bootloader runs in a 32-bit translated address space, it can't just
2020-jump to the hypervisor's entrypoint/reset vector. When loading into
2121-2222-It does the following:
2020+jump to the hypervisor's entrypoint/reset vector. When loading into the
2121+hypervisor, it does the following:
23222424-* Clears out any bootloader stages from instruction and data cache
2323+* Flushes any bootloader stages from cache and into RAM(?)
2524* Clears some special purpose registers
2625* Invalidates the translation lookaside buffer
2726* Disables instruction and data address translation in the MSR
···3433```
3534launch_hypervisor:
36353737-; flush CE/CF/CG from data and instruction cache (i think? check)
3636+; store CE/CF/CG into data cache and invalidate instruction cache
3737+; (i think? check)
3838cache_flush:
3939 lis r3, 0x28 ; r3 = 0x280000
4040 li r4, 0x2a00
+83
official-software/networking/system_link.md
···11+**Emma's Xbox 360 Research Notes - Networking**
22+33+Updated 23rd October 2024.
44+55+Stub page.
66+77+# System Link
88+99+To protect network traffic on LAN multiplayer games from being tampered with,
1010+the Xbox 360 employs network encryption as well as non-standard networking on
1111+local LAN multiplayer.
1212+1313+This article also applies to Games for Windows - LIVE, in sections discussing
1414+cross-platform system link.
1515+1616+## Encryption Key Initialisation
1717+1818+When a title initialises WinSock and XNet, `CXnIp::IpInit` initialises several
1919+encryption keys, likely for three different cryptography types, AES, 3DES and
2020+DES. *(TODO: Check)* Pseudocode for the derivation process is as follows:
2121+2222+(Note that this is pseudocode of just key initialisation - it is not C that can
2323+be compiled nor is it any specific CXnIp function)
2424+2525+```c
2626+void initialise_ip_encryption(CXnIp *this) {
2727+ struct {
2828+ char id;
2929+ uint8_t key[0x10];
3030+ } config_buffer; // sizeof(config_buffer) = 0x11
3131+3232+ struct {
3333+ uint8_t key1[0x14];
3434+ uint8_t key2[0x14];
3535+ uint8_t key3[0x14];
3636+ } key_buffer; // sizeof(key_buffer) = 0x3c
3737+3838+ // fetch the LAN key from the executable (360) or config file (GfWL)
3939+ uint8_t *lan_key = get_lan_key();
4040+ if (lan_key == NULL) // no key set = use random key, useless lmao
4141+ XeCryptRandom(config_buffer.key, sizeof(config_buffer.key));
4242+ else
4343+ memcpy(config_buffer.key, lan_key, sizeof(config_buffer.key));
4444+4545+ // only 360 takes this path, GfWL always goes down the cross-platform path
4646+#ifdef XBOX360
4747+ if (use_cross_platform() == false) {
4848+ XeCryptRandom(&key_buffer, sizeof(key_buffer));
4949+5050+ config_buffer.id = 0;
5151+ XeCryptHmacSha(ROAMABLE_KEY, &config_buffer, sizeof(config_buffer), NULL, 0, NULL, 0, key_buffer.key1, 0x14);
5252+ config_buffer.id = 1;
5353+ XeCryptHmacSha(ROAMABLE_KEY, &config_buffer, sizeof(config_buffer), NULL, 0, NULL, 0, key_buffer.key2, 0x14);
5454+ config_buffer.id = 2;
5555+ XeCryptHmacSha(ROAMABLE_KEY, &config_buffer, sizeof(config_buffer), NULL, 0, NULL, 0, key_buffer.key3, 0x14);
5656+ } else
5757+#endif
5858+ {
5959+ // encrypt the title key with the cross-platform system link key,
6060+ // protected by the hypervisor / some mad x86 fuckery
6161+ int r = XeKeysAesCbc(XPLAT_SYSLINK_KEY, config_buffer.key, 0x10, config_buffer.key, &key_buffer /*this is IV, what?*/, ENCRYPT);
6262+ if (!r) // encryption failed, use random key, useless
6363+ XeCryptRandom(config_buffer.key, sizeof(config_buffer.key))
6464+6565+ config_buffer.id = 0;
6666+ XeCryptSha(&config_buffer, 0x11, NULL, 0, NULL, 0, key_buffer.key1, 0x14);
6767+ config_buffer.id = 1;
6868+ XeCryptSha(&config_buffer, 0x11, NULL, 0, NULL, 0, key_buffer.key2, 0x14);
6969+ config_buffer.id = 2;
7070+ XeCryptSha(&config_buffer, 0x11, NULL, 0, NULL, 0, key_buffer.key3, 0x14);
7171+ }
7272+7373+ // use first 0x10 bytes of key1 for some 0x10 byte key, likely AES
7474+ memcpy(this->lan_aes_key, key_buffer.key1, sizeof(this->lan_aes_key)); // 0x10
7575+7676+ // use the next 0x4 bytes of key1 and all of key2 for some 0x18 byte key, likely 3DES
7777+ memcpy(this->lan_3des_key, key_buffer + 0x10, sizeof(this->lan_3des_key)); // 0x18
7878+ XeCryptDesParity(this->lan_3des_key, sizeof(this->lan_3des_key), this->lan_3des_key);
7979+8080+ // use the first 0x8 bytes of key3 for some 0x8 byte key, likely DES
8181+ memcpy(this->lan_des_key, key_buffer.key3, sizeof(this->lan_des_key));
8282+}
8383+```