網易雲音樂破解


c++ 17 代碼示例

#include <iostream>
#include <regex>
#include <string>

#include <fstream>
#include <cstdio>
#include <string>
#include <sstream>
#include <streambuf>
#include <filesystem>

std::vector<std::string> mp3FileList(std::string const& baseDir) {
    std::vector<std::string> v;
    for (auto& entry : std::filesystem::directory_iterator(baseDir))
        if (entry.is_regular_file()) {
            auto filename = entry.path().filename().replace_extension();
            v.push_back(filename.string());
        }
    return v;
}

bool save_file(std::string const& filepath, std::vector<std::byte> const& buffer)
{
    std::ofstream ofs(filepath, std::ios::out | std::ios::binary | std::ios::trunc);

    if (!ofs)
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    if (!ofs.write((char*)buffer.data(), buffer.size()))
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    return true;
}


std::byte x{ 0xA3 };
std::vector<std::byte> xorVector(std::vector<std::byte>& v) {

    for (auto& bb : v) {
        bb ^= x;
    }
    return v;
}

std::vector<std::byte> load_file(std::string const& filepath)
{
    std::ifstream ifs(filepath, std::ios::binary | std::ios::ate);

    if (!ifs)
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    auto end = ifs.tellg();
    ifs.seekg(0, std::ios::beg);

    auto size = std::size_t(end - ifs.tellg());

    if (size == 0) { // avoid undefined behavior 
        std::cout << filepath << " is emtype." << '\n';
        return {};
    }

    std::vector<std::byte> buffer(size);

    if (!ifs.read((char*)buffer.data(), buffer.size()))
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    return buffer;
}


int main(int argc, char** argv) {
    std::string baseDir = { R"(C:\Users\zhibin\AppData\Local\Netease\CloudMusic\Cache\Cache)" };
    //     baseDir = { R"(.)" };
    std::string destDir = "d:\\music\\";
    bool is_override = false;

    if (argc < 2) {
        std::cout << argv[0] << R"( saveMP3Dir[d:\\music\\] neteaseMusicCacheDir[C:\Users\zhibin\AppData\Local\Netease\CloudMusic\Cache\Cache] is_override[false])" << std::endl;
    }

    switch (argc) {
    case 4:
        is_override = true;
    case 3:
        baseDir = argv[2];
    case 2:
        destDir = argv[1];
        break;
    default:
        break;
    }
    destDir += "\\";
    //
    auto list = mp3FileList(destDir);

    for (auto& entry : std::filesystem::directory_iterator(baseDir))
        if (entry.is_regular_file()) {
            auto filename = entry.path().filename();
            //std::cout << filename.extension();
            if (filename.extension().compare(".uc") == 0 || filename.extension().compare(".uc!") == 0) {
                std::string destFilename = entry.path().filename().replace_extension("mp3").string();

                std::cout << entry.path().filename() << filename.extension() ;

                auto it = find(list.begin(), list.end(), filename.replace_extension().string());
                if (it != list.end()) {
                    std::cout << "  *** already exists in "<< destDir <<" *** "  << '\n';
                    continue;
                }else
                    std::cout << '\n';


                auto buff = load_file(entry.path().string());
                save_file(destDir + destFilename, xorVector(buff));
                //break; //just convert one file.
            }
        }
}
//
View Code

 

#include <iostream>
#include <regex>
#include <string>

#include <fstream>
#include <cstdio>
#include <string>
#include <sstream>
#include <streambuf>
#include <filesystem>

std::vector<std::string> mp3FileList(std::string const& baseDir) {
    std::vector<std::string> v;
    for (auto& entry : std::filesystem::directory_iterator(baseDir))
        if (entry.is_regular_file()) {
            auto filename = entry.path().filename().replace_extension();
            v.push_back(filename.string());
        }
    return v;
}

bool save_file(std::string const& filepath, std::vector<std::byte> const& buffer)
{
    std::ofstream ofs(filepath, std::ios::out | std::ios::binary | std::ios::trunc);

    if (!ofs)
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    if (!ofs.write((char*)buffer.data(), buffer.size()))
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    return true;
}


std::byte x{ 0xA3 };
std::vector<std::byte> xorVector(std::vector<std::byte>& v) {

    for (auto& bb : v) {
        bb ^= x;
    }
    return v;
}

std::vector<std::byte> load_file(std::string const& filepath)
{
    std::ifstream ifs(filepath, std::ios::binary | std::ios::ate);

    if (!ifs)
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    auto end = ifs.tellg();
    ifs.seekg(0, std::ios::beg);

    auto size = std::size_t(end - ifs.tellg());

    if (size == 0) { // avoid undefined behavior 
        std::cout << filepath << " is emtype." << '\n';
        return {};
    }

    std::vector<std::byte> buffer(size);

    if (!ifs.read((char*)buffer.data(), buffer.size()))
        throw std::runtime_error(filepath + ": " + "std::strerror(errno)");

    return buffer;
}


int main(int argc, char** argv) {
    std::string baseDir = { R"(C:\Users\username\AppData\Local\Netease\CloudMusic\Cache\Cache)" };
    //     baseDir = { R"(.)" };
    std::string destDir = "d:\\music\\";
    bool is_override = false;

    if (argc < 2) {
        std::cout << argv[0] << R"( saveMP3Dir[d:\\music\\] neteaseMusicCacheDir[C:\Users\zhibin\AppData\Local\Netease\CloudMusic\Cache\Cache] is_override[false])" << std::endl;
    }

    switch (argc) {
    case 4:
        is_override = true;
    case 3:
        baseDir = argv[2];
    case 2:
        destDir = argv[1];
        break;
    default:
        break;
    }
    destDir += "\\";
    //
    auto list = mp3FileList(destDir);

    for (auto& entry : std::filesystem::directory_iterator(baseDir))
        if (entry.is_regular_file()) {
            auto filename = entry.path().filename();
            //std::cout << filename.extension();
            if (filename.extension().compare(".uc") == 0 || filename.extension().compare(".uc!") == 0) {
                std::string destFilename = entry.path().filename().replace_extension("mp3").string();

                std::cout << entry.path().filename() << filename.extension() ;

                auto it = find(list.begin(), list.end(), filename.replace_extension().string());
                if (it != list.end()) {
                    std::cout << "  *** already exists in "<< destDir <<" *** "  << '\n';
                    continue;
                }else
                    std::cout << '\n';


                auto buff = load_file(entry.path().string());
                save_file(destDir + destFilename, xorVector(buff));
                //break; //just convert one file.
            }
        }
}
//

 

第一步 緩存歌曲

 

第一步 緩存歌曲

首先打開網易雲音樂隨便緩存一首需要付費下載的歌曲 比如這一首

在這里插入圖片描述

如果你想要下載是需要付費的

在這里插入圖片描述

第二步 找到文件

點開設置->下載設置 找到緩存目錄

在這里插入圖片描述

按照修改日期排序 找到符合修改時間的那一項 后綴名為.uc的最大的文件 就是加密過后的文件 另外一個應該是歌詞文件(在這之前最好先把緩存目錄清空)

在這里插入圖片描述

第三步 解密文件

接着把文件拖到010Edit里 我們可以查看到如下圖所示的數據
在這里插入圖片描述

我們發現一個很明顯的特點——最多的數據是A3 所以可以推測A3就是加密過后的無意義字符0 一般來說音頻的加密方式不會太復雜 而最簡單的異或加密 異或加密是可逆的

所以只要選中所有的數據 點開菜單->工具->十六進制操作->二進制異或 修改處理數據為無符號 十六進制 然后對A3進行異或

在這里插入圖片描述

在這里插入圖片描述

即可對文件進行解密 如下圖 解密完成之后字符變得有意義。前三個字節是ID3,這個是MP3文件格式的頭部

在這里插入圖片描述

然后我們保存修改 把文件后綴改為.mp3 用網易雲音樂打開 OK 音樂正常播放 破解成功

在這里插入圖片描述
其他的音樂播放器加密原理大致相同 不會太復雜 大家可以去嘗試!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM