[Scummvm-git-logs] scummvm master -> d05bc934d6273ab7a4eddc47579ff1fc840fb2f4

sev- noreply at scummvm.org
Wed Dec 28 12:02:28 UTC 2022


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d7c0ae4075 PRIVATE: Support resources wrapped in MacBinary format
324b22682e COMMON: Respect StuffIt archive size
af2643be44 COMMON: Add a check in StuffIt parser to check for crash condition
8791bad955 PRIVATE: Support in-memory unpacking of Private eye installer
f6ff94a4fa PRIVATE: Mark retail mac installer format as supported
26cc6c6a73 PRIVATE: Mark demo mac installer entry as supported
d05bc934d6 PRIVATE: Match mac versions by data rather than resource fork


Commit: d7c0ae40755e16661314f2c4a1825de9827e8897
    https://github.com/scummvm/scummvm/commit/d7c0ae40755e16661314f2c4a1825de9827e8897
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-28T13:02:22+01:00

Commit Message:
PRIVATE: Support resources wrapped in MacBinary format

This is to allow running from macbinary dumped images

Changed paths:
    engines/private/private.cpp


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 6f774c2d764..bcd6f374ea6 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -1178,10 +1178,10 @@ Common::String PrivateEngine::convertPath(const Common::String &name) {
 void PrivateEngine::playSound(const Common::String &name, uint loops, bool stopOthers, bool background) {
 	debugC(1, kPrivateDebugFunction, "%s(%s,%d,%d,%d)", __FUNCTION__, name.c_str(), loops, stopOthers, background);
 
-	Common::File *file = new Common::File();
 	Common::String path = convertPath(name);
+	Common::SeekableReadStream *file = Common::MacResManager::openFileOrDataFork(path);
 
-	if (!file->open(path))
+	if (!file)
 		error("unable to find sound file %s", path.c_str());
 
 	Audio::LoopingAudioStream *stream;
@@ -1209,10 +1209,10 @@ bool PrivateEngine::isSoundActive() {
 void PrivateEngine::playVideo(const Common::String &name) {
 	debugC(1, kPrivateDebugFunction, "%s(%s)", __FUNCTION__, name.c_str());
 	//stopSound(true);
-	Common::File *file = new Common::File();
 	Common::String path = convertPath(name);
+	Common::SeekableReadStream *file = Common::MacResManager::openFileOrDataFork(path);
 
-	if (!file->open(path))
+	if (!file)
 		error("unable to find video file %s", path.c_str());
 
 	if (!_videoDecoder->loadStream(file))
@@ -1240,12 +1240,12 @@ void PrivateEngine::stopSound(bool all) {
 
 Graphics::Surface *PrivateEngine::decodeImage(const Common::String &name, byte **palette) {
 	debugC(1, kPrivateDebugFunction, "%s(%s)", __FUNCTION__, name.c_str());
-	Common::File file;
 	Common::String path = convertPath(name);
-	if (!file.open(path))
-		error("unable to load image %s", path.c_str());
+	Common::ScopedPtr<Common::SeekableReadStream> file(Common::MacResManager::openFileOrDataFork(path));
+	if (!file)
+		error("unable to load image %s", name.c_str());
 
-	_image->loadStream(file);
+	_image->loadStream(*file);
 	const Graphics::Surface *oldImage = _image->getSurface();
 	Graphics::Surface *newImage;
 


Commit: 324b22682eca85d4d683a35ab41708ebe82a2756
    https://github.com/scummvm/scummvm/commit/324b22682eca85d4d683a35ab41708ebe82a2756
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-28T13:02:22+01:00

Commit Message:
COMMON: Respect StuffIt archive size

This allows handling of archives with trailer like one used in
Private eye installer

Changed paths:
    common/compression/stuffit.cpp


diff --git a/common/compression/stuffit.cpp b/common/compression/stuffit.cpp
index bf7852c0b2f..22e9ad861e6 100644
--- a/common/compression/stuffit.cpp
+++ b/common/compression/stuffit.cpp
@@ -128,7 +128,7 @@ bool StuffItArchive::open(Common::SeekableReadStream *stream) {
 	}
 
 	/* uint16 fileCount = */ _stream->readUint16BE();
-	/* uint32 archiveSize = */ _stream->readUint32BE();
+	uint32 archiveSize = _stream->readUint32BE();
 
 	// Some sort of second magic number
 	if (_stream->readUint32BE() != MKTAG('r', 'L', 'a', 'u')) {
@@ -140,7 +140,7 @@ bool StuffItArchive::open(Common::SeekableReadStream *stream) {
 
 	_stream->skip(7); // unknown
 
-	while (_stream->pos() < _stream->size() && !_stream->eos()) {
+	while (_stream->pos() < _stream->size() && !_stream->eos() && _stream->pos() < archiveSize) {
 		byte resForkCompression = _stream->readByte();
 		byte dataForkCompression = _stream->readByte();
 


Commit: af2643be442f933c9724cc399cd307243e485047
    https://github.com/scummvm/scummvm/commit/af2643be442f933c9724cc399cd307243e485047
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-28T13:02:22+01:00

Commit Message:
COMMON: Add a check in StuffIt parser to check for crash condition

Changed paths:
    common/compression/stuffit.cpp


diff --git a/common/compression/stuffit.cpp b/common/compression/stuffit.cpp
index 22e9ad861e6..40daabc1cfb 100644
--- a/common/compression/stuffit.cpp
+++ b/common/compression/stuffit.cpp
@@ -147,6 +147,9 @@ bool StuffItArchive::open(Common::SeekableReadStream *stream) {
 		byte fileNameLength = _stream->readByte();
 		Common::String name;
 
+		if (fileNameLength > 63)
+			error("File name length too long in stuffit archive: %d at 0x%x", fileNameLength, (int) (_stream->pos() - 3));
+
 		for (byte i = 0; i < fileNameLength; i++)
 			name += (char)_stream->readByte();
 


Commit: 8791bad9556041d56006e4bf262a28aebe55cd4c
    https://github.com/scummvm/scummvm/commit/8791bad9556041d56006e4bf262a28aebe55cd4c
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-28T13:02:22+01:00

Commit Message:
PRIVATE: Support in-memory unpacking of Private eye installer

Changed paths:
    engines/private/private.cpp


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index bcd6f374ea6..f54cf13aa7a 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -32,6 +32,8 @@
 #include "common/str.h"
 #include "common/system.h"
 #include "common/timer.h"
+#include "common/macresman.h"
+#include "common/compression/stuffit.h"
 #include "engines/util.h"
 #include "image/bmp.h"
 
@@ -134,43 +136,53 @@ Common::SeekableReadStream *PrivateEngine::loadAssets() {
 	Common::SeekableReadStream *file = nullptr;
 
 	if (isDemo() && test->open("SUPPORT/ASSETS/DEMOGAME.WIN"))
-		file = test;
-	else if (isDemo() && test->open("SUPPORT/DEMOGAME.MAC"))
-		file = test;
-	else if (test->open("SUPPORT/ASSETS/GAME.WIN")) {
-		file = test;
-	} else if (test->open("SUPPORT/GAME.MAC")) {
-		file = test;
-	} else {
-		delete test;
-		if (!_installerArchive.open("SUPPORT/ASSETS.Z"))
-			error("Failed to open SUPPORT/ASSETS.Z");
-		// if the full game is used
-		if (!isDemo()) {
-			if (_installerArchive.hasFile("GAME.DAT"))
-				file = _installerArchive.createReadStreamForMember("GAME.DAT");
-			else if (_installerArchive.hasFile("GAME.WIN"))
-				file = _installerArchive.createReadStreamForMember("GAME.WIN");
-			else
-				error("Unknown version");
-		} else {
-			// if the demo from archive.org is used
-			if (_installerArchive.hasFile("GAME.TXT"))
-				file = _installerArchive.createReadStreamForMember("GAME.TXT");
-
-			// if the demo from the full retail CDROM is used
-			else if (_installerArchive.hasFile("DEMOGAME.DAT"))
-				file = _installerArchive.createReadStreamForMember("DEMOGAME.DAT");
-			else if (_installerArchive.hasFile("DEMOGAME.WIN"))
-				file = _installerArchive.createReadStreamForMember("DEMOGAME.WIN");
-			else {
-				error("Unknown version");
-			}
-		}
+		return test;
+
+	if (isDemo() && test->open("SUPPORT/DEMOGAME.MAC"))
+		return test;
+	if (test->open("SUPPORT/ASSETS/GAME.WIN"))
+		return test;
+	if (test->open("SUPPORT/GAME.MAC"))
+		return test;
+
+	delete test;
+
+	file = Common::MacResManager::openFileOrDataFork(isDemo() ? "Private Eye Demo Installer" : "Private Eye Installer");
+	if (file) {
+		Common::Archive *s = createStuffItArchive(file);
+		Common::SeekableReadStream *file2 = nullptr;
+		if (s)
+			file2 = s->createReadStreamForMember(isDemo() ? "demogame.mac" : "game.mac");
+		// file2 is enough to keep valid reference
+		delete file;
+		if (file2)
+			return file2;
 	}
-	if (file == nullptr)
+
+	if (!_installerArchive.open("SUPPORT/ASSETS.Z"))
+		error("Failed to open SUPPORT/ASSETS.Z");
+	// if the full game is used
+	if (!isDemo()) {
+		if (_installerArchive.hasFile("GAME.DAT"))
+			return _installerArchive.createReadStreamForMember("GAME.DAT");
+		if (_installerArchive.hasFile("GAME.WIN"))
+			return _installerArchive.createReadStreamForMember("GAME.WIN");
 		error("Unknown version");
-	return file;
+		return nullptr;
+	}
+
+	// if the demo from archive.org is used
+	if (_installerArchive.hasFile("GAME.TXT"))
+		return _installerArchive.createReadStreamForMember("GAME.TXT");
+
+	// if the demo from the full retail CDROM is used
+	if (_installerArchive.hasFile("DEMOGAME.DAT"))
+		return _installerArchive.createReadStreamForMember("DEMOGAME.DAT");
+	if (_installerArchive.hasFile("DEMOGAME.WIN"))
+		return _installerArchive.createReadStreamForMember("DEMOGAME.WIN");
+
+	error("Unknown version");
+	return nullptr;
 }
 
 Common::Error PrivateEngine::run() {


Commit: f6ff94a4fa2f2c1addbfecc12e29280d46a9fa37
    https://github.com/scummvm/scummvm/commit/f6ff94a4fa2f2c1addbfecc12e29280d46a9fa37
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-28T13:02:22+01:00

Commit Message:
PRIVATE: Mark retail mac installer format as supported

Changed paths:
    engines/private/detection.cpp


diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp
index 00857b68ea2..806a6a2e203 100644
--- a/engines/private/detection.cpp
+++ b/engines/private/detection.cpp
@@ -190,11 +190,11 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye", // MacOS release (US) uninstalled
-		_s("Compressed game detected. Please uncompress it as specified in the game description on our Wiki"),
-		AD_ENTRY1s("Private Eye Installer", "02533427ebdf26d5dd12cee8e9f4de4d", 1647309),
+		0,
+		AD_ENTRY1s("Private Eye Installer", "d:02533427ebdf26d5dd12cee8e9f4de4d", 1647309),
 		Common::EN_USA,
 		Common::kPlatformMacintosh,
-		ADGF_UNSUPPORTED,
+		ADGF_NO_FLAGS,
 		GUIO1(GUIO_NOMIDI)
 	},
 	{


Commit: 26cc6c6a73773b18c0a9b778fa75afe18c8a13d3
    https://github.com/scummvm/scummvm/commit/26cc6c6a73773b18c0a9b778fa75afe18c8a13d3
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-28T13:02:22+01:00

Commit Message:
PRIVATE: Mark demo mac installer entry as supported

Changed paths:
    engines/private/detection.cpp


diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp
index 806a6a2e203..6e51d969e1c 100644
--- a/engines/private/detection.cpp
+++ b/engines/private/detection.cpp
@@ -209,11 +209,11 @@ static const ADGameDescription gameDescriptions[] = {
 	},
 	{
 		"private-eye", // MacOS demo (US) uninstalled
-		_s("Compressed game detected. Please uncompress it as specified in the game description on our Wiki"),
-		AD_ENTRY1s("Private Eye Demo Installer", "e7665ddc5e6d932c4a65598ecc4ec7d2", 1626393),
+		0,
+		AD_ENTRY1s("Private Eye Demo Installer", "d:e7665ddc5e6d932c4a65598ecc4ec7d2", 1626393),
 		Common::EN_USA,
 		Common::kPlatformMacintosh,
-		ADGF_DEMO | ADGF_UNSUPPORTED,
+		ADGF_DEMO,
 		GUIO1(GUIO_NOMIDI)
 	},
 	AD_TABLE_END_MARKER


Commit: d05bc934d6273ab7a4eddc47579ff1fc840fb2f4
    https://github.com/scummvm/scummvm/commit/d05bc934d6273ab7a4eddc47579ff1fc840fb2f4
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2022-12-28T13:02:22+01:00

Commit Message:
PRIVATE: Match mac versions by data rather than resource fork

This is a rare case when we don't need resource forks, so allow either with or
without resource forks to match

Changed paths:
    engines/private/detection.cpp


diff --git a/engines/private/detection.cpp b/engines/private/detection.cpp
index 6e51d969e1c..8a720a95a16 100644
--- a/engines/private/detection.cpp
+++ b/engines/private/detection.cpp
@@ -181,8 +181,8 @@ static const ADGameDescription gameDescriptions[] = {
 	{
 		"private-eye", // MacOS release (US)
 		nullptr,
-		AD_ENTRY2s("game.mac", "33553cc04813d3f658bbe9d548377878", 81894,
-		   "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+		AD_ENTRY2s("game.mac", "d:33553cc04813d3f658bbe9d548377878", 81894,
+		   "bklynlgo.bmp", "d:1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::EN_USA,
 		Common::kPlatformMacintosh,
 		ADGF_NO_FLAGS,
@@ -200,8 +200,8 @@ static const ADGameDescription gameDescriptions[] = {
 	{
 		"private-eye", // MacOS demo (US)
 		nullptr,
-		AD_ENTRY2s("demogame.mac", "cfbceaa8b91f0f53c745db61d1bc9749", 6103,
-		    "bklynlgo.bmp", "1dfb703349a46f8ec183de107992b7f5", 33118),
+		AD_ENTRY2s("demogame.mac", "d:cfbceaa8b91f0f53c745db61d1bc9749", 6103,
+		    "bklynlgo.bmp", "d:1dfb703349a46f8ec183de107992b7f5", 33118),
 		Common::EN_USA,
 		Common::kPlatformMacintosh,
 		ADGF_DEMO,




More information about the Scummvm-git-logs mailing list