qmc3转MP3工具
QQ音乐下载的文件为qmc0或者qmc3格式,导致其他播放器不能播放,为此找到了转化源码并制作批量转化工具。
运行环境:windows7 64bit
编译环境:VS2010
使用方法:
1,把exe拷贝到本地存放qmc3文件夹
2,双击exe运行
3,转换后的mp3文件在同一目录

下载链接可执行程序下载地址
百度链接https://pan.baidu.com/s/1WRzkgvQNGnfHnrl78HTtWQ
提取码: tfir
解码器源码
class Seed{
public:
Seed():x(-1),y(8),dx(1),index(-1){
}
unsigned char NextMask(){
unsigned char ret;
index++;
if(x < 0)
{
dx = 1;
y = (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;
}
private:
int x;
int y;
int dx;
int index;
static unsigned char seedMap[8][8];
};
unsigned char Seed::seedMap[8][8]={
{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}
};
int processDecodeqmc(unsigned char* in, int len, unsigned char* out)
{
int i = 0;
Seed seed;
for(i = 0; i < len; ++i)
{
out[i] = seed.NextMask() ^ in[i];
}
return i;
}
调用顺序
- qmc0,qmc3文件按字节流读取到in
- 调用processDecodeqmc解码in,解码到字节流out
- 把out存储为.mp3文件
//伪代码
FILE* fpIn = fopen("xx.qmc3", "rb");
FILE* fpOut= fopen("xx.mp3", "wb");
int nSize = filesize;
char in = new char[nSize];
char out= new char[nSize];
int nRead = 0, nOutLen;
while(fpIn != NULL && !feof(fpIn))
{
nRead = fread(in, 1, nSize, fpIn);
nOutLen = processDecodeqmc(in, nRead, out);
fwrite(out, 1, nOutLen, fpOut);
}
fclose(fpIn);
fclose(fpOut);
delete[] in;
delete[] out;

2522

被折叠的 条评论
为什么被折叠?



