444Ro666 / MapleEzorsia-v2

v83 Standalone HD dll client/localhost
GNU Affero General Public License v3.0
76 stars 40 forks source link

Can you add typing language option? #44

Open jayhong82 opened 9 months ago

jayhong82 commented 9 months ago

This code is for typing Korean, Chinese, Japanese, Vietnamese, Thai, etc... Can you add this option?

localhost.exe find : 74 0B C6 46 01 20 modify : EB 0B C6 46 01 20

find : 7C 04 3C 7E 7E 03 C6 06 20 46 EB D4 modify : EB 07 3C 7E 7E 03 C6 06 20 46 EB D4

find : 74 0B C6 47 01 20 modify : EB 0B C6 47 01 20

find : 7C 04 3C 7E 7E 03 C6 07 20 modify : EB 07 3C 7E 7E 03 C6 07 20

find : 74 18 C6 46 01 20 modify : EB 18 C6 46 01 20

find : 7C 04 3C 7E 7E 03 C6 06 20 46 EB C7 modify : EB 07 3C 7E 7E 03 C6 06 20 46 EB C7

find : 74 2B 53 FF B7 AC 00 00 00 modify : EB 00 53 FF B7 AC 00 00 00

Cosmic/config.yaml find : CHARSET: US-ASCII modify : CHARSET: MS949 or CHARSET: TIS620 MS949 => Korean, TIS620=> Thai

444Ro666 commented 9 months ago

please provide addresses, i am not good at scanning IDA for array of bytes

huangshushu commented 9 months ago

Based on what he provided, I wrote the following code, tested it and it works fine.

struct MemoryWrite {
    unsigned int address;
    std::vector<unsigned char> values;
};

std::vector<MemoryWrite> memoryWrites = {
    { 0x00531EE8, { 0xEB, 0x0B, 0xC6, 0x46, 0x01, 0x20 } },
    { 0x00531EF9, { 0xEB, 0x07, 0x3C, 0x7E, 0x7E, 0x03, 0xC6, 0x06, 0x20, 0x46, 0xEB, 0xD4 } },
    { 0x008D54A6, { 0xEB, 0x0B, 0xC6, 0x47, 0x01, 0x20 } },
    { 0x008D54B7, { 0xEB, 0x07, 0x3C, 0x7E, 0x7E, 0x03, 0xC6, 0x07, 0x20 } },
    { 0x00937225, { 0xEB, 0x18, 0xC6, 0x46, 0x01, 0x20 } },
    { 0x00937243, { 0xEB, 0x07, 0x3C, 0x7E, 0x7E, 0x03, 0xC6, 0x06, 0x20, 0x46, 0xEB, 0xC7 } },
    { 0x009E85FC, { 0xEB, 0x00, 0x53, 0xFF, 0xB7, 0xAC, 0x00, 0x00, 0x00 } }
};

for (const auto& write : memoryWrites) {
    for (int i = 0; i < write.values.size(); i++) {
        Memory::WriteByte(write.address + i, write.values[i]);
    }
}

image

However, I found some remaining bugs, for example, when registering a new character, the rest of the languages don't pass validation. image

AND, the input method will be invoked in the account password screen, is it possible to change these addresses after entering the account password?

444Ro666 commented 9 months ago

yes but this is tricky, it will need to be changed back also every time you relog

thanks for posting the addresses btw, i will do this when i get the chance