CelestialCosmic / themeblog

blog articles by Celestial_Cosmic,source code by chanshiyucx
0 stars 0 forks source link

记两个使用 unity 引擎的游戏的存档修改 #43

Open CelestialCosmic opened 1 year ago

CelestialCosmic commented 1 year ago

其一

unity 游戏一般把存档存在%user%/appdata/locallow/游戏公司名/游戏名%user%/appdata/locallow/游戏名里面。

去翻,只有日志

那么还有两个可能:存在游戏文件夹内或者存在注册表里面

首先排除游戏文件夹,打开 regedit 找主程序的名字

检索了七八个,确实有一些东西,不过主要还是 unity 的参数,最令我关注的是一个关键字带着 collection 的东西:Collection_h3772761619

30 2c 31 2c 31 36 2c 32 00 

对应的字符串是0,1,2,16,2.

我自己很久以前打过那么十几分钟,曾经内部确实解锁了一些东西

尝试修改 hex,不论怎么改,游戏程序运行都不正常

尝试按照格式,添加了一个 5, 成了

剩下的就是填满全部了

Windows Registry Editor Version 5.00
[HKEY_USERS\S-1-5-21-4010178400-3647165720-3864349211-1000\Software\scoz\ExplosionGirl]
"Collection_h3772761619"=hex:30,2c,31,2c,32,2c,33,2c,34,2c,35,2c,36,2c,37,2c,38,2c,39,2c,31,30,2c,31,31,2c,31,32,2c,31,33,2c,31,34,2c,31,35,2c,31,36,2c,31,37,2c,31,38,2c,31,39,2c,32,30,2c,32,31,2c,32,32,2c,32,33,2c,32,34,2c,32,35,2c,32,36,2c,32,37,2c,32,38,2c,32,39,2c,33,30,2c,33,31,2c,33,32,2c,32,00

其二

其存储文件拓展名是 .sav,vscode 打开一眼能看出来是 json 的格式

但是没有亲手打过,并不知道到底会发生什么

{\"StageName_01\":{\"sequenceState\":0,\"getSilverCrystal\":false,\"bestClearTime\":-1,\"dictionary\":null},
\"costumeChange\":{\"sequenceState\":0,\"getSilverCrystal\":false,\"bestClearTime\":-1,\"dictionary\":null},
\"StageName_02\":{\"sequenceState\":0,\"getSilverCrystal\":false,\"bestClearTime\":-1,\"dictionary\":null},
\"StageName_03\":{\"sequenceState\":0,\"getSilverCrystal\":false,\"bestClearTime\":-1,\"dictionary\":null},
\"StageName_04\":{\"sequenceState\":0,\"getSilverCrystal\":false,\"bestClearTime\":-1,\"dictionary\":null},
\"StageName_05\":{\"sequenceState\":0,\"getSilverCrystal\":false,\"bestClearTime\":-1,\"dictionary\":null},
\"StageName_06\":{\"sequenceState\":0,\"getSilverCrystal\":false,\"bestClearTime\":-1,\"dictionary\":null},
\"StageName_07\":......

首先先把通关标志的 false 改成 true,把 sequenceState 改成 1,启动后发现关卡解锁了,但是并没有大用

亲手打通了 stage5,并且随之解锁了两个 event 和数个 achievement。回头一看有变化了:

{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"costumeChange\":
{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"StageName_02\":
{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"StageName_03\":
{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"StageName_04\":
{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"StageName_05\":
{\"sequenceState\":3,\"getSilverCrystal\":true,\"bestClearTime\":673.0333,\"dictionary\":null},\"StageName_06\":
{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"StageName_07\":
{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"StageName_08\":
{\"sequenceState\":1,\"getSilverCrystal\":true,\"bestClearTime\":-1.0,\"dictionary\":null},\"StageName_09\":

很明显,stage5 在打完以后发生了变化

还新增加了这些部分(手动格式化过以方便阅读):

"advSceneOpenDictionary\":{
\"album_title\":true,\"album_title : still_title_ricca_001\":true,
\"album_fairyTaleBook_001\":true,
\"album_fairyTaleBook_001 : 
still_fairyTaleBook_001\":true,
\"album_fairyTaleBook_002\":true,
\"album_fairyTaleBook_002 : still_fairyTaleBook_002\":true,
\"SceneANV_MiriaVillageMerchant\":true},
\"achievementDictionary\":
{\"launch\":true,
\"defeatEnemy_1\":true,
\"continue\":true,
\"defeatEnemy_10\":true,
\"defeatEnemy_50\":true,
\"comboHit_10\":true,
\"defeatFirstBossEnemy\":true,
\"comboHit_25\":true,
\"StageName_Ex04_Clear\":true,
\"defeatEnemy_100\":true,
\"callFairy\":true,
\"breakDrainCrystal\":true,
\"StageName_05_SilverCrystal\":true},
\"stageDictionary\":{
\"StageName_Ex04\":{
\"cleared\":true,
\"bestClearTime\":125.61111450195313},
\"StageName_05\":{
\"cleared\":true,
\"bestClearTime\":673.0333251953125}}
......

简单来说,游戏记录了这些事件,并把它们通过形如"":...的方式,写进文件里面

这时有两条路可以走:找出这些事件的代码,然后加进去。或者修改sequenceState看看效果

前者需要拆包,先尝试后者。

sequenceState 都改成 3 以后,启动游戏确实显示成功了通关,但是事件没有解锁,依旧以一排问号的形式出现

随手在游戏内点击了一下事件,突然弹出“是否要解锁该事件?这将让该事件在所有存档中都可见”

那没事了

之后还是尝试了一下

打开 assetstudio, 把最大的资源文件拖进去,有 50 多万个结果,全都是 3d 模型

搜索已知事件,没有结果

打开储存文本的文件夹,注意到一些 .dat 文件,无法解析十六进制也看不出名堂,但是文件名和事件是对应的,可以获得游戏内的部分事件

之后的尝试就大多无意义了

至于游戏内货币的事情......ce 操作几下的事情,虽然 unity 每次地址都一定不一样,一次弄够这辈子都用不完的量不就成了