First of all, I would like to thank [mention=78]darren.tran[/mention] and [mention=18]Lothbrok[/mention] for their help. They answered my questions and tested the solution to make sure it works. This was a team effort. We will be using this client from the archive:
Depending on the language number, a switch returns a code page. The function can be found at address 0x40A550.
[ATTACH type=full" alt="Capture.PNG]79[/ATTACH]
Case 3 (Vietnam) returns 65001 (UTF-8). Since we are using a US client, the number will be 6 (English). We will change the number at address 00708598 from 6 to 3.
[ATTACH type=full" alt="Capture3.PNG]81[/ATTACH]
Changing the number will affect several things. It appears they wrote features for particular regions. What is relevant to this guide is the fonts. Each language has its own fonts, which vary in height, weight, etc. The language value is compared to determine which block to execute. Follow the jump instructions until you see 3 (Vietnam).
[ATTACH type=full" alt="Capture2.PNG]80[/ATTACH]
Below the call to CreateFontA it creates 3 more fonts. The values 0x190 and 0x2BC are weight macros.
If you've added additional sections to the file, embedding the manifest may break the executable. Embed the manifest before doing anything else. I'm sure there is more than one way to do this, so find something that works for you.
Put the following manifest file in the same directory as game.exe:
The Windows SDK includes a program named mt.exe, which can be used to embed the manifest. You will need to add the path to your system environment variables so the system can find the file. The path will look something like this:
First of all, I would like to thank [mention=78]darren.tran[/mention] and [mention=18]Lothbrok[/mention] for their help. They answered my questions and tested the solution to make sure it works. This was a team effort. We will be using this client from the archive:
https://archive.openshaiya.org/shaiya-us/clients/ps0183-22-12-2011-game.exe
There used to be a language setting in the configuration file. A number was assigned to a global variable, depending on the key value.
enum struct LoginVersion : UINT32 { Korea = 1, // China, // Vietnam, // 65001 (UTF-8) Japan, // 932 Taiwan, // 950 English, // CP_ACP Germany, // CP_ACP SingaMala, // 950 HongKong, // 950 France, // CP_ACP Russia, // CP_ACP Turkey, // 1254 Brazil, // CP_ACP LatinAmerica, // CP_ACP Poland, // 1250 Italy, // CP_ACP Philippines // CP_ACP };See the following documentation to learn more:
MultiByteToWideChar
WideCharToMultiByte
https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
Depending on the language number, a switch returns a code page. The function can be found at address 0x40A550.
[ATTACH type=full" alt="Capture.PNG]79[/ATTACH]
Case 3 (Vietnam) returns 65001 (UTF-8). Since we are using a US client, the number will be 6 (English). We will change the number at address 00708598 from 6 to 3.
[ATTACH type=full" alt="Capture3.PNG]81[/ATTACH]
Changing the number will affect several things. It appears they wrote features for particular regions. What is relevant to this guide is the fonts. Each language has its own fonts, which vary in height, weight, etc. The language value is compared to determine which block to execute. Follow the jump instructions until you see 3 (Vietnam).
[ATTACH type=full" alt="Capture2.PNG]80[/ATTACH]
Below the call to CreateFontA it creates 3 more fonts. The values 0x190 and 0x2BC are weight macros.
Now, we need to embed the manifest. Please see the following documentation:
https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page
https://devblogs.microsoft.com/oldnewthing/20220531-00/?p=106697
https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#activecodepage
If you've added additional sections to the file, embedding the manifest may break the executable. Embed the manifest before doing anything else. I'm sure there is more than one way to do this, so find something that works for you.
Put the following manifest file in the same directory as game.exe:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyIdentity type="win32" name="..." version="6.0.0.0"/> <application> <windowsSettings> <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage> </windowsSettings> </application> </assembly>The Windows SDK includes a program named mt.exe, which can be used to embed the manifest. You will need to add the path to your system environment variables so the system can find the file. The path will look something like this:
Execute the following command to embed the manifest:
You can use Resource Hacker to check the result. It should also be able to embed the manifest, but I didn't test it.
[ATTACH type=full" alt="Capture4.PNG]82[/ATTACH]
Notes
Login input limit:
Japan (4): 12
Russia (11): 31
Default: 19
Chat input limit:
Taiwan (5): 70
Hong Kong (9): 70
Default: 120
Note: the chat color format is 8 characters.
Edited by Bowie