satan53x / SExtractor

从GalGame脚本提取和导入文本
GNU General Public License v3.0
241 stars 15 forks source link

UIF字体替换求助 #31

Closed lightning32x closed 9 months ago

lightning32x commented 9 months ago

我在尝试HOOK Valkyria引擎的一个游戏时候发现字体无法通过font_manager - resource_files替换(配置如下所示)。 字体直接安装到系统则能够实现JIS汉字转简中。由于游戏不可能默认读取文泉驿,所以我认为spoof_creation部分应该是正常工作的。

{
  "injector": {
    "enable": true,
    "print_loaded_modules": false
  },
  "allocate_console": true,
  "font_manager": {
    "enable": true,
    "resource_files": [
      "./fonts/WenQuanYi_CNJP.ttf"
    ],
    "spoof_enumeration": {
      "enable": false,
      "filter_pitch_and_family": 0,
      "filter_charset": 0,
      "spoof_charset": 128
    },
    "spoof_creation": {
      "enable": true,
      "override_face": "WenQuanYi Micro Hei",
      "override_charset": 128
    }
  },
  "locale_emulator": {
    "enable": true,
    "codepage": 932,
    "locale": 1041,
    "charset": 128,
    "timezone": "Tokyo Standard Time",
    "wait_for_exit": false
  }
}

请问能提供一些建议吗,以下是启动时的console:

[injector] ======================================================
[injector] Injecting into module VAL-0042.exe at address 00F80000
[injector] Loading original library from C:\Windows\system32\winmm.dll
[font_manager] Imported 2 font(s) from ./fonts/WenQuanYi_CNJP.ttf
[font_manager] Unable to hook import CreateFontA because it does not exist
[font_manager] Unable to hook import CreateFontW because it does not exist
[font_manager] Hooking import CreateFontIndirectA in VAL-0042.exe at 0103706C --> 57F768C0
[font_manager] Unable to hook import CreateFontIndirectW because it does not exist
[font_manager] Unable to hook import CreateFontIndirectExA because it does not exist
[font_manager] Unable to hook import CreateFontIndirectExW because it does not exist
[locale_emulator] Codepage 932 matches expectation
[injector] Initialization complete
[injector] ======================================================

游戏的exe文件,需要的话可以传游戏本体: 链接:https://pan.quark.cn/s/88a5e60ade76 提取码:NRmt 解压密码:test

satan53x commented 9 months ago

font_manager加载字体这个实现上是直接调用的系统函数AddFontResourceExA,确实是可能出现有些游戏不生效的情况,不是dll本身问题,和游戏读取字体的方式和时机有关。

satan53x commented 9 months ago

直接character_substitution也不行的话确实只有安装字体了。 或者是使用其他工具加载字体,毕竟只是加载字体(修改字体名调用还是继续用uif),这种工具还是挺通用的不止一个,当然我没搜过你可以试试。

lightning32x commented 9 months ago

尝试了Enigma Virtual Box,封装了字体和系统安装字体的注册表信息,可以正常显示了

lightning32x commented 9 months ago

又试了下,好像还是不行,只能安装字体了