diff options
Diffstat (limited to 'utils/zenutils/source/zen_crypt')
-rw-r--r-- | utils/zenutils/source/zen_crypt/main.cpp | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/utils/zenutils/source/zen_crypt/main.cpp b/utils/zenutils/source/zen_crypt/main.cpp index 9944ba97f8..84fee89bd2 100644 --- a/utils/zenutils/source/zen_crypt/main.cpp +++ b/utils/zenutils/source/zen_crypt/main.cpp | |||
@@ -47,23 +47,35 @@ struct player_info_t | |||
47 | { | 47 | { |
48 | const char* name; | 48 | const char* name; |
49 | const char* null_key; // HMAC-SHA1 key | 49 | const char* null_key; // HMAC-SHA1 key |
50 | const char* fresc_key; // BlowFish key | 50 | const char* fresc_key_v1; // BlowFish key |
51 | const char* tl_key; // BlowFish key | 51 | const char* tl_key; // BlowFish key |
52 | bool big_endian; | 52 | bool big_endian; |
53 | }; | 53 | }; |
54 | }; //namespace | 54 | }; //namespace |
55 | 55 | ||
56 | 56 | ||
57 | static const char VERSION[] = "0.1"; | 57 | static const char VERSION[] = "0.2"; |
58 | 58 | ||
59 | static const char null_key_v1[] = "CTL:N0MAD|PDE0.SIGN."; | 59 | static const char null_key_v1[] = "CTL:N0MAD|PDE0.SIGN."; |
60 | static const char null_key_v2[] = "CTL:N0MAD|PDE0.DPMP."; | 60 | static const char null_key_v2[] = "CTL:N0MAD|PDE0.DPMP."; |
61 | static const char null_key_v3[] = "CTL:N0MAD|PDE0.DPFP."; | ||
62 | static const char null_key_v4[] = "CTL:Z3N07|PDE0.DPMP."; | ||
61 | 63 | ||
62 | static const char fresc_key[] = "Copyright (C) CTL. -" | 64 | static const char fresc_key_v1[] = "Copyright (C) CTL. -" |
63 | " zN0MAD iz v~p0wderful!"; | 65 | " zN0MAD iz v~p0wderful!"; |
66 | static const char fresc_key_v2[] = ""; /* Unknown atm */ | ||
64 | 67 | ||
65 | static const char tl_zvm_key[] = "1sN0TM3D az u~may th1nk*" | 68 | static const char tl_zvm_key[] = "1sN0TM3D az u~may th1nk*" |
66 | "Creative Zen Vision:M"; | 69 | "Creative Zen Vision:M"; |
70 | static const char tl_zvm60_key[] = "1sN0TM3D az u~may th1nk*" | ||
71 | "Creative Zen Vision:M (D" | ||
72 | "VP-HD0004)"; | ||
73 | static const char tl_zen_key[] = "1sN0TM3D az u~may th1nk*" | ||
74 | "Creative ZEN"; | ||
75 | static const char tl_zenxf_key[] = "1sN0TM3D az u~may th1nk*" | ||
76 | "Creative ZEN X-Fi"; | ||
77 | static const char tl_zv_key[] = "1sN0TM3D az u~may th1nk*" | ||
78 | "Creative Zen Vision"; | ||
67 | static const char tl_zvw_key[] = "1sN0TM3D az u~may th1nk*" | 79 | static const char tl_zvw_key[] = "1sN0TM3D az u~may th1nk*" |
68 | "Creative ZEN Vision W"; | 80 | "Creative ZEN Vision W"; |
69 | static const char tl_zm_key[] = "1sN0TM3D az u~may th1nk*" | 81 | static const char tl_zm_key[] = "1sN0TM3D az u~may th1nk*" |
@@ -78,16 +90,29 @@ static const char tl_zt_key[] = "1sN0TM3D az u~may th1nk*" | |||
78 | "Creative Zen Touch"; | 90 | "Creative Zen Touch"; |
79 | static const char tl_zx_key[] = "1sN0TM3D az u~may th1nk*" | 91 | static const char tl_zx_key[] = "1sN0TM3D az u~may th1nk*" |
80 | "NOMAD Jukebox Zen Xtra"; | 92 | "NOMAD Jukebox Zen Xtra"; |
93 | static const char tl_zenv_key[] = "1sN0TM3D az u~may th1nk*" | ||
94 | "Creative ZEN V"; | ||
95 | static const char tl_zenvp_key[] = "1sN0TM3D az u~may th1nk*" | ||
96 | "Creative ZEN V Plus"; | ||
97 | static const char tl_zenvv_key[] = "1sN0TM3D az u~may th1nk*" | ||
98 | "Creative ZEN V (Video)"; | ||
81 | 99 | ||
82 | player_info_t players[] = { | 100 | player_info_t players[] = { |
83 | {"Vision:M", null_key_v2, fresc_key, tl_zvm_key, false}, | 101 | {"Zen Vision:M", null_key_v2, fresc_key_v1, tl_zvm_key, false}, |
84 | {"Vision W", null_key_v2, fresc_key, tl_zvw_key, false}, | 102 | {"Zen Vision:M 60GB", null_key_v2, fresc_key_v1, tl_zvm60_key, false}, |
85 | {"Micro", null_key_v1, fresc_key, tl_zm_key, true}, | 103 | {"ZEN", null_key_v4, fresc_key_v2, tl_zen_key, false}, |
86 | {"MicroPhoto", null_key_v1, fresc_key, tl_zmp_key, true}, | 104 | {"ZEN X-Fi", null_key_v4, fresc_key_v2, tl_zenxf_key, false}, |
87 | {"Sleek", null_key_v1, fresc_key, tl_zs_key, true}, | 105 | {"Zen Vision", null_key_v2, fresc_key_v1, tl_zv_key, false}, |
88 | {"SleekPhoto", null_key_v1, fresc_key, tl_zsp_key, true}, | 106 | {"Zen Vision W", null_key_v2, fresc_key_v1, tl_zvw_key, false}, |
89 | {"Touch", null_key_v1, fresc_key, tl_zt_key, true}, | 107 | {"Zen Micro", null_key_v1, fresc_key_v1, tl_zm_key, true}, |
90 | {"Xtra", null_key_v1, fresc_key, tl_zx_key, true}, | 108 | {"Zen MicroPhoto", null_key_v1, fresc_key_v1, tl_zmp_key, true}, |
109 | {"Zen Sleek", null_key_v1, fresc_key_v1, tl_zs_key, true}, | ||
110 | {"Zen SleekPhoto", null_key_v1, fresc_key_v1, tl_zsp_key, true}, | ||
111 | {"Zen Touch", null_key_v1, fresc_key_v1, tl_zt_key, true}, | ||
112 | {"Zen Xtra", null_key_v1, fresc_key_v1, tl_zx_key, true}, | ||
113 | {"Zen V", null_key_v3, fresc_key_v1, tl_zenv_key, false}, | ||
114 | {"Zen V Plus", null_key_v3, fresc_key_v1, tl_zenvp_key, false}, | ||
115 | {"Zen V Video", null_key_v3, fresc_key_v1, tl_zenvv_key, false}, | ||
91 | {NULL, NULL, NULL, NULL, false} | 116 | {NULL, NULL, NULL, NULL, false} |
92 | }; | 117 | }; |
93 | 118 | ||
@@ -96,7 +121,7 @@ player_info_t* find_player_info(std::string player) | |||
96 | { | 121 | { |
97 | for (int i = 0; players[i].name != NULL; i++) | 122 | for (int i = 0; players[i].name != NULL; i++) |
98 | { | 123 | { |
99 | if (!stricmp(players[i].name, player.c_str())) | 124 | if (!strcasecmp(players[i].name, player.c_str())) |
100 | { | 125 | { |
101 | return &players[i]; | 126 | return &players[i]; |
102 | } | 127 | } |
@@ -444,8 +469,8 @@ bool decrypt(shared::bytes& data, int mode, player_info_t* pi, | |||
444 | std::cout << "[*] Decrypting input file..." << std::endl; | 469 | std::cout << "[*] Decrypting input file..." << std::endl; |
445 | 470 | ||
446 | dword iv[2] = {shared::swap(data.size()), 0}; | 471 | dword iv[2] = {shared::swap(data.size()), 0}; |
447 | if (!zen::bf_cbc_decrypt((const byte*)pi->fresc_key, | 472 | if (!zen::bf_cbc_decrypt((const byte*)pi->fresc_key_v1, |
448 | strlen(pi->fresc_key)+1, &data[0], | 473 | strlen(pi->fresc_key_v1)+1, &data[0], |
449 | data.size(), (const byte*)iv)) | 474 | data.size(), (const byte*)iv)) |
450 | { | 475 | { |
451 | std::cerr << "Failed to decrypt the input file." << std::endl; | 476 | std::cerr << "Failed to decrypt the input file." << std::endl; |
@@ -555,11 +580,11 @@ int process_arguments(int argc, char*argv[]) | |||
555 | std::string name = cl.next(""); | 580 | std::string name = cl.next(""); |
556 | if (!name.empty()) | 581 | if (!name.empty()) |
557 | { | 582 | { |
558 | if (!stricmp(name.c_str(), "CENC")) | 583 | if (!strcasecmp(name.c_str(), "CENC")) |
559 | mode = mode_cenc; | 584 | mode = mode_cenc; |
560 | else if (!stricmp(name.c_str(), "FRESC")) | 585 | else if (!strcasecmp(name.c_str(), "FRESC")) |
561 | mode = mode_fresc; | 586 | mode = mode_fresc; |
562 | else if (!stricmp(name.c_str(), "TL")) | 587 | else if (!strcasecmp(name.c_str(), "TL")) |
563 | mode = mode_tl; | 588 | mode = mode_tl; |
564 | } | 589 | } |
565 | if (mode == mode_none) | 590 | if (mode == mode_none) |