From 2521d64615b8f72d66c4b57ec09b4232588962ec Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 6 Feb 2013 03:07:57 -0800 Subject: [PATCH] Fixing decryption key choice to be more robust. --- src/xenia/kernel/xex2.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/xex2.cc b/src/xenia/kernel/xex2.cc index 167436ed8..2e4e589d0 100644 --- a/src/xenia/kernel/xex2.cc +++ b/src/xenia/kernel/xex2.cc @@ -415,7 +415,7 @@ int xe_xex2_decrypt_key(xe_xex2_header_t *header) { // Guess key based on file info. // TODO: better way to finding out which key to use? const uint8_t *xexkey; - if (header->file_format_info.encryption_type == XEX_ENCRYPTION_NORMAL) { + if (header->execution_info.title_id) { xexkey = xe_xex2_retail_key; } else { xexkey = xe_xex2_devkit_key; @@ -763,6 +763,7 @@ int xe_xex2_load_pe(xe_xex2_ref xex) { // Verify DOS signature (MZ). const IMAGE_DOS_HEADER* doshdr = (const IMAGE_DOS_HEADER*)p; if (doshdr->e_magic != IMAGE_DOS_SIGNATURE) { + XELOGE(XT("PE signature mismatch; likely bad decryption/decompression")); return 1; }