From e3f1a3f33ef2e0a1a5aaf6368fc79b7e4cae0d2b Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Sun, 14 Sep 2008 11:20:29 +0000 Subject: ZenUtils: * Add support for ZEN Mozaic * Add checking for valid FRESC when decrypting git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18511 a1c6a512-1295-4272-9138-f99709370657 --- utils/zenutils/source/zen_crypt/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'utils/zenutils') diff --git a/utils/zenutils/source/zen_crypt/main.cpp b/utils/zenutils/source/zen_crypt/main.cpp index 3442baf738..29f0a843ae 100644 --- a/utils/zenutils/source/zen_crypt/main.cpp +++ b/utils/zenutils/source/zen_crypt/main.cpp @@ -74,6 +74,8 @@ static const char tl_zen_key[] = "1sN0TM3D az u~may th1nk*" "Creative ZEN"; static const char tl_zenxf_key[] = "1sN0TM3D az u~may th1nk*" "Creative ZEN X-Fi"; +static const char tl_zenmo_key[] = "1sN0TM3D az u~may th1nk*" + "Creative ZEN Mozaic"; static const char tl_zv_key[] = "1sN0TM3D az u~may th1nk*" "Creative Zen Vision"; static const char tl_zvw_key[] = "1sN0TM3D az u~may th1nk*" @@ -102,6 +104,7 @@ player_info_t players[] = { {"Zen Vision:M 60GB", null_key_v2, fresc_key_v1, tl_zvm60_key, false}, {"ZEN", null_key_v4, fresc_key_v2, tl_zen_key, false}, {"ZEN X-Fi", null_key_v4, fresc_key_v2, tl_zenxf_key, false}, + {"ZEN Mozaic", null_key_v4, fresc_key_v2, tl_zenmo_key, false}, {"Zen Vision", null_key_v2, fresc_key_v1, tl_zv_key, false}, {"Zen Vision W", null_key_v2, fresc_key_v1, tl_zvw_key, false}, {"Zen Micro", null_key_v1, fresc_key_v1, tl_zm_key, true}, @@ -494,6 +497,13 @@ bool decrypt(shared::bytes& data, int mode, player_info_t* pi, std::cerr << "Failed to decrypt the input file." << std::endl; return false; } + + if (*(dword*)&data[0] != 'EDOC' && + *(dword*)&data[0] != 'CODE') + { + std::cerr << "Failed to decode the input file." << std::endl; + return false; + } if (verbose) std::cout << "[*] Writing file data..." << std::endl; -- cgit