UnderminersTeam / UndertaleModTool

The most complete tool for modding, decompiling and unpacking Undertale (and other GameMaker games!)
GNU General Public License v3.0
1.12k stars 213 forks source link

is there any possibility to detour YYC? #240

Closed Surfinactant closed 3 years ago

Surfinactant commented 4 years ago

First, sorry for my bad english, and thanks to devs creating this awesome tool.

I was trying to unpack some data.win, then the tool says that the game is using YYC and code is embedded into game.exe, and I just ignored it because game code wasn't my matter of interest. I was seeking for in-game textures and texts, I could find some images but couldn't find the in-game strings. is there any possibilities for game strings also be embedded within game.exe? if so, can I be able to find and replace the strings?

Thanks.

Grossley commented 4 years ago

Yes, it is my understanding that the strings are embedded in the game.exe . You CAN find and replace text in the game.exe using a hex editor. However, you must be careful not to exceed the original length of the string.

Animeliqite commented 4 years ago

YYC decompilation would be good for some fan-games. In future, fan-games may become YYC, it may even affect DELTARUNE.

Kneesnap commented 4 years ago

Deltarune is not being made in GameMaker: Studio.

BreakinBenny commented 4 years ago

This YYC could be useful for future GameMaker titles...

@Kneesnap Even though Deltarune Chapter 1 might be the only thing in GM:S, how do you know that?

Grossley commented 4 years ago

I feel that such claims are not helpful without strong evidence that this is the case. Without it, it is just a rumor. Do you have any evidence to back up your claim that it is not being made in GameMaker Studio?

Kneesnap commented 4 years ago

Grossley, you know how I know this, if you've forgotten I can tell you again in discord. Anyways, UTMT supporting game strings is likely out of the question, as the strings will be part of compiled assembly code, which besides differing on every single platform, would be very difficult to allow access in any accurate manner, let alone changing the sizes of strings. You're better off with a hex editor.

Surfinactant commented 4 years ago

Thanks for your kind answer @Grossley , I was able to find the text strings in game.exe . but, when I changed the text's value using hex editor and saved it, then game won't open. I didn't exceed the original length, and steam says error code 51. the game which I trying to mod is this: https://store.steampowered.com/app/1138100/ currently working on demo version. this game is basically support Chinese and Japanese letters, but it seems to be support alphabets too, so I thought I could translate this.

Mc-muffin commented 4 years ago

It seems that the game uses Steam_Stub and checks if the .exe has changed, which leave you with the option to either patch the running process or bypass the checksum check, otherwise that's the only roadblock. image

Animeliqite commented 4 years ago

Wait, you have to be kidding me @Kneesnap ... If DELTARUNE will be made out of an another program (not Game Maker Studio 2 or 1), then I may know the reason why.

I have a high chance that Toby Fox saw my Gamejolt account, or people tried to contact him in his DMs, like Soup Taels, Greloom and other people like them. He may know what I did, it could be real! It could be true that I made everything worse by going too far!

BreakinBenny commented 4 years ago

@Animelici804 If the engine switch actually was for that reason (or if Toby wanted to escape from people being able to mod his beautiful creations, maybe even if he felt angry over that Anything ACT mod I made), that's kinda petty.

…At best the engine move would be because GMS can only do so much, and because the new one is easier to create stuff in.

Surfinactant commented 4 years ago

thanks @Mc-muffin for help! it looks like now I have to find a way to somehow bypass that checksum check or sth. also, final question, will I be able to modify/add fonts onto this game? if so I shall try making Korean translation for this game too. really appreciates for everyone's kind answer.

Mc-muffin commented 4 years ago

The games uses external .ttf files for fonts, you can just replace those and the game will automatically pick the glyphs from that.

Surfinactant commented 4 years ago

thanks to @Mc-muffin for help! I was finally able to replace in-game strings. I tried to replace the .ttf and .otf files, but it didn't worked. I could insert english texts to there but couldn't be able to display Korean glyphs. same happened when replaced font files into Korean-supporting one. I think I have to set range or something for it.

Here's Korean font file if you're interested. changed their name to in-game one.

Anyway, thanks for your help again, and have a nice day.

Mc-muffin commented 4 years ago

Found the problem, the games uses the .ttf only for certain texts (you can check which ones by renaming the fonts folder and look for missing text, the options menu is one of them) the rest of the text uses the internal fonts inside the data.win, luckily we can change those! Here I did a quick test: image I made the render as ?, if you look at the hex view (which can't render non-latin character for some reason :T) the part in red is 0xE1 84 80 which corresponds to in hex. Adding the remaining characters can be automated with UTMT, I'll try to add the rest in a few minutes.

Unrelated note, do you mind sharing how are you modifying the .exe whitout steam_stub stopping it? that would be useful to me for another project :P.

Mc-muffin commented 4 years ago

Update, adding the characters work as expected (ignore the fact that they are just random Jamos, I just wanted to do a quick test): 19  ⏐ 10꞉22꞉34-PM ⏐ ScreenRegion Only caveat is that they are images, and with 11K+ characters in the hangul codeblock it quickly runs out of space in the 2048x2048 texture sheet, it's a ""problem"" with a solution (luckily), you just need to specify the characters you are going to use and add them accordingly.

Surfinactant commented 4 years ago

Thanks @Mc-muffin ! I was finally able to import fonts. I used UTMT script called fonts_export and fonts_import.

First I changed SourcceHanSansCN_Bold_12 font, then result are this: 1

I could use script to export fonts to .gmx files but couldn't re-import them after I modified .gmx files. well, I should go research more on why this happening. thanks for your helping.

and I just found and used a tool called Steamless to remove steam_stub barricade. bit worried about it's legality, I shall think more about it. thank you, and have a good day.

Mc-muffin commented 4 years ago

I think the font import script only accepts .csv files (?) you can just create an empty game in GM:S (1.4 or 2 doesn't matter) and then run the export script on the resulting data.win file to get the .csv file, after that you just need to run the import script into thouhou's data.win and finally add the image for the font at proper scale.

Surfinactant commented 4 years ago

sorry for far late reply and thanks to sharing solution! I was busy for past few days, couldn't try reimporting font. I'll try it soon and begin making localization patch for this game. thanks again, for your clear answers to all of my question @Mc-muffin , and hope you have a great day.

Kneesnap commented 4 years ago

If we were to add stuff to make YYC decompilation earlier, I think what would make sense is a Ghidra plugin, where we have signatures to auto-detect all of the runner methods, if they are not already documented. We could even try to make some decompiler improvements to make it give the best results as possible. However, at this time I don't think this is planned.

Grossley commented 3 years ago

Out of scope, closing