{"id":19605704,"url":"https://github.com/chenjunyu19/hcdump","last_synced_at":"2025-06-10T14:10:04.116Z","repository":{"id":251138867,"uuid":"836506770","full_name":"chenjunyu19/hcdump","owner":"chenjunyu19","description":"读取某个卡通游戏启动器配置文件的方法","archived":false,"fork":false,"pushed_at":"2024-08-01T03:41:39.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T14:10:03.777Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenjunyu19.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-01T02:08:15.000Z","updated_at":"2025-03-04T05:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"98ed5a2b-4ac4-471d-b8ac-220dbc4ea225","html_url":"https://github.com/chenjunyu19/hcdump","commit_stats":null,"previous_names":["chenjunyu19/hcdump"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunyu19%2Fhcdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunyu19%2Fhcdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunyu19%2Fhcdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunyu19%2Fhcdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenjunyu19","download_url":"https://codeload.github.com/chenjunyu19/hcdump/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunyu19%2Fhcdump/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259089057,"owners_count":22803670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T09:45:54.119Z","updated_at":"2025-06-10T14:10:04.091Z","avatar_url":"https://github.com/chenjunyu19.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hcdump\n\n\u003e [!NOTE]\n\u003e 撰写本文时卡通游戏启动器的版本为 `1.0.5.88`。\n\n\u003e [!CAUTION]\n\u003e 对商业软件进行逆向工程违反用户协议和法律法规，由此造成的一切后果由行为人自行承担。继续阅读本文或使用仓库中的其他资源，即视为您已知悉并认可该警告。\n\n## 背景\n\n某个卡通游戏启动器使用 Qt + 网页混合架构开发，其程序目录中含有一个 `AES-256-CBC` 加密的配置文件 `app.conf.dat`，和一个含有网页文件的加密 ZIP 压缩包 `feapp.dat`。这个仓库提供了一种读取和验证 `app.conf.dat` 文件的方法，其中包含 `feapp.dat` 的密码。\n\n## `app.conf.dat` 文件结构\n\n| 256 字节                 | 16 字节 | 剩余部分 |\n| ------------------------ | ------- | -------- |\n| `PKCS1v15(SHA-256)` 签名 | AES IV  | AES 密文 |\n\n其中签名是对文件中除去签名部分的内容生成的。\n\n## 获取公钥和密钥\n\n他们可以通过对启动器进行逆向工程获取，方法较为简单。\n\n公钥用于验证签名，可以忽略，在启动器中以 2048 位 RSA PEM 格式公钥的形式存在，大概长下面给出的样子。找到后保存为单独的文本文件。\n\n```pem\n-----BEGIN PUBLIC KEY-----\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxx\n-----END PUBLIC KEY-----\n```\n\n密钥用于 AES 解密，在启动器中以 Base64 的形式存在。如果你使用仓库中提供的脚本或 `openssl` 命令用于后续的 AES 解密，需要将这个密钥转换为 HEX 格式。下面给出部分可行的方法。\n\n- `base64 -d | hexdump -v -e '/1 \"%02x\"'`\n- CyberChef：[带有配方的连接](https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true,true)To_Hex('None',0))\n\n## 使用一键脚本\n\n仓库中提供了一键脚本 `hcdump.bash`，可以自动验证和解密 `app.conf.dat` 文件并输出到标准输出。如果系统上安装了 `jq`，可以直接使用管道以格式化 JSON 输出。\n\n```shell\n./hcdump.bash -k xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -v publickey.pem app.conf.dat | jq\n```\n\n## JSON 结构\n\n如果你懒得去得到密钥和相关文件，只是好奇文件内容，可以直接阅读以下 TypeScript 接口定义。\n\n```typescript\ninterface AppConf {\n    _meta_ver: string\n    App: {\n        Region: string\n        Language: string\n        Company: string\n        Product: string\n        Standalone: boolean\n        Channel: string\n        SubChannel: string\n        LauncherId: string\n        CPS: string\n        UAPC: string\n        PrimaryGame: string\n        ClientEnv: string\n        ClientPreview: boolean\n        EnableBetaLogin: boolean\n        WebApiBaseUrl: string\n    }\n    FE: {\n        BridgeName: string\n        PackageKey: string\n    }\n    Launcher: {\n        LogDebugMode: boolean\n        PlatApp: string\n        Win7PatchUrl: string\n        Win7PatchMd5: string\n        Win7PatchEnable: boolean\n    }\n    ABTest: {\n        Url: string\n    }\n    Box: {\n        Url: string\n    }\n    H5Log: {\n        Url: string\n    }\n    DataUpload: {\n        Url: string\n    }\n    APM: {\n        AppId: string\n        AppKey: string\n    }\n    Updater: {\n        AppId: string\n        AppKey: string\n        ReportUrl: string\n    }\n    Epic: {\n        EnablePay: boolean\n        ProductId: string\n        SandboxId: string\n        DeploymentId: string\n        CredentialsId: string\n        CredentialsSecret: string\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenjunyu19%2Fhcdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenjunyu19%2Fhcdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenjunyu19%2Fhcdump/lists"}