Print the LAN key header

Check if the module is a XEX module before calling Unload on XexModule
This commit is contained in:
Dr. Chat 2015-09-25 18:34:54 -05:00
parent 9f2cf96f8a
commit 9ceab26560
1 changed files with 10 additions and 3 deletions

View File

@ -142,12 +142,12 @@ X_STATUS UserModule::LoadFromMemory(const void* addr, const size_t length) {
} }
X_STATUS UserModule::Unload() { X_STATUS UserModule::Unload() {
if (!xex_module()->loaded()) { if (module_format_ == kModuleFormatXex && !xex_module()->loaded()) {
// Quick abort. // Quick abort.
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
if (xex_module()->Unload()) { if (module_format_ == kModuleFormatXex && xex_module()->Unload()) {
OnUnload(); OnUnload();
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
@ -505,7 +505,14 @@ void UserModule::Dump() {
sb.AppendFormat(" XEX_HEADER_GAME_RATINGS (TODO):\n"); sb.AppendFormat(" XEX_HEADER_GAME_RATINGS (TODO):\n");
} break; } break;
case XEX_HEADER_LAN_KEY: { case XEX_HEADER_LAN_KEY: {
sb.AppendFormat(" XEX_HEADER_LAN_KEY (TODO):\n"); sb.AppendFormat(" XEX_HEADER_LAN_KEY:");
auto opt_lan_key =
reinterpret_cast<const xex2_opt_lan_key*>(opt_header_ptr);
for (int l = 0; l < 16; l++) {
sb.AppendFormat(" %.2X", opt_lan_key->key[l]);
}
sb.Append("\n");
} break; } break;
case XEX_HEADER_XBOX360_LOGO: { case XEX_HEADER_XBOX360_LOGO: {
sb.AppendFormat(" XEX_HEADER_XBOX360_LOGO (TODO):\n"); sb.AppendFormat(" XEX_HEADER_XBOX360_LOGO (TODO):\n");