Build the socket library and client-local port configuration for redirecting traffic to the offline service. Accept HTTPS and the existing matching and HTTP protocols on the same port. Route requests by the original host.
43 lines
2.8 KiB
JSON
43 lines
2.8 KiB
JSON
{
|
||
"id": "online/network-hook-library",
|
||
"title": "让游戏加载离线版的网络钩子库 wto_ws.dll(代替直接加载 WS2_32.dll),把所有联网都接到本地服务",
|
||
|
||
"program_behaviour": {
|
||
"stock": "exe 从系统的 WS2_32.dll 导入 49 个网络函数(getaddrinfo、connect、sendto 等),程序里写死的 Gaijin 地址(api.gaijinent.com 的购买和兑换码、purch.gaijinent.com、统计上报等)照常解析、连到外网。",
|
||
"patched": "exe 改从同一目录的 wto_ws.dll 导入。wto_ws.dll 把这 49 个函数原样转发给系统的 ws2_32.dll,并在进程里给系统 ws2_32 的解析、连接、UDP 发送函数挂钩子:任何域名都解析到 127.0.0.2,任何连向 127.0.0.2 或外部地址的连接都改到 127.0.0.1:<本地服务端口>(端口读 exe 旁边的 wto_ws.cfg)。"
|
||
},
|
||
|
||
"derivation": {
|
||
"requirement": "handover 6.1 方案 B(用户原话 82、115):写死的地址全部接到本机,由机制保证连不出去;本地服务接住要用的请求(GJN 付款、兑换码等,implementation notes 第 5 节);不用 443 等固定端口。开发纪律第 18 条(与正版隔离)。",
|
||
"cause": "这些地址是程序和 yuplay2 里的常量,network.blk 的 storeApiHost 等只能换主机名,协议和端口(https/443)改不了,很多地址根本没有配置项。",
|
||
"lighter_options_ruled_out": [
|
||
"原生自带:没有统一改所有地址和端口的配置项。",
|
||
"逐个改地址字符串:会漏,有长度限制,管不到进程里其他 DLL(用户在 6.1 排除)。",
|
||
"改 Windows hosts 文件:影响整台电脑和正版(6.1 排除),而且改不了端口。",
|
||
"代码洞里的钩子:只能拦 exe 自己的调用,fmod64、controller、gameHook、libcef 等 DLL 直接调 ws2_32,拦不到(implementation notes)。"
|
||
],
|
||
"conclusion": "只改导入表里的一个 DLL 名(数据,同样 11 字节),钩子代码在离线版自己的 DLL 里。",
|
||
"if_not_applied": "写死的 https 地址照常连外网(断网守护拦下后功能失效);GJN 付款、兑换码等请求到不了本地服务。"
|
||
},
|
||
|
||
"why_this_site": [
|
||
"这个字符串只被 ws2_32 的导入描述符引用。",
|
||
"新名字和原名一样长,原地替换,导入表结构不变。"
|
||
],
|
||
|
||
"features": ["A-不连 Gaijin", "A-与正版隔离", "G-礼包商店", "G-兑换码"],
|
||
"requires": [],
|
||
"evidence": [
|
||
"2.61.0.37 原版 aces.exe:导入表 WS2_32.dll 描述符的 Name = 0x7a4b090,49 个按名导入的函数。",
|
||
"尚未在游戏里验证。"
|
||
],
|
||
"verified_on": [],
|
||
|
||
"edit": {
|
||
"offset": 0,
|
||
"data": { "encoding": "ascii", "text": "wto_ws.dll" },
|
||
"bytes": "77746f5f77732e646c6c00",
|
||
"expect_original": "5753325f33322e646c6c00"
|
||
}
|
||
}
|