修改流程:
1、用Il2CppDumper.exe打开游戏目录的 GameAssembly.dll 和 global-metadata.dat
2、用其他文本编辑器打开dump.cs,不要用windows的记事本打开(会卡死)
3、搜索 GamePermanentData get_Get() 和 AchievementsMonitor get_Get()
4、替换脚本地址
5、执行脚本
Il2CppDumper下载地址:https://github.com/Perfare/Il2CppDumper/releases/download/v6.7.46/Il2CppDumper-win-v6.7.46.zip 或者网上自行搜索下载
###################
CE脚本:
[ENABLE]
// ========== 请根据游戏版本修改以下偏移 ==========
define(GamePermanentData_get_Get, GameAssembly.dll+A1)
define(GamePermanentData_UnlockAll, GameAssembly.dll+A2)
define(AchievementsMonitor_get_Get, GameAssembly.dll+A3)
define(AchievementsMonitor_UnlockAll, GameAssembly.dll+A4)
// =============================================
aobscanmodule(INJECT,GameAssembly.dll,32 48 8B 05 * * * * F3 0F 10 71 20) // should be unique
alloc(newmem,$1000,INJECT)
alloc(unlockFlag,4) // 一次性标志
registersymbol(unlockFlag)
label(code)
label(return)
label(skip_all)
label(try_next)
label(done)
newmem:
cmp dword ptr [unlockFlag], 1
je skip_all // 已经解锁过,跳过
mov dword ptr [unlockFlag], 1 // 立即标记为已解锁,防止递归
push rax
push rcx
push rdx
push r8
push r9
push r10
push r11
sub rsp, 0x28 // 影子空间,保持栈对齐
// ---- 调用 GamePermanentData.UnlockAll ----
xor ecx, ecx
call GamePermanentData_get_Get // GamePermanentData.get_Get()
test rax, rax
je try_next
mov rcx, rax
xor edx, edx
call GamePermanentData_UnlockAll // GamePermanentData.UnlockAll()
try_next:
// ---- 调用 AchievementsMonitor.UnlockAll ----
xor ecx, ecx
call AchievementsMonitor_get_Get // AchievementsMonitor.get_Get()
test rax, rax
je done
mov rcx, rax
xor edx, edx
call AchievementsMonitor_UnlockAll // AchievementsMonitor.UnlockAll()
done:
add rsp, 0x28
pop r11
pop r10
pop r9
pop r8
pop rdx
pop rcx
pop rax
skip_all:
code:
movss xmm6,[rcx+20] // 原始指令
jmp return
INJECT+08:
jmp newmem
return:
registersymbol(INJECT)
[DISABLE]
INJECT+08:
db F3 0F 10 71 20
unregistersymbol(INJECT)
unregistersymbol(unlockFlag)
dealloc(newmem)
dealloc(unlockFlag)