Repository navigation
ARM 转译层补丁:开机时把 HINT 解码补丁和客体驱动库补丁一起挂上 - #103
Merged
Merged
Conversation
镜像自带的 libvulkan_enc.so 里,doEmulatedDescriptorBufferInfoWriteFromTemplate 和 doEmulatedDescriptorBufferViewWriteFromTemplate 跨到下一个绑定以后,用 table[currBinding][dstArrayElement + i] 写,应为回卷后的 arrOffset(同文件写图像的那个函数是对的)。 一个模板条目连写几个相邻绑定时(World of Airports 的 Unity GPU 蒙皮:descriptorCount=4 写第 0–3 号), 后面几个绑定没写上、反而越界写,计算着色器拿着没写过的存储缓冲描述符派发,宿主显卡卡死, 模拟器报 VK_ERROR_DEVICE_LOST 退出。只在 VulkanBatchedDescriptorSetUpdate 开着时走这条路。 vkfix 加第 5 步,两处等长替换(0x1FED62 14 字节、0x1FEE2C 4 字节),下标改为「下一个 arrOffset 减一」。补丁库 sha256 9e5ba745…;宿主缓存名换成 libvulkan_enc.khrfix-bindlock2-dstpl1.so, 不和 AUTO-MAS 那份(d5258af6…,没有这处修复)互相覆盖。 测试:unicorn 实跑两个函数(原版跨绑定写错、越界;改后 4 种写法全对);单测核补丁点字节、 长度、范围和不重叠,真库比对 AUTO-MAS 那份加上两处补丁点;实机在 flow-b 开着批量更新进 因斯布鲁克,修复前 4 次 4 退,修复后不退。 Refs ModAVD/ModAVD#131
World of Airports 3.7.3(Unity 6000.3)在 libndk_translation.so 里撞上 SEVL(0xd50320bf)抛 SIGILL, 启动约 2 秒闪退。Google 的转译层 0.2.3 把 HINT 空间里的 WFE、WFI、SEV、SEVL 当成未定义指令, 按 ARM 规范它们可以按 NOP 执行。 - 新增 ndkfix:在本机从镜像自带的 /system/lib64/libndk_translation.so(a2086fbc…)生成补丁版, 三套解码器(重优化器、轻转译器、解释器)各改一处 6 字节(jbe rel32 → 6 字节 NOP), 其余未定义编码照旧 SIGILL。build-id、动态符号、GOT、数据区都不动,执行桥的门控和 fork 保护照常。 补丁库 sha256 3efa8977…,只在本机生成,不分发。 - 新增 guestpatch,把客体驱动库补丁和转译层补丁做成同一种 profile;客体脚本 libfix.sh 在一次 root 运行里先只读检查全部、有要上传的就一个都不挂,再逐个 bind mount、核哈希,只要新挂上了 任何一个就 setprop ctl.restart zygote 一次。原来的 vulkanfix 编排改成 guestfix。 - 选补丁按实例自己的配置(inst.Config),缺 abi.type 时按 x86_64 处理,不再重读 config.ini。 测试:ndkfix 真库逐字节比对、补丁点 golden、错误输入;libfix.sh 用 Git 的 sh 加假根目录跑 (两组都挂只 setprop 一次、有上传就不挂、镜像不对、目标不存在、缓存坏、挂载失败、已挂); guestfix 用假客体跑多 profile 的 launched / owed / adopted。变异检查:去掉输入哈希检查、少改一处 补丁点、去掉「有上传就不挂」、每组各 setprop、owed 时不过闸,单测都会失败。实机在 flow-b 冷启动, 两个补丁一次挂上、zygote 只重启一次,WoA 不再出 0xd50320bf,走到登录界面和机场。 Refs ModAVD/ModAVD#131 Refs ModAVD/ModAVD#130
This was referenced Nov 7, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 7, 2026
# Conflicts: # internal/emu/vulkanfix.go # internal/emu/vulkanfix_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么
World of Airports 3.7.3(Unity 6000.3)启动约 2 秒闪退:
ndk_translation: Undefined instruction 0xd50320bf,在 libunity 的加载线程里 SIGILL。0xd50320bf是 AArch64 的SEVL(HINT #5)。Google 的转译层 0.2.3(API 34 r14 镜像)把 HINT 空间里的 WFE、WFI、SEV、SEVL 当未定义指令;按 ARM 规范,它们可以按 NOP 执行(WFE、WFI 允许立即返回,SEV、SEVL 只影响 WFE)。新版 Unity 的自旋锁会用sevl; wfe。改了什么
ndkfix(新包):在本机从镜像自带的
/system/lib64/libndk_translation.so(sha256a2086fbc…,build-id553ba82b…)生成补丁版。DecodeSystemClass里,HINT 那一支各有一处jbe rel32跳到未定义指令出口,换成 6 字节 NOP。之后它们落到 NOP 和 YIELD 原来走的那条出口。3efa8977…,只在本机生成、不分发;仓库里只有哈希和补丁点附近几个字节的 golden 值。guestpatch + libfix.sh(代替原来的 vulkanfix 编排):
libfix.sh在一次 root 运行里先只读检查全部目标。只要有一个要上传,这次一个都不挂。然后逐个 chcon 成目标文件的标签、bind mount、核哈希,失败的那个 umount、不影响别的。只要新挂上了任何一个,就setprop ctl.restart zygote一次。inst.Config):缺abi.type时按 x86_64 处理,ARM64 客体不套用,不再重读 config.ini(ModAVD#130)。vulkan_fix不变,文字改成「客体库补丁」。测试
/system/lib64/libndk_translation.so的 sha256 等于补丁版。0xd50320bf,整段 logcat 里没有未定义指令;pairip 加密的 libunity、libil2cpp 在转译层下正常加载。要注意
a2086fbc…);其他版本状态是 SKIPPED,照旧闪退,只留一条日志。sevl; wfe自旋变成忙等。WoA 主界面上没看到 CPU 被占满。Refs ModAVD/ModAVD#131
Refs ModAVD/ModAVD#130