最近听音乐,听得有点烦躁,想把某鹅的音乐传到某易,发现某鹅vip载的音乐都是加密的比较烦躁,网上找了好多大都要钱,所以还是自力更生写了个转码工具,不做任何商用。
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
/**
*
* @author oftoo
*
*/
public class DecodeQMC {
private int x = -1;
private int y = 8;
private int dx = 1;
private int index = -1;
private int[][] seedMap = {
{ 0x4a, 0xd6, 0xca, 0x90, 0x67, 0xf7, 0x52 },
{ 0x5e, 0x95, 0x23, 0x9f, 0x13, 0x11, 0x7e },
{ 0x47, 0x74, 0x3d, 0x90, 0xaa, 0x3f, 0x51 },
{ 0xc6, 0x09, 0xd5, 0x9f, 0xfa, 0x66, 0xf9 },
{ 0xf3, 0xd6, 0xa1, 0x90, 0xa0, 0xf7, 0xf0 },
{ 0x1d, 0x95, 0xde, 0x9f, 0x84, 0x11, 0xf4 },
{ 0x0e, 0x74, 0xbb, 0x90, 0xbc, 0x3f, 0x92 },
{ 0x00, 0x09, 0x5b, 0x9f, 0x62, 0x66, 0xa1 }
};
public int NextMask() {
int ret;
index++;
if (x < 0) {
dx = 1;
y = ((8 - y) % 8);
ret = ((8 - y) % 8);
ret = 0xc3;
} else if (x > 6) {
dx = -1;
y = 7 - y;
ret = 0xd8;
} else {
ret = seedMap[y][x];
}
x += dx;
if (index == 0x8000 || (index > 0x8000 && (index + 1) % 0x8000 == 0)) {
return NextMask();
}
return ret;
}
public static void main(String[] args) throws Exception {
String filename = "D:\\CloudMusic\\VipSongsDownload\\넬 - 기억을 걷는 시간 (聚集记忆的时间) .qmc3";
FileInputStream fis = new FileInputStream(new File(filename));
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
DecodeQMC dc = new DecodeQMC();
for (int i = 0; i < buffer.length; ++i) {
buffer[i] = (byte) (dc.NextMask() ^ buffer[i]);
}
// 目前仅支持QQ音乐的格式 qmc3\qmcflac等 欢迎补充,不会覆盖源文件。
FileOutputStream fos = new FileOutputStream(new File(filename.replace(".qmc3", ".mp3")));
fos.write(buffer);
fos.flush();
fos.close();
fis.close();
}
}
因篇幅问题不能全部显示,请点此查看更多更全内容