2017.10.29 记录:
破解酷狗缓存文件的源代码
[root@localhost 05]# cat dec_kugou.c #include <stdio.h> int main(int argc, char **argv) { int i; int length; unsigned char key[] = {0xAC,0xEC,0xDF,0x57}; unsigned char buffer[sizeof(key)]; FILE *pFilleIn = fopen(argv[1], "rb"); FILE *pFilleOut = fopen(argv[2], "wb"); fseek(pFilleIn, 1024, SEEK_SET); while((length = fread(buffer, 1, sizeof(key), pFilleIn))>0) { for(i=0; i<length; i++) { unsigned char k = key[i]; unsigned char kh = k >> 4; unsigned char kl = k & 0xf; unsigned char b = (unsigned char)buffer[i]; unsigned char low = (b & 0xf) ^ kl; //解密后的低4位 unsigned char high = (((b >> 4) ^ kh) ^ low) & 0xf; //解密后的高4位 buffer[i] = (high << 4 | low); } fwrite(buffer, 1, length, pFilleOut); } fclose(pFilleIn); fclose(pFilleOut); return 0; } [root@localhost 05]#
待处理的缓存文件:
[root@localhost 05]# ls *.kgtemp 02c66d3c382051889497c29474b18f03.kgtemp 6acb11d0d52c45b5c2a33967f4873b60.kgtemp b5edf6a737e70038fc7a1235314b47e8.kgtemp 050e39ad9581da7215a1c5b783e54640.kgtemp 6b2f4a775cebea38af6a089b0168d53a.kgtemp b61fde02e7b534368f03196a786317a5.kgtemp 05e1806b23cf3793a40f06b007a420d4.kgtemp 6bb68e6a9876c703645ceecbf5c3c887.kgtemp b74bd4f6a3bab5651e44f208c77f601e.kgtemp 06e3c534b04cc7158b6f389c6c7cd9d9.kgtemp 6e26b9004a4bf3adf58671db1fe156ef.kgtemp b7780e223a6e92bbcc2d34b0e59c6d37.kgtemp 0b2a5e6049639d023062ff8d94bc25d3.kgtemp 6f45e35a876ebd3f055e7debab2f86eb.kgtemp b94a37be85e3f4f923d5e4f7484b62c2.kgtemp 0bedae888464711752f3a53ffd8d2595.kgtemp 6ff70816b154b38634009edddd427127.kgtemp bb2982fff4a2b877d0002e593883bd1e.kgtemp 0d1b6def574712e276a5d0d1a9fb8f39.kgtemp 710bc0d36584cc1583daa20a9584d058.kgtemp bb4eef5d052277826cf8f6c388fac628.kgtemp 1763e3a946eda8e69b88e4e4038b2e0f.kgtemp 7771857454e6602476371d8e8931b74f.kgtemp bc1d0544968a4f89626ee5d00589ccac.kgtemp 1b355fc88b849a8063177a65bee2af87.kgtemp 7773917d94a372d439509abcac0c144e.kgtemp c166a9811e7357eb66bb093844a930d6.kgtemp 1cfeda1fa65b287b5c71921a932ba4a8.kgtemp 7f1441df6d5c33bccc127df2b770e7b7.kgtemp c3b62743cd9033af24a91542a7556ca5.kgtemp 21f8a7bac850b440c90257f399246ea6.kgtemp 82e5ded7b508a2843f24cfb36590ce59.kgtemp c6ec08947be4d2aac433ad1154e52c8b.kgtemp 25c6b5834f6f1c47158fd891b995f297.kgtemp 84d7c5175c5558b8e4337a334ff34ba6.kgtemp c7868f26342ecb8c761a45863f3be339.kgtemp 25ed479457a813b25fc338a0dde5f101.kgtemp 861a012df65a57a9290737d5d018c76a.kgtemp c8577328fb54c27c7473a6ba6114c446.kgtemp 2c25cde831813f9f0ed849ed1746cb34.kgtemp 871c81ab034a394215c2a01c9f567da1.kgtemp cc06830754955e630abcd103ee295d37.kgtemp 2cbf3d8801873b56ebe7c32c3c8d3991.kgtemp 8e0e39b74d51103fd7c7722370dfab8e.kgtemp cf01e4d1001d61a378a0f4afcb4da6ee.kgtemp 2f0a4882f634ad0d61bbedb03a34271e.kgtemp 928b5a042cd1f4dca8dcb5e5ba91d10f.kgtemp d11210c2f795dc1ac243ddeff51bdcdc.kgtemp 2f0ebd174fe2cb3dedfe82fb6f689b3f.kgtemp 94a8d0f1d2e1150c43cb1c4cbcba422f.kgtemp d275da492bcc41f04fbbe6363ffb9844.kgtemp 3099b46773ec2cb807d33f2b879f7563.kgtemp 951b9b348a5faa01033ddbb65ef9cd85.kgtemp d591fab775b7002a5aa62be45d817146.kgtemp 355d34808f5be6248c4178072c7d56c4.kgtemp 96b1384ebe8f34082d48554f331be9a2.kgtemp d696559789668836e3128cae35b3ff67.kgtemp 3c8d3ad5b55d7f9e6cf410e618aae11d.kgtemp 96efee2581f5ff5e71c94614457541e3.kgtemp e00fa3be7a8b72bdb5ea8d6307618b7b.kgtemp 4058bf023341dee2978d117cd85fd594.kgtemp 9960f95964d05e4e52e6513011ff4e91.kgtemp e157431dd46d3598d2a393d15a22987a.kgtemp 412e19b5d2847c9f3a325e58335a0a73.kgtemp 9c80f2170ac2de60eff850f376975b30.kgtemp eb6862c51d4626f3a2347ee8c8c58a13.kgtemp 4765665af7d0d5247fe73b26f5f52009.kgtemp a27bc9fc64492e0976e406e660327d26.kgtemp eef0047aedfab8998bd1ba3a4a908a91.kgtemp 485d903370e3a13a15ad091f9deff8e0.kgtemp a658466b611f300c73323a19fc702124.kgtemp f1aed71ff4c042048bff6a29cea8d621.kgtemp 4b40dbbb320d3f74c8af6e7fcf726959.kgtemp abf3f11058edb1c562240693c7331b22.kgtemp f23f07aeb5e901b8364b074d03948991.kgtemp 4e21bcf60435474ef2a949566b3faa8a.kgtemp ada466e6ea2b6351d963df3c16bc2ca4.kgtemp f2b45034ce909019a4013addb6b5d37f.kgtemp 5747939b92b5fceaff37e4e1fbe1a20b.kgtemp ae2aee4b8846e50a79580a4984117fa2.kgtemp f41276c9b9416ef9e1fdeefa7b987ac0.kgtemp 5dd8f4b0fb68415472136d961232421b.kgtemp b0c51e3b99c5827a61655621c5d31aa4.kgtemp f9ba6efd036f77958a46acf0cb2ffcdf.kgtemp 689351793b1f9f6293971f792d005135.kgtemp b2ff06dfc10f73370c5a94d24f610f5d.kgtemp ff6e9606e8a0057789ba413b4862d8bb.kgtemp 6a247dff1f394189878c9be3f1820dc6.kgtemp b30f77647707c6b1c6cf1f535de4f20f.kgtemp [root@localhost 05]#
[root@localhost 05]# cat dec.sh ./dec_kgtemp 02c66d3c382051889497c29474b18f03.kgtemp 02c66d3c382051889497c29474b18f03.mp3 ./dec_kgtemp 050e39ad9581da7215a1c5b783e54640.kgtemp 050e39ad9581da7215a1c5b783e54640.mp3 ./dec_kgtemp 05e1806b23cf3793a40f06b007a420d4.kgtemp 05e1806b23cf3793a40f06b007a420d4.mp3 ./dec_kgtemp 06e3c534b04cc7158b6f389c6c7cd9d9.kgtemp 06e3c534b04cc7158b6f389c6c7cd9d9.mp3 ./dec_kgtemp 0b2a5e6049639d023062ff8d94bc25d3.kgtemp 0b2a5e6049639d023062ff8d94bc25d3.mp3 ./dec_kgtemp 0bedae888464711752f3a53ffd8d2595.kgtemp 0bedae888464711752f3a53ffd8d2595.mp3 ./dec_kgtemp 0d1b6def574712e276a5d0d1a9fb8f39.kgtemp 0d1b6def574712e276a5d0d1a9fb8f39.mp3 . . . . .
编译源代码:
[root@localhost 05]# gcc kugou.c -o dec_kgtemp 运行程序,将kgtemp转换为音频文件 [root@localhost 05]# bash dec.sh [root@localhost 05]# file 02c66d3c382051889497c29474b18f03.mp3 02c66d3c382051889497c29474b18f03.mp3: Audio file with ID3 version 2.4.0MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Stereo [root@localhost 05]#
查看MD5与文件名比较:
[root@localhost 05]# md5sum 02c66d3c382051889497c29474b18f03.mp3 02c66d3c382051889497c29474b18f03 02c66d3c382051889497c29474b18f03.mp3 [root@localhost 05]#
破解完成!
本文出自 “李春利” 博客,转载请与作者联系!
原文地址:http://990487026.blog.51cto.com/10133282/1977274