Artikash / Textractor

Extracts text from video games and visual novels. Highly extensible.
GNU General Public License v3.0
2.09k stars 203 forks source link

Buggy Hooking for SubaHibiHD (Engine: BGI) #6

Closed ohtalkoo closed 6 years ago

ohtalkoo commented 6 years ago

Hi there,

Thanks so much for taking up the mantle of writing a new text hooker. This project is invaluable.

You might be aware that a full voice, HD release of Subarashiki Hibi (https://vndb.org/v3144) came out a few days go (This release: https://vndb.org/r56597). The engine is BGI, which I think is supposed to be pretty common, but it seems like its been updated, because its not hooking properly.

I'm currently running Windows 10 64-bit at latest updates. I've installed SubaHibiHD's release day patch, as well.

Upon launching the game, the menu bar displays the following engine information:

Ethornell - BURIKO General Interpreter ( Version : 1.647 - Compatibility : 1.72 )

Here's how hooking the game looks, side by side with how NextHooker hooks it:

https://i.imgur.com/naTzP6W.jpg https://i.imgur.com/PZcI9kF.jpg https://i.imgur.com/VUFF8Hd.jpg

These are actually just the first few lines of the game. Also, it looks like ITH and ITHVNR handle it about the same as NextHooker.

Here's what the output from the console is:

NextHooker beta v1.0.3 (07/16/2018) Copyright (C) 2010-2012 kaosu (qiupf2000@gmail.com) Copyright (C) 2015 Stomp (zorkzero@hotmail.com) Copyright (C) 2016-2017 mireado (mireado@daum.net) Copyright (C) 2018 Artikash (akashmozumdar@gmail.com) Source code available at github.com/Artikash/NextHooker (GPLv3 License) Type ":h" or ":help" for help. vnreng: hijack process vnrcli:WaitForPipe: pipe connected enter vnrcli:NewHook: try inserting hook: GetTextExtentPoint32A vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetTextExtentExPointA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetTabbedTextExtentA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharacterPlacementA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetGlyphIndicesA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetGlyphOutlineA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: ExtTextOutA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: TextOutA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: TabbedTextOutA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharABCWidthsA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharABCWidthsFloatA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharWidth32A vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharWidthFloatA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetTextExtentPoint32W vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetTextExtentExPointW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetTabbedTextExtentW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharacterPlacementW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetGlyphIndicesW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetGlyphOutlineW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: ExtTextOutW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: TextOutW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: TabbedTextOutW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharABCWidthsW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharABCWidthsFloatW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharWidth32A vnrcli:RemoveHook: enter vnrcli:RemoveHook: leave vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GetCharWidthFloatA vnrcli:RemoveHook: enter vnrcli:RemoveHook: leave vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: DrawTextA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: DrawTextExA vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: DrawTextW vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: DrawTextExW vnrcli:NewHook: hook inserted leave vnreng:BGI2: pattern found but the function offset is invalid vnreng: INSERT BGI#2 vnrcli:NewHook: try inserting hook: BGI vnrcli:NewHook: hook inserted enter vnrcli:NewHook: try inserting hook: GdipAddPathString vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GdipDrawString vnrcli:NewHook: hook inserted vnrcli:NewHook: try inserting hook: GdipMeasureString vnrcli:NewHook: hook inserted leave

Thank you for all your hard work!

Artikash commented 6 years ago

I'll look into it. From the console output it looks like this shouldn't be too hard a fix

Artikash commented 6 years ago

Alright, I should be able to patch this in the next release, but that won't be for a while. Please use this hook code for now: /HS-20@3B452:BGI.exe

ohtalkoo commented 6 years ago

Thank you!

Artikash commented 6 years ago

v2.0.1 is now released with and fixes this, hopefully for good.