Announcement

Collapse

Please use the Hentai ID thread for all hentai ID requests. Click me for link!

The Identification Thread is Here:

http://www.hongfire.com/forum/showthread.php/447081
See more
See less

AGTH - text extraction tool for games translation

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • AGTH - text extraction tool for games translation

    Current AGTH version: 2011.5.9

    Before asking something make sure you've read this first post, guides and searched in this thread.


    Related links

    AGTH home site: http://sites.google.com/site/agthook/

    Guide by mastress: http://blgames.proboards25.com/index...ead=1141106731

    Screenshot guide by fhc: http://www.hongfire.com/forum/showthread.php?t=59189

    Advanced AGTH Video Tutorials by Freaka: http://www.hongfire.com/forum/showthread.php?t=80401

    Itadaki (external toolset for adding furigana (reading) to kanji): http://www.hongfire.com/forum/showthread.php?t=75958

    Translation Aggregator (tool for querying many translation engines): http://www.hongfire.com/forum/showthread.php?t=94395



    AGTH general information

    AGTH is a tool for capturing text from running programs. Main purpose - extracting text from japanese games for translation.

    AGTH requires Windows 2000 or newer NT-based system, x64 and server variants are also supported. Recommended operation system - Windows 2003 and newer (yes, some features won't work on XP). With Vista/Win7 you would likely want to run AGTH with elevated rights or disable UAC.


    Running program under AGTH

    AGTH consists of hook module agth.dll and loader agth.exe.
    To load application - pass its name to agth.exe as command line argument.

    Example for running from shortcut:
    1) Create shortcut for game.
    2) Open properties of created shortcut. In "Target" field will be something like
    Code:
    "C:\Games\Maou no Musume-tachi\twins.exe"
    3) Append to the start of "Target" field full path to where you extracted AGTH, so it will be like
    Code:
    "C:\AGTH\agth.exe" "C:\Games\Maou no Musume-tachi\twins.exe"
    4) Make sure that "Start in" filed hasn't changed after you changed the "Target" and there is space between AGTH and game exe paths.
    5) Run game from this shortcut.


    Before name of game exe you can specify some options for AGTH. Each option must be separated by spaces from both sides.

    Example of running the same game but also automaticaly copy captured text to clipboard:
    Code:
    "C:\AGTH\agth.exe" /C "C:\Games\Maou no Musume-tachi\twins.exe"

    Working with loaded AGTH

    After load AGTH will create its window, where it will show captured text.

    AGTH separetes text into several 'text threads' based on 'context' (to avoid mess from mixing text of game, menu, title...).
    Displayed text thread could be chosen by drop-down list in the upper part of AGTH window. As game runs, new text threads could be found and added to list.

    If you close AGTH window it will not detach it's hook from the running applications, so if AGTH is started again it will continue to hook the text, hook options will be unchaged too.


    Additional features

    AGTH can try to correct locale of programs - useful for running japanese games with system locale set to non-japanese.

    /R option tries to correct locale the AGTH-way - minor visual glitches are possible, but overall program should run like started on system with specified locale.
    /L option works exactly as running program under AppLocale (also this option requires installed AppLocale).

    Both options can be used together.

    AGTH can be used just for fixing locale without any text hooking.
    Example of starting QuickATLAS with locale overriden to japanese (useful in case when you see only '?????' in it instead of characters):
    Code:
    C:\AGTH\agth.exe /L /NH "C:\Program Files\Atlas\QuickATLAS.exe"
    If you can't find useful text - try options /X3 and/or /V with loading by /P

    Recent changes

    2011.5.9
    • Added new type of user hook: Code.
    • Hardware hooks now also work on 32-bit XP SP3.
    • Improved /R override, now it should be able to run InnoSetup installers.
    • Added symbol '◇' to default filtering.
    • Removed user hook type: Hex.

    2011.4.21
    • Added support for LiveMaker engine.
    • Added support for IronGameSystem engine.
    • Updated KiriKiri support.
    • Updated RealLive support.

    2011.4.18
    • ASLR support, can be disabled with ':' at the end of user hook.
    • Improved /R override, just /R performs more aggressive process 'japanization' than /R411
    • Updated RealLive support.

    2011.4.16
    • Locale override support for Win7 (/R option).
    • Internal threading optimizations.
    Attached Files
    Last edited by Setx; 05-09-2011, 04:42 AM.

  • danj2k
    The only definite method I know is debugger.
    Multiples of 2 is possible but unlikely.

    mastress
    I still haven't updated list with games compatible with /H

    Tairun
    Read the thread.

    Comment


    • Originally posted by Setx
      danj2k
      The only definite method I know is debugger.
      Multiples of 2 is possible but unlikely.
      Hmm... unfortunately, debuggers are somewhat beyond my experience. I do have a friend who is a programmer who might be able to help. What would I need to tell him to look for?

      Comment


      • danj2k
        You can ask him to set breakpoint to one instruction below the address that AGTH displays and look in stack/registers for symbols of game text. You need stack offset or register name.

        Comment


        • Originally posted by Setx
          danj2k
          You can ask him to set breakpoint to one instruction below the address that AGTH displays and look in stack/registers for symbols of game text. You need stack offset or register name.
          OK, well, I talked to him about it, unfortunately he wasn't able to help me directly himself, but he did point me towards a freeware debugger called OllyDbg. After a bunch of messing around I discovered that the data contained in the stack location at data_offset + contents of EBP register + 4 seems to be the same character code that was passed to GetGlyphOutlineW. It seems that in the case of Fate/hollow ataraxia, it is the sub_offset that isn't right, since a data_offset of B4 also gives the above results most of the time with the debugger attached to hollow ataraxia. However, I'm unable to guess at how to work out the sub_offset. Also, sometimes when the value of EBP changes, the stack location containing the character code is further away than would be expected for a data_offset of B4. Here are some screenshots of the debugger to show what I mean:

          img300.imageshack.us/img300/7103/normalebpvalue4ww.png
          0x0013E484 - 0x0013E3CC = B8

          but

          img300.imageshack.us/img300/1394/changedebpvalue8jm.png
          0x0013E484 - 0x0013E37C = 108

          (imageshack seems to prevent linking images from hongfire so you may need to copy and paste the URL into your browser)

          Comment


          • Hi guys, when you use AGTH together with quick ATLAS, are you able to translate the language from jap to eng or even chinese words?

            I looked through this thread but can't seem to see anyone disseminating this information.

            Comment


            • Originally posted by tutor
              Hi guys, when you use AGTH together with quick ATLAS, are you able to translate the language from jap to eng or even chinese words?

              I looked through this thread but can't seem to see anyone disseminating this information.
              ATLAS only translates from Japanese to English. If you want to translate to Chinese you will need to use a different software program, or find a website that can do it. Whatever program you use, it needs to be able to automatically translate text that's placed on the clipboard.

              Comment


              • Ok, then this ATLAS is it the one that is ard 330 MB?

                Are there many types of ATLAS or just one which is aka Quick ATLAS?

                Comment


                • AGTH update

                  1) Auto turning off ScrollLock on start when it used to set user hook.

                  2) Hotkey Ctrl-C to copy text to clipboard.

                  3) Auto copy text to clipboard on selection by mouse.


                  danj2k
                  1) You set breakpoint to the wrong place. It should be set to one instruction below the address that AGTH displys, not on call to GetGlyphOutline.
                  2) Offsets that AGTH use is relative to ESP register, not EBP.
                  3) 'sub_offset' does NOT affect capturing text. It simply gives hint to AGTH how to split captured text to text threads.

                  Comment


                  • Originally posted by Setx
                    danj2k
                    1) You set breakpoint to the wrong place. It should be set to one instruction below the address that AGTH displys, not on call to GetGlyphOutline.
                    2) Offsets that AGTH use is relative to ESP register, not EBP.
                    3) 'sub_offset' does NOT affect capturing text. It simply gives hint to AGTH how to split captured text to text threads.
                    One instruction below the address that AGTH displays for UserHookW?

                    Comment


                    • danj2k
                      Yes.

                      Comment


                      • OK, well, I've set the breakpoints correctly this time (they are all calls to the same function, FateFD.00528648) but it still seems like they are being triggered several times per line.

                        EDIT2: I had guessed that this means I'd need to increase the levels parameter in AGTH, then note down the UserHookW addresses and try again with those, but this doesn't seem to work; I don't seem to get any UserHookW threads with levels = 2.

                        EDIT: Anyway, this function FateFD.00528648 seems to be getting called 4 times per character. After some searching I've discovered that the character code lies at stack location 0x0013E484 which is 0xB0 away from the stack pointer ESP 0x0013E3D4.

                        EDIT3: When the game is printing furigana, the stack pointer ESP is 0x0013DE6C and the character code is at 0x0013DF6C, which is 0x100 away.

                        EDIT4: I've now tried the same methods with Fate/stay night (where the settings are known) and it appears that neither the stack pointer ESP nor the offset to the character code's location get changed, even when the game is printing furigana. Also, the corresponding function in Fate/stay night only gets called twice per character rather than 4 times.
                        Last edited by danj2k; 04-04-2006, 11:24 AM.

                        Comment


                        • Originally posted by LemonRuMBler
                          Okay I FINALLY got Lilith-soft games user hooked! Just took much trial and error!

                          NOW BIG PROBLEM!!!!

                          I have a NEW game "sorta" hooked with a User Hook - however its spitting out text that cannot be read. (IT SHOULD however be meantioned that its still spitting out Japanese "fonts" just not usable ones....)

                          So its spitting out for example: cccccccccccccccccccccccccccccccccc

                          In the place where usually game fonts appear.

                          This "text" ONLY appears in user hook, the rest of agth display's japanese characters fine.
                          I HAVE tried changing the games "font" setting, but all that does is change the ...... to some other letter repeated (ie ffffffff).

                          Anybody have any idea how to fix THIS problem???

                          The game btw is:
                          http://www.getchu.com/soft.phtml?id=224365
                          Well, now that I know a little bit more about the operation of AGTH, I would guess that the problem is that the data_offset value is wrong. As you can see from the above few posts between me and Setx, there is another method than trial-and-error for determining the data_offset value, but it involves using a debugger, and you also need to have gotten some of the text out of the game already, either by having AGTH partially working (e.g. if some other thread has the correct game text but with some problem like the pyramid problem, you can copy it out and fix it up manually using notepad) or by extracting the script files from the game's data, so that you can determine the Unicode character codes to search for in the debugger. You should probably try trial-and-error first, since it will be relatively quick in comparison.

                          Also I would suggest that when you get a game working with AGTH, it might be a good idea to post the settings you used and the results that you got in this thread.

                          Comment


                          • Originally posted by danj2k
                            Also I would suggest that when you get a game working with AGTH, it might be a good idea to post the settings you used and the results that you got in this thread.


                            Actually the setting that finally got Lilith-soft games working is taken right out of the example first posted when the userhook was introduced!

                            Start agth.exe /HWB4#1 SKI_dl.exe

                            as u can see the hook is the same used for Fate - it seems that you MUST not only specify the value W but #1 or the userhook will not appear in ANY GAME.

                            Anyway that above hook will work for any lilith-soft game - just make sure you use the scroll lock!
                            Last edited by SatinCreamDelight; 04-14-2006, 02:02 AM.
                            "Its done when its done."
                            - Blizzard Entertainment

                            Comment


                            • Can it be only Atlas v11 or later version alos like Atlas v12......... i downloaded the trial version of atlas v12 and i canuse it withagth but the transaltion in atlas seems jumple up...i cant understand what the heck the atlas translation like for example this

                              な、何よ・・・急にどうしちゃったの??さやかの声

                              to

                              What.. ..becoming it.. ..,.. goodness ・・・ How have you done? It is vocal of clearness. suddenly


                              and

                              うん、それだけよ。どう?? やる気出た??さやかの声

                              to

                              Yes, only it :. Voice of clearness ..motivation ..how.... ..putting out..


                              Oh and the game is pia carrot 3
                              Last edited by madcat2020; 04-06-2006, 08:41 PM.
                              http://www.uploadhouse.com/fileuploads/194/19486707c16f488dca19d5d4359f640de49b12.jpg
                              H!P All Star : All for one & One for all
                              http://www.uploadhouse.com/fileuploads/194/194873857195363d4beaf54f4a801e37ce25ff.jpg
                              Tanaka Reina Fanboyisim
                              IMG tags removed.

                              Comment


                              • Hey question for you guys. I got AGTH to run fine and working on 'Pia Carrot 3', but it's not translating anything, just reposting the original Kana. Now I'm sure I'm not doing something REALLY simple to fix this but after reading through the thread I haven't figured out what. Any advice helps.

                                PS: If it's something REALLY REALLY simple and I'm just an idiot feel free to beat me with a Baseball bat or something.
                                (\ /) Post this bunny
                                (0.o) in your signature
                                (><) and help it recive
                                /_l_\ world domination (I really need a new sig...)

                                Comment

                                Working...
                                X