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.

  • Originally posted by Freaka View Post
    I wouldn't use a name - especially not a custom name - to search for text strings. A program might do all sorts of strange things with it. Rather try to find some normal game text. That said I believe the game uses UTF8 strings - which btw. are a problem to extract.
    sorryto bother but, the thing is that the game that i want to play works with unicode le-hex: (agth /hw or /hq) and i can't find anything when i search with sjis: (agth /hb or /hs), in the first video i get to the part when the thing finds the bynary (by the way i have to mark the 00 that is before the first binary otherway the text looks weird), but when y step down i can't find the next text and the thinks doesn't look right, and when i try the method for font caching problem i get to the part when i have to search for the return to address but in that adress there is no local function or anything that can help. If you have time to help me i can upload images, if not i'll just erase the game... what a shame the only game in hundreads that i can't play...

    Comment


    • Originally posted by seregil View Post
      i have no idea how this was gotten, but i believe the working /h code for that game FaeLion is:
      /HWN-10*-8:-10*10@46BF32
      which i found on the agth database at
      http://agthdb.bakastyle.com/
      hope that helps you
      Thanks but that doesn't work i think that is for an other version or something weird,what i need is the h-code for the acta est fabula that can be instaled when you have the original Dieas Irae (2007) in your system. Something like a patch but gets installed like a normal game. But thanks anyway xD.

      Comment


      • Originally posted by salking View Post
        reposting this in hope that is was missed.

        got a request for an agth code for the trial of shcharas new game bunnyblack.

        download links are at the bottom of the page
        http://shchara.co.jp/04develop/bunny/bunny_down01.htm

        seems that the newer shchara games require agth code for some reason

        thx in advance
        I second this request. I tried looking it up myself but I'm having problems in windows 7 x64. If anyone can help will appreciate it.

        Comment


        • Originally posted by DrFeelGood2810 View Post
          Ah, yes, you're right-- I found two hits in memory for このし, for example.

          Well then, if A, B, and S are for sjis, and W and Q are for unicode, then what is used for utf8? And for that matter, is there anything else I need to know about it, that I don't already know from having gone over your tutorials? I don't recall offhand your having addressed uft8 specifically, but perhaps the same procedures apply when dealing with it as one would with any other code.

          In fact, I've just found that, after placing hardware breakpoints at the start of each appearance, neither have tripped when I advanced the game. So already I have happened across another stumbling block.
          I haven't tested it, but I think the hooker of Translation Aggregator can grab UTF8. Besides that I'm not aware of any method grab UTF8, I believe every game I've encountered so far either uses Unicode or SJIS, but given that this game has it's own strange font it might not do that conversion.

          Sometimes a memory breakpoint triggers where hardware breakpoint do not. Another way to test if that section is read out at all is to change the text to something else and see if the original or changed version appears on screen.

          Originally posted by FaeLion View Post
          Hi, first of all thanks for the tutorials, and about that i was looking for a h-code for a game but there isn't one that work, so i decided to do it myself, the game is: http://www.hongfire.com/forum/showthread.php?t=133067 and in that threat is the first torrent, the one for the 2007 version, it is a patch ([BBS.2DJGAME.NET]Diesirae.torrent)
          I honestly don't think you're doing yourself a favour to try to find a hook for Dies Irae from the scratch. The original Dies Irae was one of the first hooks I did and it was a very annoying task. Most likely it would be the easiest way to simply find a Dies Irae that works with the already posted hook codes. If you want to figure out a hook code for your version you could also go ahead, get a Dies Irae version with a known hook code, look at address where it hooks into and try to find a code region that nearly looks the same in your current game version. If you look at the list of known Dies Irae codes you'll notice that their address isn't that different.

          Comment


          • i know that there were people trying to figure out the /h code for 魔王の淫具
            http://www.hongfire.com/forum/showthread.php?t=190734
            ...has anyone found a code for this that works consistently? or one that works consistently on win7 x64 anyway?

            thanks to anyone working on this still

            Comment


            • After way, way to many time with that thing I might have a solution which requires some work, but is the best I can offer:

              Required are:
              - Translation Aggregator [TA] (http://www.hongfire.com/forum/attach...0&d=1274167660)
              - Older version of agth that supports # (http://agthook.googlepages.com/agth_prev.rar) (new code should work with any agth version)

              Unpack TA, unpack AGTH and copy it over the agth files that already come with TA.

              - Launch the game
              - Launch TA and go to Tools-> Launch Text Hook
              --> Select AGTH as Text Hook
              --> In the AGTH Options section enable "Add parameters" and enter /HW-C:118#1@0:GDI32.dll:GetGlyphOutlineW/HW-C:16C@0:GDI32.dll:GetGlyphOutlineW
              --> In running process field select igs_sample.exe
              It should look like in this image:
              Spoiler
              If you're done hit "OK" and agth will be attached to the running game.

              Click once or twice in the game so the dialogue will go forward and agth can grab some text. AGTH should have now 2 UserhookW one with two 2 long numbers left and right of the :, the second with only zeros as right number. What we need is the right number from the thread where it isn't zero.
              - Launch TA and go to Tools-> Launch Text Hook
              --> Select Internal Hook as Text Hook
              --> In the Custom hook section enter wchar:EBX:0@XXXXXX and replace those XXXXXX with right number mentioned above from AGTH
              --> ensure that "Use default hooks" is _not_ selected
              --> In running process field select igs_sample.exe
              It should look like in this image:
              Spoiler
              If you're done hit "OK" and TA itself will be hooked to the running game.

              Once more click once or twice in the game so the hooker can grab text and then in TA goto Tools->Manage Attached Context
              - in the Process contexts section click on the wchar:EBX:... entry
              - in Context Settings section click on 'Auto translate' these two steps basically tell TA to use this entry as source for it's translation
              It should look like in this image:
              Spoiler


              Close agth and you -hopefully- should be fine to go. Every time you restart the game you need to start over finding the XXXXXX address with AGTH and updating the internal hook.
              Attached Files
              Last edited by Freaka; 07-21-2010, 02:38 AM.

              Comment


              • Alright, well then, is there anything else you can recommend? I mean, like TA tutorials or something? I've given it a look, and read the TA explanation in its thread, but there isn't mention of just how one goes about locating the appropriate hook code for use with TA.

                And just so I'm sure, do you mean that you know for a fact that you can't get utf8 out for use with AGTH, or do you mean that you just don't know how?

                At any rate, all I can think of to do for now is just track some various examples of text-- What addresses they pop up at. Maybe find a pattern or something. I don't know exactly. It seems to me like that's all I can do just now, so anything to keep myself busy.

                Actually, I've also now since taken your suggestion of modifying the addresses where the text is found at, to see if anything is changed in-game. Well, I inserted 00 00 00 00 in the original code and then checked the game, and I did this for each instance where the desired line appears. Unfortunately, in not a single case did the in-game text change. I don't know what this means, however.

                And of course, yes, thanks and whatnot for all the patience goes without saying, of course. Unless you'd prefer that it went with saying. Which I'm fine with too.

                But now I think I got to call it a night. Squinting at tiny code for hours is making my eyes bleed.
                Last edited by DrFeelGood2810; 07-20-2010, 08:15 PM.

                Comment


                • Wow, thank you Freaka. I really appreciate the amount of work you do in helping us. I wish I could understand Ollydbg better, but alas the numerous attempts end in failure.

                  Comment


                  • Originally posted by Freaka View Post
                    If you're done hit "OK" and TA itself will be hooked to the running game.

                    Once more click once or twice in the game so the hooker can grab text and then in TA goto Tools->Manage Attached Context
                    - in the Process contexts section click on the wchar:EBX:... entry
                    - in Context Settings section click on 'Auto translate' these two steps basically tell TA to use this entry as source for it's translation
                    It should look like in this image:
                    Spoiler


                    Close agth and you -hopefully- should be fine to go. Every time you restart the game you need to start over finding the XXXXXX address with AGTH and updating the internal hook.
                    freaka, thou art a genius, it worked perfectly. +rep for you

                    Comment


                    • anyone knows h-code for 最果てのイマ?

                      http://www.hongfire.com/forum/showthread.php?t=76587

                      Forget it,I found it on some russian site.You need to download a modified exe file from the link below and add this code to the shortcut /HSN-4@4DA711

                      http://www.mediafire.com/?nchwm3wzjjm
                      Last edited by onuross88; 07-21-2010, 02:37 PM.

                      Comment


                      • Originally posted by DrFeelGood2810 View Post
                        Alright, well then, is there anything else you can recommend? I mean, like TA tutorials or something? I've given it a look, and read the TA explanation in its thread, but there isn't mention of just how one goes about locating the appropriate hook code for use with TA.
                        For the general location it's not really different then doing it for AGTH, just the hooking code has a different format.

                        Originally posted by DrFeelGood2810 View Post
                        And just so I'm sure, do you mean that you know for a fact that you can't get utf8 out for use with AGTH, or do you mean that you just don't know how?
                        There is no way to get UTF8 text parsed via AGTH.

                        Originally posted by DrFeelGood2810 View Post
                        At any rate, all I can think of to do for now is just track some various examples of text-- What addresses they pop up at. Maybe find a pattern or something. I don't know exactly. It seems to me like that's all I can do just now, so anything to keep myself busy.
                        Unfourtunately the way the game processes text is pretty annoying to track down. I've tried to run the approach I use in the tutorials and didn't came out with something working. One issue is that the game or probably the engine modifies the text so it can be mapped onto the bitmap font. E.g. あ is modified on the fly to [0] which I assume is used to pick the right picture for it. Mystery to me why those horrible looking fonts are used in the first place, but not really the point here. I noticed that the game comes with a dll (RGSS103J.dll) that exports a number of interesting functions and placed breakpoints on those to see if any gets called when text on screen is parsed. Eventually I found a somewhat working hook for TA with one of those function.

                        Originally posted by DrFeelGood2810 View Post
                        Actually, I've also now since taken your suggestion of modifying the addresses where the text is found at, to see if anything is changed in-game. Well, I inserted 00 00 00 00 in the original code and then checked the game, and I did this for each instance where the desired line appears. Unfortunately, in not a single case did the in-game text change. I don't know what this means, however.
                        Zeros can have side-effects, changing an a to an o is probably a bit more safe and does the job as well.

                        Now I know I'm spoiling the result you hoped to find yourself, but I don't really see how I could help any more with doing it yourself. The game engine is rather obscure and requires an approach which I'd need to write a tutorial on it's own for.

                        In theory a working hook for TA should be UTF8*:[ESP+8]:ESP@0:RGSS103J.dll:ruby_re_search - but as TA currently doesn't support dll addressing it doesn't work. Instead one needs to figure out the base address where the RGSS103J.dll is loaded into memory and then add 6E180 (in hex!) onto it. Easier alternative is probably to run AGTH once with /HH8@0:RGSS103J.dll:ruby_re_search /NS which should give a hook like 1005CC13 and to that 1156D need to be added for the hook address. For my system that makes it UTF8*:[ESP+8]:ESP@1006E180 in the end. This hook parses a lot of text, it's best to attach it only after the initial name picking has been done and the first text appears. Also in the TA context manager all contexts should be set to disable that only contain garbage...

                        Comment



                        • [あっぷりけ] 黄昏のシンセミア 初回限定版 &
                          [Lose] ゴスデリ -GOTHIC DELUSION- [H-Game]

                          文字表示(C) - > フォント(F) change the font to MS ゴシック
                          select the kirikiri thread - set text speed to fastest

                          [ROOT] PARA-SOL
                          /HB8*04@0:GDI32.dll:GetTextExtentPoint32A
                          Last edited by hyakki; 07-29-2010, 01:58 PM.

                          Comment


                          • Requesting AGTH code for the new NTR game 僕の大事な姉はあいつのオモチャ!
                            http://www.hongfire.com/forum/showth...83%81%E3%83%A3
                            Who can help me?
                            Thanks in advance! ><
                            Last edited by tongnanzi; 07-24-2010, 03:43 AM.

                            Comment


                            • Request h/code for Ran→Sem
                              http://www.hongfire.com/forum/showthread.php?t=193850

                              Comment


                              • Sorry. Took yesterday off. Didn't feel like self-flagellation. Anyway, I don't feel too bad about not getting it done myself. Figures that on my first try I would get an example of a game which even those who've done this hundreds of times hadn't encountered before. I'll see if I can't find myself something more generic to practice on. Still, it's good to get accustomed to failure early on. XD

                                Comment

                                Working...
                                X