Re: Can I ship my game without encrypting assets?

#3
You can of course choose not to encrypt your .PAK files.

However, if you wish to encrypt them, use PAKEncrypt as instructed in the documentation, then, depending on the version you will have to manually add the key to the PAK Manager startup parameters and compile the CrySystem.dll yourself with Visual Studio. For 5.5 you will want to edit SystemInit.cpp.
Here is an example:

From line #2000 SystemInit.cpp

Code: Select all

// Legacy support for setting decryption key from IGameStartup interface
// Should be removed when legacy game dll's are gone
if (ICVar* pLegacyGameDllCVar = m_env.pConsole->GetCVar("sys_dll_game"))
{
HMODULE hGameDll;

#if !defined(CRY_IS_MONOLITHIC_BUILD)
m_gameLibrary.Set(pLegacyGameDllCVar->GetString());
hGameDll = m_gameLibrary.m_hModule;
#else
hGameDll = CryGetCurrentModule();
#endif
if (hGameDll != nullptr)
{
if (IGameStartup::TEntryFunction CreateTempGameStartup = (IGameStartup::TEntryFunction)CryGetProcAddress(hGameDll, "CreateGameStartup"))
{
IGameStartup* pGameStartup = CreateTempGameStartup();

uint32 keyLen;
const uint8* pKeyData = pGameStartup->GetRSAKey(&keyLen);
if (pKeyData && keyLen > 0)
{
(static_cast<CCryPak*>(m_env.pCryPak))->SetDecryptionKey(pKeyData, keyLen);
}
}
}
} else {
static unsigned char g_rsa_public_key_data[] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
(static_cast<CCryPak*>(m_env.pCryPak))->SetDecryptionKey(g_rsa_public_key_data, sizeof(g_rsa_public_key_data));
}
Uniflare
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Who is online

Users browsing this forum: No registered users and 2 guests