News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: [PC] A couple of questions  (Read 3834 times)

Azkadellia

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 868
  • 提交向你的情妇!
    • View Profile
    • Princess Translations
[PC] A couple of questions
« on: December 04, 2011, 03:16:36 am »
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

  • Jr. Member
  • **
  • Posts: 41
    • View Profile
Re: [PC] A couple of questions
« Reply #1 on: December 04, 2011, 09:43:00 am »
Deleted.
« Last Edit: June 30, 2021, 06:49:17 am by Nagato »

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: [PC] A couple of questions
« Reply #2 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.

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3535
    • View Profile
    • Aeon Genesis
Re: [PC] A couple of questions
« Reply #3 on: December 04, 2011, 03:51:35 pm »
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

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 868
  • 提交向你的情妇!
    • View Profile
    • Princess Translations
Re: [PC] A couple of questions
« Reply #4 on: December 04, 2011, 03:57:31 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

  • Sr. Member
  • ****
  • Posts: 498
    • View Profile
Re: [PC] A couple of questions
« Reply #5 on: December 04, 2011, 03:59:44 pm »
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

  • Jr. Member
  • **
  • Posts: 41
    • View Profile
Re: [PC] A couple of questions
« Reply #6 on: December 04, 2011, 04:12:18 pm »
Deleted.
« Last Edit: June 30, 2021, 06:49:22 am by Nagato »

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3535
    • View Profile
    • Aeon Genesis
Re: [PC] A couple of questions
« Reply #7 on: December 04, 2011, 04:44:48 pm »
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.