REA in Practice: Reverse-Engineering Kugou Music's API for Download Freedom

Using Kugou Music as an example, a full walkthrough of REA's reverse-engineering workflow from packet capture to local signature verification.
The article introduces REA, a Node.js-based command-line tool, and uses Kugou Music as a case study to walk through the complete reverse-engineering workflow from packet capture to local signature verification. It covers installing via npm and launching the interactive tester, capturing the request packet with the song link in the browser's Network panel, locating key parameters, and using precise prompts to have REA analyze the API and signature algorithm. It then re-injects the login cookie and verifies with a locally recomputed signature, successfully obtaining the playurl and filling in the download logic. The article stresses that REA is just a shell—reverse-engineering quality depends on the underlying AI model's capability and prompt-design precision—and reminds readers such practices should be limited to learning and research with attention to compliance boundaries.
REA has been generating a fair amount of buzz in developer communities lately, billed as a tool that can reverse-engineer any API. The tool itself isn't complicated—it's essentially a Node.js command-line tool that you install globally via npm and then invoke. But its real power doesn't come from the tool itself; it comes from the AI model behind it. The stronger the model, the more efficient and higher-quality the reverse-engineering analysis. This article uses Kugou Music as a case study to walk through the entire workflow from packet capture to local signature verification, helping readers with zero background understand how these tools actually work.
Installation and Startup: The Basics of REA
Getting REA installed is easy. The only prerequisite is a working Node.js and npm environment locally, after which you run the global install command in your terminal. Once installed, you invoke REA from the command line to launch the tester, which opens an interactive page. This page is the entry point for everything that follows—all reverse-engineering analysis, code generation, and local verification happens within this interface.

From a user-experience standpoint, REA is positioned more as an "AI-driven reverse-engineering workbench" than a traditional packet-capture tool. It doesn't replace tools like Charles or Fiddler; instead, once you've captured the request data, the AI handles the analysis of API parameters and generates local reproduction code.
Packet Capture and API Analysis: Locating the Key Parameters
Kugou Music's playback page requires a logged-in session to retrieve complete data. The workflow is: open the target page in your browser, right-click and inspect to open the developer tools' Network panel, then click to play a song. At this point, a data packet carrying the song link is sent. Copy that link and search for it in the Network panel to locate the specific request packet.
This request packet contains several key parameters—exactly the objects that need reverse-engineering. Hand these parameters and request details to REA along with a clear prompt, such as "Help me reverse-engineer this API, get the song link, create the code file at the specified local path, and implement it using the local signature protocol," and REA will begin analyzing automatically.

The key here is the precision of your prompt. The path, the goal, and the implementation approach all need to be spelled out clearly—otherwise the AI's output may deviate from your expectations. In practice, REA's analysis is remarkably fast, completing parameter localization and a preliminary implementation of the signature algorithm in a short amount of time.
Packet Capture refers to the technique of intercepting and recording network requests and responses during communication between a client and a server. In web reverse-engineering scenarios, this is typically done using the browser developer tools' Network panel or proxy tools like Charles and Fiddler. The core value of packet capture is reconstructing the complete request structure of an API—including the URL, request method, request headers (such as Cookie, User-Agent, Referer), query parameters and request body, as well as the data format returned by the server. For APIs that require a logged-in session, packet capture also directly reveals how identity credentials (such as a cookie token) are passed along with the request. Only after obtaining a real request sample can you proceed with parameter analysis, signature algorithm localization, and local reproduction—which is why packet capture is often the starting point of the entire reverse-engineering workflow.
Local Signature Verification: Connecting the Full Chain
Once the analysis is complete, REA generates a test file. On the first run, you may encounter an issue where the cookie isn't taking effect—you'll need to re-inject the login session, refresh the page, and send the request again with the cookie token. After successfully retrieving the playurl, the next step is to send a request directly using a locally recomputed signature to verify whether the server accepts the local signature.

Passing verification means the core challenge has been overcome—the signature algorithm has been correctly reproduced, and the server has no additional risk-control intercepts. At this point, you can have REA fill in the song-download logic, taking the whole process from "able to get the link" to "able to download the file." In actual testing, the downloaded songs play normally, confirming that the parameter concatenation and timestamp handling are both correct.
A signature is a mechanism the server uses to verify the legitimacy and integrity of a request. Before sending a request, the client concatenates several parameters (possibly including a timestamp, random number, and secret key) according to agreed-upon rules, then runs them through a hash or encryption algorithm such as MD5, SHA, or HMAC to produce a string, which is submitted as the signature parameter. Upon receiving the request, the server recomputes it using the same rules and compares the results; if they don't match, the request is rejected. One of the core goals of API reverse-engineering is to reproduce this concatenation rule and algorithm so you can generate a server-accepted signature locally. Signatures are usually bound to a timestamp and have a limited validity period, requiring recomputation after expiry; some platforms also layer on risk-control fields, making the signature logic even more complex.
The Relationship Between Tool and Model: Who Is the Real Bottleneck?
Running through the entire workflow, REA's performance is genuinely efficient—but there's an easily overlooked fact: REA is just a shell. It's responsible for organizing prompts, calling the model, and executing the generated code, while the quality of the reverse-engineering analysis depends entirely on the capability of the underlying AI model.

If the model itself doesn't have a deep enough understanding of protocol analysis, encryption algorithms, and JavaScript reverse-engineering, no tool—however good—can produce usable results. Conversely, when the model is capable, REA can compress the analysis cycle into a very short window. This also explains why the same tool produces vastly different results in different hands—the gap isn't in the tool, but in the model configuration and the user's prompt-design ability.
Prompt design plays the role of a "task specification document" here. A large model won't automatically know which directory you want the code written to, which language to use, or whether to go with local signing or direct API calls—these constraints must be conveyed through clear natural-language descriptions. An effective prompt typically contains four elements: goal (which API to reverse-engineer, what data to obtain), input (request samples and key parameters), constraints (file path, implementation approach, dependency limits), and acceptance criteria (how to judge success). The more specific the prompt, the lower the probability the model's output deviates from expectations; conversely, vague instructions force the model to "fill in the blanks" on its own, generating code that either doesn't run or contains logical errors. This is also an important reason why the same model yields noticeably different results in different users' hands.
Practical Advice and Boundaries
For readers who want to try a similar workflow, a few points are worth noting. During packet capture, make sure your login session is complete—an expired cookie is the most common stumbling block. Prompts should be specific: spell out the path, the goal, and the verification method. And always run the generated code locally to verify it—don't assume the AI's output is correct.
It should also be made clear that this kind of technical practice should be limited to learning and research purposes. Reverse-engineering touches on platform terms of service and data copyright, and you need to judge the compliance boundaries yourself in actual use. The tool itself is neutral—what matters is how you use it.
One-line Summary
Using Kugou Music as an example, a complete walkthrough of REA's reverse-engineering workflow from packet capture to local signature verification.
Paragraph Summary
The article introduces REA, a Node.js-based command-line tool, and uses Kugou Music as a case study to walk through the complete reverse-engineering workflow from packet capture to local signature verification. First, install it globally via npm and launch the interactive tester; then capture the request packet carrying the song link in the browser's Network panel, locate the key parameters, and use precise prompts to have REA automatically analyze the API and signature algorithm; next, re-inject the login cookie and send a direct request with a locally recomputed signature to verify, successfully obtaining the playurl and filling in the download logic. The article emphasizes that REA itself is just a shell—the quality of reverse-engineering depends on the underlying AI model's capability and the precision of prompt design—and reminds readers that such practices should be limited to learning and research, with attention to compliance boundaries.
Related articles

Chain of Thought Isn't Just for AI: How Humans Can Use CoT to Improve Thinking Quality
Chain of Thought isn't just a prompt trick for large models. Starting from a Hacker News discussion, this article analyzes why CoT works for human thinking too, breaks down actionable ways to transfer it, and highlights the key differences between human CoT and machine CoT.
Cloudflare Teams Up with OpenAI: Closi…
Cloudflare Teams Up with OpenAI: Closing the Loop from Vulnerability Discovery to Defense with AI
Cloudflare uses OpenAI Daybreak to investigate security vulnerabilities and generate reviewable remediation plans, while developers use Codex to boost coding efficiency and quality.

Orca Multi-Agent Orchestration in Practice: A Guide to Parallel Collaboration with Claude and Codex
Orca is Stable AI's free open-source agent workbench supporting 34 agents like Claude Code and Codex in parallel. Learn its Git worktree isolation, multi-model orchestration, and mobile management.