Various fiddlings.

This commit is contained in:
Ben Vanik
2014-06-22 19:41:26 -07:00
parent a5448b1296
commit 71eb408d67
9 changed files with 77 additions and 8 deletions

View File

@@ -11,6 +11,7 @@
#include <vector>
#include <gflags/gflags.h>
#include <third_party/crypto/rijndael-alg-fst.h>
#include <third_party/crypto/rijndael-alg-fst.c>
#include <third_party/mspack/lzx.h>
@@ -20,6 +21,8 @@
using namespace alloy;
DEFINE_bool(xex_dev_key, false, "Use the devkit key.");
typedef struct xe_xex2 {
xe_ref_t ref;
@@ -434,7 +437,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->execution_info.title_id) {
if (header->execution_info.title_id && !FLAGS_xex_dev_key) {
xexkey = xe_xex2_retail_key;
} else {
xexkey = xe_xex2_devkit_key;