PROJECT INFO
StageIdea
Prioritymedium
CreatedMar 22
UpdatedMar 22
ACTIVITY TREND
Commits per week (8 wk)
LINKS
GitHub RepositoryWebsiteDocsAbout This Project
Automated game interaction and analysis scripts built on the Frida dynamic instrumentation framework. Supports memory reading and manipulation, function hooking, real-time game state monitoring, and automated UI interactions. Used for game mechanics research, anti-cheat analysis, and building automated gameplay tools across multiple game titles.
README
花园小程序自动化工具
抖音小程序「花庄万」自动化脚本,通过 Frida 注入 Android 模拟器实现。
核心文件(正在使用)
| 文件 | 说明 |
|---|---|
hook_flower_turbo.js | 主脚本 - 全自动farming(花循环、居民、订单、钻石、珍珠等) |
dashboard.py | Web 监控面板 - http://localhost:8080(支持手机访问) |
farm_control.sh | 安全启停脚本(PID 跟踪,避免 pkill 误杀) |
hd24 消消乐活动脚本
| 文件 | 说明 |
|---|---|
hd24_exploit_v3.js | 消消乐刷分+NPC一步完成(每轮+6564分,自动领NPC礼盒,不开礼盒) |
使用方法
# 1. 打开抖音 → 进入花庄万小程序 → 打开消消乐活动
# 2. 找到 minigame 进程
frida-ps -U | grep minigame
# 3. 注入脚本(优先尝试 minigame0)
frida -U -p <PID> -l ~/Documents/frida_scripts/hd24_exploit_v3.js
# 4. 在消消乐游戏里点一下触发
hd24 签名算法
- 游戏签名:
MD5(myScore.toString() + allScore.toString() + "hd24Sign123321")myScore= 本轮之前的累计积分allScore= 本轮获得的分数
- API签名: 同主脚本
MD5(body + uid + token + ts + "nxc@5!80ri*G")
得分公式
multiplier = 1 + step_index * 0.1
score_per_block = floor(floor(multiplier * 10) * moveType)
step_score = score_per_block * total_blocks_in_step
numStr key = multiplier as string ("1", "1.1", "1.2"...)
total_score = sum of all step_score
hd24 API 命令
| 命令 | 说明 |
|---|---|
hd24Info | 获取活动信息(积分、体力、礼盒) |
hd24Move | 消耗体力移动 {"num":1} |
hd24AddScore | 提交分数 {map, score, sign, type, str, numStr} |
hd24GetNpcRwd | 领NPC奖励 {"id":1} |
hd24GetTaskRwd | 领任务奖励 {"id":1-10} |
hd24GetProgressRwd | 领进度奖励 {"id":1-20} |
hd24GetRank | 查看排名 |
配置参数(hd24_exploit_v3.js)
| 参数 | 默认值 | 说明 |
|---|---|---|
steps | 15 | 每轮消除步数 |
perType | 95 | 每种类型消除数(满足NPC需求) |
maxRounds | 137 | 最大轮数(受体力限制) |
| 每轮得分 | ~6564 | 由 steps 和 perType 决定 |
工具脚本(/tmp,按需使用)
| 文件 | 说明 |
|---|---|
/tmp/scan_all_flowers.js | 扫描所有有效花种子ID |
/tmp/probe_customer.js | 探测顾客订单API结构 |
/tmp/probe_customer2.js | 探测订单完成后返回的下一单需求 |
/tmp/sniff_customer.js | 抓包监听所有API调用 |
环境要求
- macOS + Homebrew
- Android 模拟器(MuMu/雷电/Google Emulator)
- Frida 17.x:
pip install frida-tools,模拟器内/data/local/tmp/frida-server - ADB:
adb connect 127.0.0.1:5555 - Python 3:dashboard 依赖
快速启动
# 1. 连接模拟器
adb connect 127.0.0.1:5555
# 2. 启动 frida-server(模拟器重启后需要)
adb shell "/data/local/tmp/frida-server -D"
# 3. 打开抖音 → 进入花庄万小程序
# 4. 启动脚本
bash ~/Documents/frida_scripts/farm_control.sh start
# 5. 查看状态
bash ~/Documents/frida_scripts/farm_control.sh status
# 6. 停止
bash ~/Documents/frida_scripts/farm_control.sh stop
主脚本模块(hook_flower_turbo.js)
| 模块 | 开关 | 间隔 | 说明 |
|---|---|---|---|
| 花循环 | ENABLE_FLOWER | 8秒 | 种花→收获→升级(不浇水) |
| 居民任务 | ENABLE_RESIDENT | 90秒 | 居民1-8号完成任务 |
| 花艺制作 | ENABLE_CRAFT | 90秒 | 首轮全量制作,后续按订单需求制作 |
| 顾客订单 | ENABLE_CUSTOMER | 90秒 | 自动完成订单,记录下一单需求 |
| 钻石 | ENABLE_DIAMOND | 5分钟 | 点赞、广告、日常任务、花精灵 |
| HD22 | ENABLE_HD22 | 5分钟 | hd22任务领取 |
| 珍珠 | ENABLE_PEARL | 60秒 | 广告珍珠、收获、雇佣、抽奖 |
| 花升级 | - | 5分钟 | 用精华升级所有花 |
| 状态报告 | - | 10分钟 | 输出delta统计 |
API 协议
- 服务器:
https://zhzwdl.youyuanh.cn/cmd/japi.php - 签名:
MD5(body_json + uid + token + timestamp + "nxc@5!80ri*G") - 请求格式:
{"m":"模块","c":"命令","p":{参数}} - 平台:
pf=flowerzhangwandouyin
已知 API 命令
| 模块 | 命令 | 说明 |
|---|---|---|
| flower | sown | 种花 {"str":"1001=50001"} |
| flower | gather | 收获 |
| flower | uproot | 拔除 |
| flower | water | 浇水 |
| flower | upgradeFlower | 升级花 {"id":50001} |
| flower | refreshLand | 查看当前土地状态 |
| flower | createArrangeFlowers | 制作花艺品 {"id":500101,"num":1} |
| flower | dealCustomerOrder | 顾客订单 {"id":1,"yes":1} (yes=1完成/yes=0拒绝) |
| flower | completeResident | 完成居民任务 {"id":1} |
| flower | completeResidentAd | 居民广告奖励 |
| flower | arrangeSellOver | 展架收取 |
| flower | getFreeGiftBag | 免费礼包 |
| flower | getLikeRwd | 点赞奖励 |
| flower | getDailyTaskRwd | 日常任务 |
| flower | adSpeedFlower | 广告加速花 |
| flower | addWheelWater | 水车加水 |
| flower | anti_fraud_get_rwd | 反欺诈奖励 |
| flowerElves | receiveRwd | 花精灵奖励 |
| pearl | comeIn | 进入珍珠系统 |
| pearl | ad | 珍珠广告 |
| pearl | harvest | 收获珍珠 |
| pearl | hire | 雇佣 {"id":1} |
| pearl | draw | 抽奖 {"num":10} |
| hd | hd22GetTaskRwd | HD22任务 |
| heart | game | 心跳 |
账号信息
| 字段 | 旧号 | 新号 |
|---|---|---|
| UID | 213004335 | 213004514 |
| SID | 213 | 213 |
| 有效花数 | 39种 | 48种 |
新号48种有效花ID
50001-50025, 50027
51001-51010, 51013, 51021, 51024, 51025, 51038, 51042
52006, 52010, 52011, 52031, 52091
53002
旧号39种有效花ID
50001-50019, 50021, 50024
51004-51006, 51008-51010, 51015, 51021, 51024, 51038, 51042, 51043
52001, 52006, 52091, 52093, 52094
54002
花艺品ID规则
花艺品ID = 500000 + 花瓶类型*100 + 序号
| 花瓶类型 | 数量 | ID范围 |
|---|---|---|
| 1 | 12 | 500101-500112 |
| 2 | 8 | 500201-500208 |
| 3 | 18 | 500301-500318 |
| 4 | 20 | 500401-500420 |
| 5 | 20 | 500501-500520 |
| 6 | 20 | 500601-500620 |
| 7 | 20 | 500701-500720 |
| 14 | 20 | 501401-501420 |
| 15 | 20 | 501501-501520 |
| 16 | 20 | 501601-501620 |
| 17 | 20 | 501701-501720 |
| 19 | 2 | 501901-501902 |
顾客订单智能逻辑
- 尝试
dealCustomerOrder yes=1完成订单 - 成功后,响应
u.flower.customer包含下一单需求:{arrangeId, num} - 记录需求,下轮只制作需要的花艺品
- 首轮全量制作(不知道当前订单需要什么)
- 不使用 yes=0(会丢失当前订单)
安全注意事项
- 不要用
pkill -f— 会误杀其他进程,已导致两次电脑崩溃 - 使用
farm_control.sh的 PID 跟踪方式管理进程 - frida 异常退出可能导致游戏进程崩溃,需重启模拟器
历史/废弃文件
frida_scripts/ 下有大量历史探索脚本(api_gm_.py, hook__exploit.js 等),
是早期逆向分析过程中产生的,现在不再使用。如需清理可移到 archive/ 目录。
Leave Feedback
STATS
Commits6
Open Issues2
Progress0%
ACTIVITY
RELEASE
Latest: idea
Mar 22
LABELS
Idea
RESOURCES
Docs (coming soon)
CONTRIBUTORS
1 contributor