Пример #1
0
/// Initialization of the decryption process
///
/// @param archive Archive
///
u32 CHimesyo::OnInitDecrypt(CArcFile* archive)
{
	const SFileInfo* file_info = archive->GetOpenFileInfo();
	LPCTSTR          file_ext = PathFindExtension(file_info->name);

	if (lstrcmp(file_ext, _T(".dll")) == 0 || file_info->name == _T("startup.tjs"))
	{
		// Files we don't decode
		SetDecryptRequirement(false);
		return 0;
	}

	// Size to decrypt
	if (lstrcmp(file_ext, _T(".ks"))  != 0 &&
	    lstrcmp(file_ext, _T(".tjs")) != 0 &&
	    lstrcmp(file_ext, _T(".asd")) != 0)
	{
		SetDecryptSize(256);
	}

	// Decryption key
	m_change_decrypt_key = 0;

	return file_info->key ^ 0x03020100 ^ 0xFFFFFFFF;
}
Пример #2
0
/// Initialization of the decryption process
///
/// @param pclArc Archive
///
DWORD CHachukano::OnInitDecrypt(CArcFile* pclArc)
{
	SFileInfo* pstFileInfo = pclArc->GetOpenFileInfo();
	LPCTSTR pszFileExt = PathFindExtension(pstFileInfo->name);

	if ((lstrcmp(pszFileExt, _T(".dll")) == 0) || (pstFileInfo->name == _T("startup.tjs")))
	{
		// Files we don't decode
		SetDecryptRequirement(FALSE);
		return 0;
	}

	// Size to decrypt
	if ((lstrcmp(pszFileExt, _T(".ks")) != 0) && (lstrcmp(pszFileExt, _T(".tjs")) != 0) && (lstrcmp(pszFileExt, _T(".asd")) != 0))
	{
		SetDecryptSize(512);
	}

	// Decryption key
	m_dwChangeDecryptKey = 0;

	return (pstFileInfo->key ^ 0x03020100);
}