From c73bf1c0ce211030ac8e915c815408d1f963f7b8 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sat, 20 May 2017 21:47:57 -0500 Subject: SCI: Add resource hash to resource_info debugger command Bad resources that need to be blacklisted sometimes seem to have the same size as good resources. In such cases, the bad resources can be identified by hash instead. Adding a hash output to resource_info will make it easy for users to provide the hash of questionable resources inside of resource bundles that we do not have access to. Refs Trac#9797. --- engines/sci/console.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/sci') diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 99c5498443..211aab0d6e 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -22,6 +22,7 @@ // Console module +#include "common/md5.h" #include "sci/sci.h" #include "sci/console.h" #include "sci/debug.h" @@ -990,6 +991,9 @@ bool Console::cmdResourceInfo(int argc, const char **argv) { if (resource) { debugPrintf("Resource size: %u\n", resource->size()); debugPrintf("Resource location: %s\n", resource->getResourceLocation().c_str()); + Common::MemoryReadStream stream = resource->toStream(); + const Common::String hash = Common::computeStreamMD5AsString(stream); + debugPrintf("Resource hash (decompressed): %s\n", hash.c_str()); } else { debugPrintf("Resource %s.%03d not found\n", argv[1], resNum); } -- cgit v1.2.3