针对 SocialClub 的发行者检查绕过(适用于 b2060 至 b2802)
-
9 七月 20231.0issuer-check-bypass-against-socialclub_1688929077_348594.zip
重要提示:不适用于 Mod 名称
此 mod 将会将其名称从“针对 RGL 的 EXE 完整性绕过”更改(实际上尚未决定下一个名称,请让我先深入研究该问题),这也将应用于 v1.1 以后的存档。alloc8or 告诉我们关于 为什么 GTA5.exe 无法在游戏版本 2824 之前的版本中检查 socialclub.dll 的完整性的更准确信息。
关于
这个 ASI 程序绕过/禁用 GTA5.exe 执行的发行者检查,这是通过与 socialclub.dll 通信来完成的。因此,您可以避免游戏因使用早于游戏版本 2824 的 exe 版本而拒绝启动并显示错误代码 16。使用此插件,您可以反汇编 GTA5.exe 的 b2699 或更早版本,同时为其中一个版本运行可用的游戏环境,其中存在编译器的 RTTI 信息。 您无需为 v1.0.2824.0 或更新版本使用此 ASI,因为游戏根本不会在这些版本中检查发行者。
供您参考,您根本无法使用十六进制编辑器修补 exe 文件,因为几乎所有游戏代码在游戏启动前都已加密。此 ASI 不会禁用任何 Social Club 功能,因此您可以使用它们(例如,在导演模式下使用您的 GTA 在线模式角色)。您应该 使用最新的 RGL使用此 mod!
由于自 v1.0.1032.1 (v1.3.9) 起安装了 ASI 加载器,您将无法访问 GTA 在线模式,因此您无需担心意外访问它。
在不修改游戏代码的情况下,游戏会测试 socialclub.dll 的发行者是“Entrust Code Signing Certification Authority — L1D, Entrust Code Signing CA — OVCS1”还是“DigiCert SHA2 Assured ID Code Signing CA”(将在第一个 Rockstar 徽标电影期间调用且仅调用一次,发行者检查不会在新游戏中进行构建)。此插件只是阻止游戏侦听查询结果。Rockstar Games 似乎最迟从 2023 年 4 月 4 日(UTC)开始,甚至在 Steam 和 EGS 版本中也开始了测试。
是什么让您创建了这个而不是 alloc8or?
首先,如果直到 2022 年上半年,尝试使用非最新版本的每个人都开始发生此问题,alloc8or 可能会制作这种工具,但自 2023 年初以来,他并没有在 GTA modding 方面活跃太多。另一位非常熟悉计算机科学的出色开发人员变得不活跃,就像 MulleDK19(他是制作 RAGE Plugin Hook 的开发人员之一,自 2021 年 5 月以来一直处于非活动状态)。他们都没有提供其作品的源代码或混淆其代码(对于混淆,我确信 MulleDK19 或 LMS 的作品会受到影响,但 alloc8or 的作品可能不是这种情况)。
其次,5Mods 不允许讨论盗版内容,并且一些版主默默地删除了我的一条消息,该消息无意中包含了如何在 5Mods Discord 中使用盗版内容绕过此检查。
由于这些原因,我认为我应该创建此程序以提供一种干净的方式,允许讨论,这将使我们更容易使用反汇编程序检查旧版本,而无需借助受污染/肮脏的内容(并且我还需要此工具才能在 ScriptHookVDotNet 中添加大量高级功能,自 2023 年 5 月以来,我一直是该项目的负责人)。我尝试创建了这个,并且设法在 6 个小时内完成,包括简单的日志系统和一个简单的兼容性测试。
安装
只需将 ExeIntegrityBypassAgainstRGL.asi 拖放到您的 Grand Theft Auto V 文件夹中即可。
如果 ASI 运行并且 exe 具有写入根文件夹的权限,您可以看到创建或更新的 ExeIntegrityBypassAgainstRGL.log(如果权限不足,则不会更新日志,因为日志记录不是强制性的)。
您将需要适用于您计划使用的 GTA5.exe 的适当 update.rpf 文件(至少是适当的 ysc 脚本文件)(例如,适用于 GTA5.exe 的 b2699 的游戏版本 2699 的 update.rpf),因为本机函数的哈希值实际上在大多数更新中都已更改(但至少在 b2612 和 b2699 之间没有本机哈希更新)。
要求
ASI 加载器。不需要 Script Hook V。
虽然这需要 Visual C++ Redistributable 2019+ 才能运行,但您应该在安装 Rockstar Games Launcher 时已安装 Visual C++ Redistributable 2019。
注意
为了避免执行未修补的代码,此程序将尝试使用另一个线程进行修补,并且创建的线程将保持主线程挂起,直到修补完成(实际上是从 GTAVLauncherBypass 窃取的,但我更改了代码以仅挂起一个线程)。因此,如果修补失败一半,游戏可能会无限期地无法启动。
如果 Rockstar 通过甚至不启动 GTA5.exe 的进程来修补此工具(如果 exe 不是最新的),则此工具将无能为力,因为在这种情况下无法加载该工具(我怀疑会发生这种情况,因为发行者检查在 alloc8or 在上述状态中所说的,在以后的游戏版本中限制较少)。
修补作业完成后,ASI 将从 GTA5.exe 分离,并且不会再占用内存或锁定 ASI 文件(忍者风格!),让您在游戏运行时删除 ASI 文件,以防您想知道。
此工具支持所有使用 Rockstar Games Launcher 的版本(在 Steam 版本的 b2060、b2372、b2699 和 b2802 中进行了测试),但此工具不支持任何使用旧版 Social Club 系统的版本(因此此工具在 b1868 或更早版本中不起作用)。您可以在 v2824 或更新版本中使用此工具,但在这种情况下,此工具提供的意义不如完整的 vanilla 游戏,因为这些版本中根本不存在发行者检查。
源代码
可以在 GitHub上找到,该代码已获得 BSD Zero Clause License 的许可,您基本上可以对源代码做任何事情,但不能公开捐赠(因此像 Google 这样的某些方可以使用一些代码),并且不承担任何责任和保证。
我不想对这件事保密或受版权保护。自 v1.0 以来,部分源代码是多余的,因为我有点匆忙地制作了这个工具。
由 kagikn
Important Not for the Mod Name
This mod will be changing its name from "EXE Integrity Bypass Against RGL" (the next name has not been decided actually, let me dig into the issue more first), which will also be applied to archives since v1.1. alloc8or told us more accurate info about why GTA5.exe fails to check the integrity against socialclub.dll in versions older than the game build 2824.
About
This ASI program bypasses/disables the issuer check that GTA5.exe does, which is done by communicating with socialclub.dll. As a result, you can avoid the game refusing to start with the error code 16 for using a version of the exe older than the game build 2824. With this plugin, you can disassemble GTA5.exe for b2699 or older while running working game environments for one of the versions, where compiler's RTTI info is present. You don't need to use this ASI for v1.0.2824.0 or newer ones, because the game don't check the issuer at all in those versions.
For your information, you cannot patch the exe file with a hex editor at all because almost all part of the game code is encrypted before the launch of the game. This ASI does not disable any social club features, so you can use them (e.g. using your characters for GTA Online in the Director Mode). You should use this mod with the latest RGL!
You can't access GTA Online with the ASI loader installed since v1.0.1032.1 (v1.3.9), so you don't need to worry about accessing it by accident.
Without modifying the game code, the game tests if the issuer of socialclub.dll is either "Entrust Code Signing Certification Authority — L1D, Entrust Code Signing CA — OVCS1", or "DigiCert SHA2 Assured ID Code Signing CA" at a earlier stage (will be called during the first Rockstar logo movie and only once, the issuer check won't be done in newer game builds). This plugin just prevents the game from listening to the query result. Looks like Rockstar Games started testing even in Steam and EGS versions starting from April 4th 2023 (in UTC) at the latest.
What made you create this and not alloc8or?
Firstly, alloc8or could make this kind of tool if this issue started to happen for everyone who tries to use a non-latest version until the first half of 2022, but he hasn't been active in GTA modding that much since the beginning of 2023. Another brilliant dev who is familiar with computer science so much got inactive, just like MulleDK19 (who is one of the developers who made RAGE Plugin Hook and has been inactive since May 2021). Neither of them provided source codes of their works or obfuscated their code though (for obfuscation I'm sure works of MulleDK19 or LMS are affected but maybe not the case for alloc8or's).
Secondly, discussing pirating stuff is not allowed in 5Mods and some moderator silently deleted one of my massage that innocently included how to bypass this check with pirated stuff in the 5Mods Discord.
For those reasons, I thought I should create this program to provide a clean way that will be allowed to discuss and this will make us easier to inspect old versions using a disassembler without the help of tainted/dirty stuff (and I will need this tool to add tons of advanced features in ScriptHookVDotNet too, where I am the project lead since May 2023). I tried to create this and managed to do like in 6 hours including the simple log system and a simple testing for compatibility.
Installation
Simply drop ExeIntegrityBypassAgainstRGL.asi into your Grand Theft Auto V folder.
You can see ExeIntegrityBypassAgainstRGL.log created or updated if the ASI runs and the exe has the permission to write to the root folder (won't update the log if the permission is insufficient as logging is not mandatory).
You will need appropriate update.rpf files (at least appropriate ysc script files) for the GTA5.exe you are planning to use (e.g. update.rpf for game build 2699 for the b2699 of GTA5.exe) because hashes for native functions are actually changed in most updates (but no native hash update between b2612 and b2699 at least).
Requirements
The ASI loader. Script Hook V is not needed.
Although this requires Visual C++ Redistributable 2019+ to run, You should have Visual C++ Redistributable 2019 installed already when you installed Rockstar Games Launcher.
Note
To avoid executing the unpatched code, this program will try to patch with another thread and the created thread will keep the main thread suspended until the patch completes (actually yoinked from GTAVLauncherBypass but I changed the code to suspend only one thread). So if the patch fails half done, the game may not get started infinitely.
If Rockstar patch this tool by not even launching a process of GTA5.exe if the exe is not the latest one, this tool can do nothing since the tool can't be loaded in that case (I doubt that will happen since the issuer check is less restricted in later game builds according to what alloc8or said in the above state).
After the patch job is finished, the ASI will detach itself from GTA5.exe and will not occupy the memory or have the lock for the ASI file any longer (Ninja style!), letting you remove the ASI file while the game is running in case you are wondering.
This tool supports all the versions that use Rockstar Games Launcher (tested in b2060, b2372, b2699, and b2802 of Steam version), but this does not support any versions that use the old Social Club system (so this tool doesn't do the job in b1868 or earlier). You can use this tool in v2824 or newer, but this tool does not offer anything meaningful than the complete vanilla game in that case since the issuer check doesn't exist at all in those versions.
Souce Code
Can be found on GitHub, which is licensed under BSD Zero Clause License, where you can do basically anything against the source code but not a public domain dedication (so some parties such as Google can use some piece of code) and without liability and warranty.
I don't want to keep this thing secret or protected with copyright. Some part of source code is redundant (in v1.0) since I made this tool in a bit of a hurry.
By kagikn