satan53x / SExtractor

从GalGame脚本提取和导入文本(大部分需要明文)
GNU General Public License v3.0
205 stars 14 forks source link

SE通过JIS生成了uif_config.json,但没有UIF的dll #55

Closed allrobot closed 5 months ago

allrobot commented 5 months ago

image

今天抽空看了下说明

https://github.com/satan53x/SExtractor/blob/552ce5dc254c6623d5b21b928486c48d90fa32fd/document/1_JIS%E6%9B%BF%E6%8D%A2%E5%AE%9E%E4%BE%8B_Alicesoft.MD?plain=1#L81-L82

就拉取git clone https://github.com/AtomCrafty/UniversalInjectorFramework 下来源码编译生成: image

我的操作步骤:

  1. SE勾选设置生成 Universallnjector 的 JIS 替换配置
  2. ctrl生成的uif_config.json移到游戏本体目录下
  3. 编译生成的dll文件移动游戏目录下
  4. tools\Font的字体WenQuanYi_msgothic.otf已安装
  5. uif_config.json的font_manager下enable为true
  6. 打开游戏,结果没有显示简体中文

是操作步骤少了哪些?个人是不太懂UIF相关的,C不是很了解

satan53x commented 5 months ago

https://github.com/satan53x/SExtractor/blob/552ce5dc254c6623d5b21b928486c48d90fa32fd/document/1_JIS%E6%9B%BF%E6%8D%A2%E5%AE%9E%E4%BE%8B_Alicesoft.MD?plain=1#L85-L89

还原方法是任选其一,不需要同时使用。 不过livemaker好像也是方法1无效。(uif_config里allocate_console设为true则有调试打印窗口) 方法2和3的前提都是需要游戏能调用系统字体,你得先确定游戏是否调用了游戏自带的ttf字体或者是图片字体。

allrobot commented 5 months ago

uif_config里allocate_console设为true则有调试打印窗口

{
  "injector": {
    "enable": true,
    "print_loaded_modules": true
  },
  "allocate_console": true,
  "tunnel_decoder": {
    "enable": false,
    "mapping": ""
  },
  "character_substitution": {
    "enable": true,
    "source_characters": "習蕩時凜鶇細間槇許邁進歩遙堯覚給這麼噴現観強勁開鹹還見樣場興們熱呑陰記髪靜奮実課過愛鞁務囲繞応齒備亜誡聖請賜鉤懐鯔嗚鰮僅種鼇讓義説類級渇鑚雖頂緊繃肭龜満醤麭軟膚弾鶺媽読絵終結東鶯黨質問較長軽挙錯誕淨邊謝嘗専為慮養減難対責鄰伝鬧話帯煩響護適厳評書貝瓏鳧変臓諧潤動順暢撃経綿純霧縮鼕圖館論別狢頭歓黴瑤設該験龍際臉処単親艶毎貴歴鏡驛濶脳鰤鰡櫓紅馬連頚継続認褻項渋堅車閲嫻張勢簡亀討厭優費試纏聞戯関齡紀賛偉納門夾題驚腸皺剛鷁執識線獲謎確異麗陽選調査騙頻凍証滅軍隊羅諾歳業監視擁賞鼡電運購買汚載",
    "target_characters": "习荡时你嘻细间吧许迈进步呢啊觉给这么喷现观强劲开嘿还见样场兴们热吞阴记发噗奋实课过爱舔务围绕应份备亚诫圣请赐够怀咦呜喔仅种厉让义说类级渴钻虽顶紧绷蘑吗满酱碰软肤弹嗯妈读绘终结东哎奶质问较长轻举错诞净边谢尝专为虑养减难对责另传闹话带烦响护适严评书贝珑谎变脏谐润动顺畅击经绵纯雾缩啦图馆论别诶头欢霉她设该验咙际脸处单亲艳每贵历镜烘肮脑哟咕噜红马连颈继续认亵项涩坚车阅娴张势简龟讨厌优费试缠闻戏关办纪赞伟纳门夹题惊肠皱刚裤执识线获谜确异丽阳选调查骗频冻证灭军队罗诺岁业监视拥赏您电运购买污载",
    "remain": [
      "�"
    ]
  },
  "font_manager": {
    "enable": true,
    "resource_files": [
      "WenQuanYi_msgothic.otf"
    ],
    "spoof_enumeration": {
      "enable": false,
      "filter_pitch_and_family": 0,
      "filter_charset": 1,
      "spoof_charset": 128
    },
    "spoof_creation": {
      "enable": false,
      "override_face": "WenQuanYi",
      "override_charset": 0
    }
  }
}

配置如上,没有弹出调试打印窗口,不知道咋调处窗口打印log……

写了脚本遍历lmar x game.exe -o game_files解压出来的所有lsb文件,执行lmlsb dump xx.lsb > xx.lsb.txt,查找font,找到这个: image

下载了MS Pゴシック字体文件然后修改,最后安装

游戏是输出字体了,只是字体一粗一细,应该是MS Pゴシック字体文件的字体大小不一致,但用FontCreator逐个修改太麻烦了……有什么更加方便的做法吗?

image

除了字体问题,游戏必须转区才能显示简中,有啥办法无需转区就能输出简中字体?我用olldbg看了下,没找到调用CreateFontIndiA函数附件有x80之类的

satan53x commented 5 months ago

不是非要下载MS Pゴシック字体进行修改,我那个WenQuanYi_msgothic就是文泉驿字体,然后改属性和gothic字体一样,假装是gothic字体。 FontCreator只需要改字体属性,字形不需要改动。

satan53x commented 5 months ago

没弹调试窗口说明dll可能没选对,uif有很多dll,你需要选exe会加载的同名dll。

allrobot commented 5 months ago

没弹调试窗口说明dll可能没选对,uif有很多dll,你需要选exe会加载的同名dll。

vs编译生成的就一个dll,能否提供多个dll下载链接呢?希望https://github.com/satan53x/SExtractor/tree/main/tools/Font 目录下新增uif的多个dll,方便下次直接下载调用,太懒不是很想打开编译器直接生成多个dll

satan53x commented 5 months ago

https://github.com/satan53x/SExtractor/tree/main/tools/UniversalInjectorFramework 一直就提供了啊,在旁边的文件夹,uif本身并不是只用于这个功能所以是单独文件夹。 你vs编译的时候可以选编译目标的,你只是没有选而已,菜单栏下边一行,默认的可能是d3d11所以你只编译了d3d11

allrobot commented 5 months ago

在旁边的文件夹,uif本身并不是只用于这个功能所以是单独文件夹。 你vs编译的时候可以选编译目标的,你只是没有选而已,菜单栏下边一行,默认的可能是d3d11所以你只编译了d3d11

不好意思,是我搞错了,不过,用你提供的winmm.dll能打开调试窗口了

https://github.com/satan53x/SExtractor/tree/main/tools/UniversalInjectorFramework 一直就提供了啊

font和UniversalInjectorFramework这类字体相关的,建议放在JIS替换文件夹吧。。。这个不太起眼没注意到

satan53x commented 5 months ago

除了字体问题,游戏必须转区才能显示简中,有啥办法无需转区就能输出简中字体?我用olldbg看了下,没找到调用CreateFontIndiA函数附件有x80之类的

转区和不转区有区别反而说明了没有80,因为80就是写死了指定日文编码,不转区也不影响。 所以create的charset参数应该是1或者0,也就是跟随系统。照常改成86就行。 (当然还有可能是调用GetSystemDefaultLangID之类的,这种情况比较少先不管)

allrobot commented 5 months ago

用你提供的winmm.dll能打开调试窗口了

但是游戏文本变成了这样: image 转区运行如图所示,无论转不转区也是乱码

所以create的charset参数应该是1或者0

我去调查一下,这方面不具备相关的知识基础

satan53x commented 5 months ago

但是游戏文本变成了这样: image 转区运行如图所示,不转区是乱码

这是字符集变成了gbk,可能是hook到了cratefont,你uif_config配置里font_manager下的spoof_creation和spoof_enumeration不要设置为true。(或者是指定override_charset为128)

allrobot commented 5 months ago

这是字符集变成了gbk,可能是hook到了cratefont,你uif_config配置里font_manager下的spoof_creation不要设置为true。(或者是指定override_charset为128)

出现乱码的时候,uif_config配置只有injector和font_manager的enable为true:

{
  "injector": {
    "enable": true,
    "print_loaded_modules": false
  },
  "allocate_console": false,
  "tunnel_decoder": {
    "enable": false,
    "mapping": ""
  },
  "character_substitution": {
    "enable": true,
    "source_characters": "習蕩時凜鶇細間槇許邁進歩遙堯覚給這麼噴現観強勁開鹹還見樣場興們熱呑陰記髪靜奮実課過愛鞁務囲繞応齒備亜誡聖請賜鉤懐鯔嗚鰮僅種鼇讓義説類級渇鑚雖頂緊繃肭龜満醤麭軟膚弾鶺媽読絵終結東鶯黨質問較長軽挙錯誕淨邊謝嘗専為慮養減難対責鄰伝鬧話帯煩響護適厳評書貝瓏鳧変臓諧潤動順暢撃経綿純霧縮鼕圖館論別狢頭歓黴瑤設該験龍際臉処単親艶毎貴歴鏡驛濶脳鰤鰡櫓紅馬連頚継続認褻項渋堅車閲嫻張勢簡亀討厭優費試纏聞戯関齡紀賛偉納門夾題驚腸皺剛鷁執識線獲謎確異麗陽選調査騙頻凍証滅軍隊羅諾歳業監視擁賞鼡電運購買汚載",
    "target_characters": "习荡时你嘻细间吧许迈进步呢啊觉给这么喷现观强劲开嘿还见样场兴们热吞阴记发噗奋实课过爱舔务围绕应份备亚诫圣请赐够怀咦呜喔仅种厉让义说类级渴钻虽顶紧绷蘑吗满酱碰软肤弹嗯妈读绘终结东哎奶质问较长轻举错诞净边谢尝专为虑养减难对责另传闹话带烦响护适严评书贝珑谎变脏谐润动顺畅击经绵纯雾缩啦图馆论别诶头欢霉她设该验咙际脸处单亲艳每贵历镜烘肮脑哟咕噜红马连颈继续认亵项涩坚车阅娴张势简龟讨厌优费试缠闻戏关办纪赞伟纳门夹题惊肠皱刚裤执识线获谜确异丽阳选调查骗频冻证灭军队罗诺岁业监视拥赏您电运购买污载",
    "remain": [
      "�"
    ]
  },
  "font_manager": {
    "enable": true,
    "resource_files": [
      "./font/WenQuanYi_msgothic.otf"
    ],
    "spoof_enumeration": {
      "enable": false,
      "filter_pitch_and_family": 0,
      "filter_charset": 1,
      "spoof_charset": 128
    },
    "spoof_creation": {
      "enable": false,
      "override_face": "WenQuanYi",
      "override_charset": 0
    }
  }
}
satan53x commented 5 months ago

那是改了exe吗? 上边我说错了,gbk才是改86,jis替换还是80。

allrobot commented 5 months ago

那是改了exe吗? 上边我说错了,gbk才是改86,jis替换还是80。

没改exe

satan53x commented 5 months ago

那只是加载了dll怎么会在转区的情况下变成gbk编码?

satan53x commented 5 months ago

而且allocate_console为false是没有调试窗口的吧。你调试窗口打印内容啥样的?

allrobot commented 5 months ago

而且allocate_console为false是没有调试窗口的吧。你调试窗口打印内容啥样的?

Universal Injector Framework, created by AtomCrafty, 2021
Loaded configuration:
{
    "allocate_console": true,
    "character_substitution": {
        "enable": true,
        "remain": [
            "�"
        ],
        "source_characters": "習蕩時凜鶇細間槇許邁進歩遙堯覚給這麼噴現観強勁開鹹還見樣場興們熱呑陰記髪靜奮実課過愛鞁務囲繞応齒備亜誡聖請賜鉤懐鯔嗚鰮僅種鼇讓義説類級渇鑚雖頂緊繃肭龜満醤麭軟膚弾鶺媽読絵終結東鶯黨質問較長軽挙錯誕淨邊謝嘗専為慮養減難対責鄰伝鬧話帯煩響護適厳評書貝瓏鳧変臓諧潤動順暢撃経綿純霧縮鼕圖館論別狢頭歓黴瑤設該験龍際臉処単親艶毎貴歴鏡驛濶脳鰤鰡櫓紅馬連頚継続認褻項渋堅車閲嫻張勢簡亀討厭優費試纏聞戯関齡紀賛偉納門夾題驚腸皺剛鷁執識線獲謎確異麗陽選調査騙頻凍証滅軍隊羅諾歳業監視擁賞鼡電運購買汚載",
        "target_characters": "习荡时你嘻细间吧许迈进步呢啊觉给这么喷现观强劲开嘿还见样场兴们热吞阴记发噗奋实课过爱舔务围绕应份备亚诫圣请赐够怀咦呜喔仅种厉让义说类级渴钻虽顶紧绷蘑吗满酱碰软肤弹嗯妈读绘终结东哎奶质问较长轻举错诞净边谢尝专为虑养减难对责另传闹话带烦响护适严评书贝珑谎变脏谐润动顺畅击经绵纯雾缩啦图馆论别诶头欢霉她设该验咙际脸处单亲艳每贵历镜烘肮脑哟咕噜红马连颈继续认亵项涩坚车阅娴张势简龟讨厌优费试缠闻戏关办纪赞伟纳门夹题惊肠皱刚裤执识线获谜确异丽阳选调查骗频冻证灭军队罗诺岁业监视拥赏您电运购买污载"
    },
    "font_manager": {
        "enable": true,
        "resource_files": [
            "./font/WenQuanYi_msgothic.otf"
        ],
        "spoof_creation": {
            "enable": false,
            "override_charset": 0,
            "override_face": "WenQuanYi"
        },
        "spoof_enumeration": {
            "enable": false,
            "filter_charset": 1,
            "filter_pitch_and_family": 0,
            "spoof_charset": 128
        }
    },
    "injector": {
        "enable": true,
        "print_loaded_modules": false
    },
    "tunnel_decoder": {
        "enable": true,
        "mapping": ""
    }
}
[injector] ======================================================
[injector] Injecting into module Stopping2.exe at address 00010000
[injector] Loading original library from C:\WINDOWS\system32\winmm.dll
[character_substitution] Loaded 242 substitution characters
[character_substitution] Unable to enumerate import address table
[character_substitution] This likely means the module had some sort of tamper protection applied to it
[character_substitution] Unable to hook import TextOutA because it does not exist
[character_substitution] Unable to enumerate import address table
[character_substitution] This likely means the module had some sort of tamper protection applied to it
[character_substitution] Unable to hook import TextOutW because it does not exist
[character_substitution] Unable to enumerate import address table
[character_substitution] This likely means the module had some sort of tamper protection applied to it
[character_substitution] Unable to hook import GetGlyphOutlineA because it does not exist
[character_substitution] Unable to enumerate import address table
[character_substitution] This likely means the module had some sort of tamper protection applied to it
[character_substitution] Unable to hook import GetGlyphOutlineW because it does not exist
[tunnel_decoder] Loaded 0 mapping characters
[tunnel_decoder] Unable to enumerate import address table
[tunnel_decoder] This likely means the module had some sort of tamper protection applied to it
[tunnel_decoder] Unable to hook import TextOutA because it does not exist
[tunnel_decoder] Unable to enumerate import address table
[tunnel_decoder] This likely means the module had some sort of tamper protection applied to it
[tunnel_decoder] Unable to hook import MultiByteToWideChar because it does not exist
[tunnel_decoder] Unable to enumerate import address table
[tunnel_decoder] This likely means the module had some sort of tamper protection applied to it
[tunnel_decoder] Unable to hook import GetTextExtentPoint32A because it does not exist
[tunnel_decoder] Unable to enumerate import address table
[tunnel_decoder] This likely means the module had some sort of tamper protection applied to it
[tunnel_decoder] Unable to hook import IsDBCSLeadByteEx because it does not exist
[tunnel_decoder] Unable to enumerate import address table
[tunnel_decoder] This likely means the module had some sort of tamper protection applied to it
[tunnel_decoder] Unable to hook import IsDBCSLeadByte because it does not exist
[font_manager] Imported 2 font(s) from ./font/WenQuanYi_msgothic.otf
[injector] Initialization complete
[injector] ======================================================
satan53x commented 5 months ago

tunnel_decoder和character_substitution也关掉呢,用了字体就不需要hook替换了

allrobot commented 5 months ago

image

tunnel_decoder和character_substitution也关掉呢,用了字体就不需要hook替换了

Universal Injector Framework, created by AtomCrafty, 2021
Loaded configuration:
{
    "allocate_console": true,
    "character_substitution": {
        "enable": false,
        "remain": [
            "�"
        ],
        "source_characters": "習蕩時凜鶇細間槇許邁進歩遙堯覚給這麼噴現観強勁開鹹還見樣場興們熱呑陰記髪靜奮実課過愛鞁務囲繞応齒備亜誡聖請賜鉤懐鯔嗚鰮僅種鼇讓義説類級渇鑚雖頂緊繃肭龜満醤麭軟膚弾鶺媽読絵終結東鶯黨質問較長軽挙錯誕淨邊謝嘗専為慮養減難対責鄰伝鬧話帯煩響護適厳評書貝瓏鳧変臓諧潤動順暢撃経綿純霧縮鼕圖館論別狢頭歓黴瑤設該験龍際臉処単親艶毎貴歴鏡驛濶脳鰤鰡櫓紅馬連頚継続認褻項渋堅車閲嫻張勢簡亀討厭優費試纏聞戯関齡紀賛偉納門夾題驚腸皺剛鷁執識線獲謎確異麗陽選調査騙頻凍証滅軍隊羅諾歳業監視擁賞鼡電運購買汚載",
        "target_characters": "习荡时你嘻细间吧许迈进步呢啊觉给这么喷现观强劲开嘿还见样场兴们热吞阴记发噗奋实课过爱舔务围绕应份备亚诫圣请赐够怀咦呜喔仅种厉让义说类级渴钻虽顶紧绷蘑吗满酱碰软肤弹嗯妈读绘终结东哎奶质问较长轻举错诞净边谢尝专为虑养减难对责另传闹话带烦响护适严评书贝珑谎变脏谐润动顺畅击经绵纯雾缩啦图馆论别诶头欢霉她设该验咙际脸处单亲艳每贵历镜烘肮脑哟咕噜红马连颈继续认亵项涩坚车阅娴张势简龟讨厌优费试缠闻戏关办纪赞伟纳门夹题惊肠皱刚裤执识线获谜确异丽阳选调查骗频冻证灭军队罗诺岁业监视拥赏您电运购买污载"
    },
    "font_manager": {
        "enable": true,
        "resource_files": [
            "./font/WenQuanYi_msgothic.otf"
        ],
        "spoof_creation": {
            "enable": false,
            "override_charset": 0,
            "override_face": "WenQuanYi"
        },
        "spoof_enumeration": {
            "enable": false,
            "filter_charset": 1,
            "filter_pitch_and_family": 0,
            "spoof_charset": 128
        }
    },
    "injector": {
        "enable": true,
        "print_loaded_modules": false
    },
    "tunnel_decoder": {
        "enable": false,
        "mapping": ""
    }
}
[injector] ======================================================
[injector] Injecting into module Stopping2.exe at address 00010000
[injector] Loading original library from C:\WINDOWS\system32\winmm.dll
[font_manager] Imported 2 font(s) from ./font/WenQuanYi_msgothic.otf
[injector] Initialization complete
[injector] ======================================================

转不转区都是乱码

satan53x commented 5 months ago

injector的enable也设置成false了就正常了吗?就是dll不进行注入。 还是说要删掉dll不进行加载。

allrobot commented 5 months ago

injector的enable也设置成false了就正常了吗?就是dll不进行注入。 还是说要删掉dll不进行加载。

设置false变回原来的日文字符了

看来只能用字体更换的办法了😂

satan53x commented 5 months ago

这就奇怪了,dll不开模块都会影响区域?

{
  "injector": {
    "enable": true,
    "print_loaded_modules": false
  },
  "allocate_console": true,
  "font_manager": {
    "enable": true,
    "resource_files": [ "WenQuanYi_msgothic.otf" ],
    "spoof_creation": {
      "enable": true,
      "override_face": "MS ゴシック",
      "override_charset": 128
    }
  }
}

这样呢?(resource_files改成你的那个路径) Edit: 打错了,font_manager需要设置成true.

allrobot commented 5 months ago

这样呢?(resource_files改成你的那个路径) Edit: 打错了,font_manager需要设置成true.

Universal Injector Framework, created by AtomCrafty, 2021
Loaded configuration:
{
"allocate_console": true,
"font_manager": {
"enable": true,
"resource_files": [
"./font/WenQuanYi_msgothic.otf"
],
"spoof_creation": {
"enable": true,
"override_charset": 128,
"override_face": "MS ゴシック"
}
},
"injector": {
"enable": true,
"print_loaded_modules": false
}
}
[injector] ======================================================
[injector] Injecting into module Stopping2.exe at address 00010000
[injector] Loading original library from C:\WINDOWS\system32\winmm.dll
[font_manager] Imported 2 font(s) from ./font/WenQuanYi_msgothic.otf
[font_manager] Unable to enumerate import address table
[font_manager] This likely means the module had some sort of tamper protection applied to it
[font_manager] Unable to hook import CreateFontA because it does not exist
[font_manager] Unable to enumerate import address table
[font_manager] This likely means the module had some sort of tamper protection applied to it
[font_manager] Unable to hook import CreateFontW because it does not exist
[font_manager] Unable to enumerate import address table
[font_manager] This likely means the module had some sort of tamper protection applied to it
[font_manager] Unable to hook import CreateFontIndirectA because it does not exist
[font_manager] Unable to enumerate import address table
[font_manager] This likely means the module had some sort of tamper protection applied to it
[font_manager] Unable to hook import CreateFontIndirectW because it does not exist
[font_manager] Unable to enumerate import address table
[font_manager] This likely means the module had some sort of tamper protection applied to it
[font_manager] Unable to hook import CreateFontIndirectExA because it does not exist
[font_manager] Unable to enumerate import address table
[font_manager] This likely means the module had some sort of tamper protection applied to it
[font_manager] Unable to hook import CreateFontIndirectExW because it does not exist
[injector] Initialization complete
[injector] ======================================================

游戏调用的MS PゴシックMS ゴシック无论改不改MS Pゴシック都是乱码

satan53x commented 5 months ago

字体名是另一回事,现在问题是加载了dll字符集使用的是GBK。 那确实还是不用dll了,可能UIF影响了区域?不确定。