- Fix for the game trying to decrypt all read files instead of just encrypted images, also fixes a crash when loading mods due to the game trying to decrypt the gsc files.

- Ugly fix for the game crashing with the latest version of steam (credits to IceNinjaman).
This commit is contained in:
Dv4L 2020-07-12 22:27:56 +02:00
parent 4f2e7d4fa9
commit ce4514d40a
2 changed files with 6 additions and 16 deletions

View File

@ -2908,23 +2908,13 @@ namespace Components
// check if file should be skipped
auto skipFile = false;
if (!strncmp(&file[strlen(file) - 4], ".iwi", 4))
{
if (readSize > 3 && !memcmp(&fileBuffer[0], "IWi", 3))
{
skipFile = true;
}
}
else if (strstr(file, "weapons"))
if (!strncmp(&file[strlen(file) - 5], ".iwi", 4))
{
skipFile = true;
}
else
else if (memcmp(&fileBuffer[0], "IWi", 4))
{
if (readSize > 8 && *reinterpret_cast<std::uint32_t*>(&fileBuffer[4]) == 0xe9c9c447)
{
skipFile = true;
}
skipFile = true;
}
// if the header seems encrypted...
@ -3511,4 +3501,4 @@ namespace Components
}
}
#pragma optimize( "", on )
#pragma optimize( "", on )

View File

@ -175,11 +175,11 @@ namespace Steam
size_t expectedParams = Proxy::ClientUser.paramSize("SpawnProcess");
if (expectedParams == 40) // Release
{
Proxy::ClientUser.invoke<bool>("SpawnProcess", ourPath, cmdline.data(), 0, ourDirectory, gameID.bits, mod.data(), Proxy::AppId, 0, 0);
Proxy::ClientUser.invoke("SpawnProcess", ourPath, cmdline.data(), ourDirectory, gameID.bits, mod.data(), Proxy::AppId, 0, 0);
}
else if (expectedParams == 36) // Beta
{
Proxy::ClientUser.invoke<bool>("SpawnProcess", ourPath, cmdline.data(), 0, ourDirectory, gameID.bits, mod.data(), 0, 0);
Proxy::ClientUser.invoke("SpawnProcess", ourPath, cmdline.data(), ourDirectory, gameID.bits, mod.data(), Proxy::AppId, 0, 0);
}
else if (expectedParams == 48) // Legacy, expects VAC blob
{