Droid 桌面端Factory 解决BOYK无法使用第三方api接入进行对话的自动脚本
- 内容介绍
- 文章标签
- 相关推荐
image963×318 22.4 KB
由于factory自定义api官方不让在桌面端使用,并且个人比较喜欢带ui的版本,便逆向了下,写了个自动修复的版本
代码
"""
Factory Desktop v0.36.0 - 一键解除限制
用法: python patch.py [Factory安装目录]
默认目录: %LOCALAPPDATA%\\Factory\\app-0.36.0
"""
import os, sys, shutil, struct
def find_factory_dir():
if len(sys.argv) > 1:
return sys.argv[1]
default = os.path.join(os.environ.get("LOCALAPPDATA", ""), "Factory", "app-0.36.0")
if os.path.isdir(default):
return default
print("[!] 未找到 Factory 安装目录,请手动指定: python patch.py <目录路径>")
sys.exit(1)
def patch_exe(exe_path):
"""禁用 Electron ASAR 完整性校验 fuse"""
with open(exe_path, "rb") as f:
data = bytearray(f.read())
sentinel = b"dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX"
idx = data.find(sentinel)
if idx < 0:
print("[!] EXE 中未找到 Electron Fuses 标记,可能版本不对")
return False
fuse_base = idx + len(sentinel) + 2 # 跳过 version(
image963×318 22.4 KB
由于factory自定义api官方不让在桌面端使用,并且个人比较喜欢带ui的版本,便逆向了下,写了个自动修复的版本
代码
"""
Factory Desktop v0.36.0 - 一键解除限制
用法: python patch.py [Factory安装目录]
默认目录: %LOCALAPPDATA%\\Factory\\app-0.36.0
"""
import os, sys, shutil, struct
def find_factory_dir():
if len(sys.argv) > 1:
return sys.argv[1]
default = os.path.join(os.environ.get("LOCALAPPDATA", ""), "Factory", "app-0.36.0")
if os.path.isdir(default):
return default
print("[!] 未找到 Factory 安装目录,请手动指定: python patch.py <目录路径>")
sys.exit(1)
def patch_exe(exe_path):
"""禁用 Electron ASAR 完整性校验 fuse"""
with open(exe_path, "rb") as f:
data = bytearray(f.read())
sentinel = b"dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX"
idx = data.find(sentinel)
if idx < 0:
print("[!] EXE 中未找到 Electron Fuses 标记,可能版本不对")
return False
fuse_base = idx + len(sentinel) + 2 # 跳过 version(

