• 注册
  • 安装教程 安装教程 关注:1784 内容:79

    SPT 4.0.5 离线启动器验证修复

  • 查看作者
  • 打赏作者
  • 3
  • 安装教程
  • 略有小成
    首先,请支持正版!  
    购买地址:  Steam  | 官网
    若急于体验,也可在帖内寻找旧版(≤ 4.0.4)

    在原始 [commit](https://github.com/sp-tarkov/launcher/commit/a4ddd068eac24f17fbc3114309b7c49ce29d781b) 中,已参考 [M3351AN](https://github.com/M3351AN) 的 [SPT-Fuyu](https://github.com/M3351AN/SPT-Fuyu) 项目思路,对 [spt-launcher](https://github.com/sp-tarkov/launcher/blob/master/project/SPT.Launcher.Base/Helpers/ValidationUtil.cs) 函数中注册表路径检测逻辑进行了修改。

    spt-launcher原代码比较逻辑为:

    11 04       IL_013b: ldloc.s 4     // 加载局部变量 num
    16          IL_013d: ldc.i4.0      // 加载常数 0
    FE 01       IL_013e: ceq           // 比较是否相等
    2A          IL_0140: ret           // 返回比较结果

    修改为使用无符号大于比较(`cgt.un`),仅改变运算符,保持指令字节对齐:

    11 04       IL_013b: ldloc.s 4     // 加载局部变量 num
    16          IL_013d: ldc.i4.0      // 加载常数 0
    FE 04       IL_013e: cgt.un        // 无符号大于比较
    2A          IL_0140: ret           // 返回比较结果

    以下是一个简单的 C++ 补丁工具,用于自动修改 `SPT.Launcher.exe`
    #include <iostream>
    #include <fstream>
    #include <vector>
    #include <algorithm>
    
    int main() 
    {
        std::cout << "Try patch\n";
    
        std::ifstream in("SPT.Launcher.exe", std::ios::binary);
        std::vector<unsigned char> buffer(std::istreambuf_iterator<char>(in), {});
        in.close();
    
        const std::vector<unsigned char> original = { 0x11, 0x04, 0x16, 0xFE, 0x01, 0x2A };
        const std::vector<unsigned char> replacement = { 0x11, 0x04, 0x16, 0xFE, 0x04, 0x2A };
    
        auto it = std::search(buffer.begin(), buffer.end(), original.begin(), original.end());
        if (it != buffer.end()) 
        {
            std::copy(replacement.begin(), replacement.end(), it);
            std::ofstream out("SPT.Launcher.patch.exe", std::ios::binary);
            out.write(reinterpret_cast<const char*>(buffer.data()), buffer.size());
            out.close();
            std::cout << "Success!\n";
        }
        else
        {
            std::cout << "No matching byte sequence was found. Please check the file version.\n";
        }
    
        std::cin.get();
        return 0;
    }

    也可以使用 Hex 编辑器(如 dnSpy、HxD、010Editor 等)手动修改:
    查找以下字节:
    11 04 16 FE 01 2A

    替换为:
    11 04 16 FE 04 2A

    # 常见错误做法
    提前返回,会导致堆栈不平衡:
    IL_013b: ldc.i4.1      // 加载 true
    IL_013c: ret         // 返回
    IL_013d: nop         // 填充对齐
    IL_013e: nop
    IL_013f: nop

    — MSVC编译程序:

    下载:https://wwxc.lanzouo.com/i4RCh3bhikpa 密码:14e8   

    (放入启动器同级目录运行,之后会生成一个新的启动器,用新的打开就行)

    初来乍到
    打赏了2金币
    回复
    初来乍到

    楼主棒棒哒,有和原贴主反应这个吗,改一下重新安排上fuyu网站使用

    回复
    圆转纯熟
    打赏了2金币
    回复

    请登录之后再进行评论

    登录
    离线版教程
  • 今日 1
  • 内容 1046
  • 关注 1784
  • 聊天
    关注 2

    【招募】GRIFFIN TKF项目开工 期待你的加入 || 你是否想加入格里芬书写自己与人形的故事

    捐助我们

    • 微信
    • 支付宝
  • 签到
  • 任务
  • 发布
  • 模式切换
  • 偏好设置
  • 帖子间隔 侧栏位置: