News:

11 March 2016 - Forum Rules

Main Menu

[PC] A couple of questions

Started by Azkadellia, December 04, 2011, 03:16:36 AM

Previous topic - Next topic

Azkadellia

First: How do I go about changing a PC game from running on JP region PCs to US region PCs?
Second: I found the font the game uses (MS Mincho, BTW), but how do I change it to a font of my choosing?
Current Projects: On hold indefinitely.
I do the Twitter thing now: https://twitter.com/MistressSaeko (expect lots of game streaming announcements)
Mistress of the RHDN Discord server.

Nagato

#1
Deleted.

henke37

Microsoft already has a tool for making applications use a different locale than the system. It's called applocale.

Gideon Zhi

Quote from: Nagato on December 04, 2011, 09:43:00 AM
To change the font you will need to change the calls to CreateFont() and CreateFontIndirect(). For the CreateFont()s you will need to change the charset parameter as well. Shift-JIS is charset 128 (0x80) so find that and change it to ANSI. Note that you cannot use any Japanese characters after you change the charset of the font or else you will start seeing gibberish characters. CreateFont() also accepts the name of the font so you can just change it from MS Mincho to whatever there.

I had a similar question to this, actually. I found the CreateFont() call in the game I'm working on and adjusted the region parameter accordingly (which created a whole lot of mojibake in my game), but the LPCSTR font name parameter points to a null value and the game still defaults to MS Gothic. I'm sure that I'm editing the right call, though. What's going on here?

Azkadellia

Quote from: henke37 on December 04, 2011, 03:34:53 PM
Microsoft already has a tool for making applications use a different locale than the system. It's called applocale.

I'm trying to avoid having people use applocale to play the game.
Current Projects: On hold indefinitely.
I do the Twitter thing now: https://twitter.com/MistressSaeko (expect lots of game streaming announcements)
Mistress of the RHDN Discord server.

Klarth

I told you last night that you don't necessarily have to supply a font name to CreateFont.  If you use CreateFont without the LPCSTR parameter, Windows will find the first font that matches the other parameters.  Change the parameter that defines the charset you wish.  Past that, you'd have to find a way put a string into the .exe and push the offset instead of pushing null.

Nagato

#6
Deleted.

Gideon Zhi

Yeah, the point is that the only parameters passed to CreateFont were int nHeight, dwrd fdwCharSet, and LPCSTR lpszFace, the latter of which was just a pointer to a null string. Changing fdwCharSet from 0x80 to 0x00 *still* resulted in MS Gothic getting printed, albeit with mojibake for the sjis. Klarth has since suggested (on IRC) that it might have something to do with the application's locale, which was the *other* question in this thread. Unfortunately I don't have any time to spend on IDA today, so for now I'll just shut up and read the rest of the thread as it comes out.