diff options
author | Colin Snover | 2017-05-20 21:47:57 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-20 21:52:00 -0500 |
commit | c73bf1c0ce211030ac8e915c815408d1f963f7b8 (patch) | |
tree | 19815552a3faa9b3890f578be6ffdcc9d8cf1465 /engines | |
parent | dd6cbaa318a3437490a51544eac2fa662d196111 (diff) | |
download | scummvm-rg350-c73bf1c0ce211030ac8e915c815408d1f963f7b8.tar.gz scummvm-rg350-c73bf1c0ce211030ac8e915c815408d1f963f7b8.tar.bz2 scummvm-rg350-c73bf1c0ce211030ac8e915c815408d1f963f7b8.zip |
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.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/console.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |