Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "StdAfx.h"
- #include "Locale.h"
- #include "PythonApplication.h"
- #include "resource.h"
- #include "../eterBase/CRC32.h"
- #include <NVFS.h>
- #include "../eterLocale/Japanese.h"
- #include <windowsx.h>
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <psapi.h>
- //#include <funcs.h>
- #include "EncryptorStrings.h"
- #pragma comment(lib, "psapi.lib")
- bool LibCheck = false;
- HANDLE WindowThread = NULL;
- HANDLE GuardHandle1 = NULL;
- HANDLE GuardHandle2 = NULL;
- HANDLE GuardHandle3 = NULL;
- HANDLE GuardHandle4 = NULL;
- HANDLE GuardHandle5 = NULL;
- //USE THE Encryptor C++ to Change strings :)
- //THE Encryptor C++ is in Win23Project/Release
- //WINDOW TITLE IN LOCALE.py MUST BE -> "Metin2 - Client protected by Frankie."
- std::string AppTitle = UltimateDecrypt("0c2737282c71616f63022e2a242c376132312e362622362625622138620533232d2a2b266f");
- std::string WhiteList[] = {
- AppTitle,
- UltimateDecrypt("0d0d04"),
- UltimateDecrypt("0923202a112b28272f25626e610626352720352b2c2f"),
- UltimateDecrypt("0e0010610d33242c040d620772066315272e31620724342a222763162b2d252d34"),
- UltimateDecrypt("060d0c03180c610c2635352c3329630434262f363061112a2f2963162b2d252d34"),
- UltimateDecrypt("05272520372f35620a0c07"),
- UltimateDecrypt("0c110015040a0c0763140b"),
- UltimateDecrypt("050b062c152a2f"),
- UltimateDecrypt("0021372834260c2d35282763162b2d252d34"),
- UltimateDecrypt("0c2b20332d302e243761142a3237222d62006a696313372d352b2e24620f28203120303a"),
- };
- inline void CloseProcess()
- {
- Sleep(4000);
- exit(0);
- }
- inline void CloseApp(const char *Name)
- {
- CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(CloseProcess), NULL, NULL, NULL);
- MessageBoxA(NULL, Name, UltimateDecrypt("0923202a112b28272f25626e610626352720352b2c2f").c_str(), NULL);
- exit(0);
- }
- inline void ErrorPythonPathInjector()
- {
- std::string FakeString = "D:\\ymir work\\*";
- CloseApp(UltimateDecrypt("113b37292d2d611222352a63082c29242137282d2d6f6207242e263527632e306313272d202f2661362b2462077b1e3a2c2b3161352c3329633123372962332d272232276d").c_str());
- }
- struct Frankie{ DWORD pid; }Pids;
- inline bool InWhiteList(std::string Element)
- {
- for (int i = 0; i < sizeof(WhiteList) / sizeof(WhiteList[0]); i++) {
- if (Element.length() < 2) return true;
- if (Element.find(WhiteList[i]) != std::string::npos) return true;
- }
- return false;
- }
- BOOL CALLBACK WindowList(HWND hnd, LPARAM lParam)
- {
- Frankie *Struct = (Frankie*)lParam;
- DWORD pID;
- GetWindowThreadProcessId(hnd, &pID);
- if (pID == Struct->pid) {
- char Win[200];
- GetWindowTextA(hnd, Win, 200);
- if (!InWhiteList(std::string(Win))) {
- FILE *f = fopen(UltimateDecrypt("0923202a312b28272f256c0633302c336c373936").c_str(), "w");
- fputs(std::string(UltimateDecrypt("1a0a22222910292b262d261e61060f0d620a2f282622362a2e2c6325273724213724266f61212f2e312661362b2831632032337b62") + std::string(Win) + std::string("\n")).c_str(), f);
- fclose(f);
- exit(-1);
- }
- }
- return TRUE;
- }
- void Symbols()
- {
- HMODULE Modules[1024];
- DWORD Mod;
- if (EnumProcessModules(GetCurrentProcess(), Modules, sizeof(Modules), &Mod)) {
- for (unsigned int i=0; i<Mod/sizeof(HMODULE); i++) {
- char ModuleName[200];
- if (GetModuleFileNameExA(GetCurrentProcess(), Modules[i], ModuleName, 200)) {
- if (GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("01020e202b2d202603082c2a352b222d2b3924").c_str()) != NULL &&
- GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("01020e202b2d202603072b2d202e2a3b27").c_str()) != NULL &&
- GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("01020e202b2d362b2d252d34010b2d28362a202e2a3b27").c_str()) != NULL &&
- GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("01020e202b2d362b2d252d3401042a2f232f283826").c_str()) != NULL &&
- GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("150f26352a2c250b2e312e262c272d352337282d2d082c37243020243237").c_str()) != NULL &&
- GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("1e1d1c02121325272134250b2e2d28").c_str()) != NULL &&
- GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("1e03270c232a2f").c_str()) != NULL &&
- GetProcAddress(GetModuleHandleA(ModuleName), UltimateDecrypt("1e042c332f0e202b2d").c_str()) != NULL) {
- CloseApp(UltimateDecrypt("11302c05232e202526610a22222963072d362f26").c_str());
- }
- }
- }
- }
- }
- inline void Check()
- {
- A:
- Pids.pid = GetCurrentProcessId();
- EnumWindows(WindowList, (LPARAM)&Pids);
- Symbols();
- goto A;
- }
- inline void GameGuard()
- {
- C:
- if (WaitForSingleObject(WindowThread, 1000) != WAIT_TIMEOUT) exit(0);
- if (WaitForSingleObject(GuardHandle1, 1000) != WAIT_TIMEOUT) exit(0);
- if (WaitForSingleObject(GuardHandle2, 1000) != WAIT_TIMEOUT) exit(0);
- if (WaitForSingleObject(GuardHandle3, 1000) != WAIT_TIMEOUT) exit(0);
- if (WaitForSingleObject(GuardHandle4, 1000) != WAIT_TIMEOUT) exit(0);
- if (WaitForSingleObject(GuardHandle5, 1000) != WAIT_TIMEOUT) exit(0);
- ResumeThread(WindowThread);
- ResumeThread(GuardHandle1);
- ResumeThread(GuardHandle2);
- ResumeThread(GuardHandle3);
- ResumeThread(GuardHandle4);
- ResumeThread(GuardHandle5);
- Sleep(1000);
- goto C;
- }
- inline void BlockYmirWork()
- {
- WIN32_FIND_DATAA Check;
- std::string Path(std::string(UltimateDecrypt("05")) + std::string(UltimateDecrypt("7b1e1f")) + std::string(UltimateDecrypt("382f2a33")) + std::string(UltimateDecrypt("61352c33291f1d68")));
- HANDLE check = FindFirstFileA(Path.c_str(), &Check);
- if (check != INVALID_HANDLE_VALUE) {
- FindClose(check);
- ErrorPythonPathInjector();
- }
- }
- inline void DetectFiles()
- {
- Restart:
- if (FindWindowA(UltimateDecrypt("0e0e0f18060106").c_str(), NULL)) CloseApp(UltimateDecrypt("0e0e0f18060106").c_str());
- if (FindWindowA(UltimateDecrypt("162b2d0520240730222c27002d233032").c_str(), NULL)) CloseApp(UltimateDecrypt("0e0e0f18060106").c_str());
- if (FindWindowA(NULL, UltimateDecrypt("0a27312f272f610626352720352b35246235706c776f73637b7863123b3035272e610b272d276311302c22273032").c_str())) CloseApp("ProcessExplorer");
- if (FindWindowA(NULL, "Art*Mo*ney")) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("020a70757563720c04700c70")) + std::string(" 9.9")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.3")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.4")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.5")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.6")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.7")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.8")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.9")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.0")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.1")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.2")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.3")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.4")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.5")).c_str())) CloseApp(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (LibCheck) {
- WIN32_FIND_DATAA Lib;
- HANDLE Lis = FindFirstFileA(UltimateDecrypt("2d2b211d1e69").c_str(), &Lib);
- if (!(Lib.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- if (_stricmp(Lib.cFileName, UltimateDecrypt("1e1d2534363633271c1e6c333821").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("222d33381d3124256d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("353b3324316d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("2d2b2d242122222a266f323a22").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("2f363320362b6f323a22").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("2e316d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("322b37246c333821").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("323622356c333821").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("323631282c246f323a22").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("14312633062a22366d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("3530222227212021286f323a22").c_str()) != 0) {
- std::string File(Lib.cFileName);
- if (File.find(UltimateDecrypt("6f323a").c_str()) != std::string::npos || File.find(UltimateDecrypt("6f323a22").c_str()) != std::string::npos || File.find(UltimateDecrypt("6f323a25").c_str()) != std::string::npos) {
- CloseApp(File.c_str());
- }
- }
- }
- while (FindNextFileA(Lis, &Lib)) {
- if (!(Lib.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- if (_stricmp(Lib.cFileName, UltimateDecrypt("1e1d2534363633271c1e6c333821").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("222d33381d3124256d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("353b3324316d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("2d2b2d242122222a266f323a22").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("2f363320362b6f323a22").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("2e316d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("322b37246c333821").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("323622356c333821").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("323631282c246f323a22").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("14312633062a22366d313b20").c_str()) != 0 &&
- _stricmp(Lib.cFileName, UltimateDecrypt("3530222227212021286f323a22").c_str()) != 0) {
- std::string File(Lib.cFileName);
- if (File.find(UltimateDecrypt("6f323a").c_str()) != std::string::npos || File.find(UltimateDecrypt("6f323a22").c_str()) != std::string::npos || File.find(UltimateDecrypt("6f323a25").c_str()) != std::string::npos) {
- CloseApp(File.c_str());
- }
- }
- }
- }
- FindClose(Lis);
- }
- WIN32_FIND_DATAA Miles;
- HANDLE Mil = FindFirstFileA(UltimateDecrypt("2c2b2f24311f1d68").c_str(), &Miles);
- if (!(Miles.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- if (_stricmp(Miles.cFileName, UltimateDecrypt("2c31302071276f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130253170256c2e7226").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130253a746f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c313024233b6f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c31302c32706f233028").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c313033313b6f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130322d25356c2e7226").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130372d2a22276d20312a").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c31302531336f242f35").c_str()) != 0) {
- std::string File(Miles.cFileName);
- if (File.find(std::string(std::string(".a")+std::string("s")+std::string("i")).c_str()) != std::string::npos || File.find(std::string(std::string(".m")+std::string("3")+std::string("d")).c_str()) != std::string::npos || File.find(std::string(std::string(".f")+std::string("l")+std::string("t")).c_str()) != std::string::npos || File.find(std::string(std::string(".m")+std::string("i")+std::string("x")).c_str()) != std::string::npos) {
- CloseApp(File.c_str());
- }
- }
- }
- while (FindNextFileA(Mil, &Miles)) {
- if (!(Miles.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- if (_stricmp(Miles.cFileName, UltimateDecrypt("2c31302071276f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130253170256c2e7226").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130253a746f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c313024233b6f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c31302c32706f233028").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c313033313b6f2f7025").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130322d25356c2e7226").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c3130372d2a22276d20312a").c_str()) != 0
- && _stricmp(Miles.cFileName, UltimateDecrypt("2c31302531336f242f35").c_str()) != 0) {
- std::string File(Miles.cFileName);
- if (File.find(std::string(std::string(".a")+std::string("s")+std::string("i")).c_str()) != std::string::npos || File.find(std::string(std::string(".m")+std::string("3")+std::string("d")).c_str()) != std::string::npos || File.find(std::string(std::string(".f")+std::string("l")+std::string("t")).c_str()) != std::string::npos || File.find(std::string(std::string(".m")+std::string("i")+std::string("x")).c_str()) != std::string::npos) {
- CloseApp(File.c_str());
- }
- }
- }
- }
- FindClose(Mil);
- WIN32_FIND_DATAA Current;
- HANDLE Cur = FindFirstFileA("*", &Current);
- if (!(Current.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- std::string FileC(Current.cFileName);
- if (FileC.find(std::string(std::string(".a")+std::string("s")+std::string("i")).c_str()) != std::string::npos || FileC.find(std::string(std::string(".m")+std::string("3")+std::string("d")).c_str()) != std::string::npos || FileC.find(std::string(std::string(".f")+std::string("l")+std::string("t")).c_str()) != std::string::npos || FileC.find(std::string(std::string(".m")+std::string("i")+std::string("x")).c_str()) != std::string::npos || FileC.compare(std::string(std::string("lo")+std::string("ginin")+std::string("fo.p")+std::string("y")).c_str()) == 0) {
- CloseApp(FileC.c_str());
- }
- if (FileC.find(UltimateDecrypt("6f323a").c_str()) != std::string::npos || FileC.find(UltimateDecrypt("6f323a22").c_str()) != std::string::npos || FileC.find(UltimateDecrypt("6f323a25").c_str()) != std::string::npos) {
- CloseApp(FileC.c_str());
- }
- }
- while (FindNextFileA(Cur, &Current)) {
- if (!(Current.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- std::string FileC(Current.cFileName);
- if (FileC.find(std::string(std::string(".a")+std::string("s")+std::string("i")).c_str()) != std::string::npos || FileC.find(std::string(std::string(".m")+std::string("3")+std::string("d")).c_str()) != std::string::npos || FileC.find(std::string(std::string(".f")+std::string("l")+std::string("t")).c_str()) != std::string::npos || FileC.find(std::string(std::string(".m")+std::string("i")+std::string("x")).c_str()) != std::string::npos || FileC.compare(std::string(std::string("lo")+std::string("ginin")+std::string("fo.p")+std::string("y")).c_str()) == 0) {
- CloseApp(FileC.c_str());
- }
- if (FileC.find(UltimateDecrypt("6f323a").c_str()) != std::string::npos || FileC.find(UltimateDecrypt("6f323a22").c_str()) != std::string::npos || FileC.find(UltimateDecrypt("6f323a25").c_str()) != std::string::npos) {
- CloseApp(FileC.c_str());
- }
- }
- }
- FindClose(Cur);
- BlockYmirWork();
- Sleep(2000);
- goto Restart;
- }
- inline void InitProtect()
- {
- //DumpScan();
- BlockYmirWork();
- WindowThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)DetectFiles, NULL, NULL, NULL);
- WindowThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Check, NULL, NULL, NULL);
- GuardHandle1 = CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(GameGuard), NULL, NULL, NULL);
- GuardHandle2 = CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(GameGuard), NULL, NULL, NULL);
- GuardHandle3 = CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(GameGuard), NULL, NULL, NULL);
- GuardHandle4 = CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(GameGuard), NULL, NULL, NULL);
- GuardHandle5 = CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(GameGuard), NULL, NULL, NULL);
- }
- const char* LSS_YMIR = "YMIR";
- const char* LSS_JAPAN = "JAPAN";
- const char* LSS_ENGLISH = "ENGLISH";
- const char* LSS_HONGKONG = "HONGKONG";
- const char* LSS_TAIWAN = "TAIWAN";
- const char* LSS_NEWCIBN = "NEWCIBN";
- const char* LSS_EUROPE = "EUROPE";
- const char* LSS_GLOBAL = "GLOBAL";
- static bool IS_CHEONMA = false;
- #ifndef LSS_SECURITY_KEY
- #define LSS_SECURITY_KEY "testtesttesttest"
- #endif
- std::string __SECURITY_KEY_STRING__ = LSS_SECURITY_KEY;
- char MULTI_LOCALE_SERVICE[256] = "YMIR";
- char MULTI_LOCALE_PATH[256] = "locale/ymir";
- char MULTI_LOCALE_NAME[256] = "ymir";
- int MULTI_LOCALE_CODE = 949;
- int MULTI_LOCALE_REPORT_PORT = 10000;
- void LocaleService_LoadConfig(const char* fileName)
- {
- NANOBEGIN
- FILE* fp = fopen(fileName, "rt");
- if (fp)
- {
- char line[256];
- char name[256];
- int code;
- int id;
- if (fgets(line, sizeof(line)-1, fp))
- {
- line[sizeof(line)-1] = '\0';
- sscanf(line, "%d %d %s", &id, &code, name);
- MULTI_LOCALE_REPORT_PORT = id;
- MULTI_LOCALE_CODE = code;
- strcpy(MULTI_LOCALE_NAME, name);
- sprintf(MULTI_LOCALE_PATH, "locale/%s", MULTI_LOCALE_NAME);
- }
- fclose(fp);
- }
- NANOEND
- }
- unsigned LocaleService_GetLastExp(int level)
- {
- static const int GUILD_LEVEL_MAX = 20;
- if (LocaleService_IsCHEONMA())
- {
- static DWORD CHEONMA_GUILDEXP_LIST[GUILD_LEVEL_MAX+1] =
- {
- 0, // 0
- 15000ul, // 1
- 45000ul, // 2
- 90000ul, // 3
- 160000ul, // 4
- 235000ul, // 5
- 325000ul, // 6
- 430000ul, // 7
- 550000ul, // 8
- 685000ul, // 9
- 835000ul, // 10
- 1000000ul, // 11
- 1500000ul, // 12
- 2100000ul, // 13
- 2800000ul, // 14
- 3600000ul, // 15
- 4500000ul, // 16
- 6500000ul, // 17
- 8000000ul, // 18
- 10000000ul, // 19
- 42000000UL // 20
- };
- if (level < 0 && level >= GUILD_LEVEL_MAX)
- return 0;
- return CHEONMA_GUILDEXP_LIST[level];
- }
- static DWORD INTERNATIONAL_GUILDEXP_LIST[GUILD_LEVEL_MAX+1] =
- {
- 0, // 0
- 6000UL, // 1
- 18000UL, // 2
- 36000UL, // 3
- 64000UL, // 4
- 94000UL, // 5
- 130000UL, // 6
- 172000UL, // 7
- 220000UL, // 8
- 274000UL, // 9
- 334000UL, // 10
- 400000UL, // 11
- 600000UL, // 12
- 840000UL, // 13
- 1120000UL, // 14
- 1440000UL, // 15
- 1800000UL, // 16
- 2600000UL, // 17
- 3200000UL, // 18
- 4000000UL, // 19
- 16800000UL // 20
- };
- if (level < 0 && level >= GUILD_LEVEL_MAX)
- return 0;
- return INTERNATIONAL_GUILDEXP_LIST[level];
- }
- int LocaleService_GetSkillPower(unsigned level)
- {
- static const unsigned SKILL_POWER_NUM = 50;
- if (level >= SKILL_POWER_NUM)
- return 0;
- if (LocaleService_IsCHEONMA())
- {
- static unsigned CHEONMA_SKILL_POWERS[SKILL_POWER_NUM]=
- {
- 0,
- 5, 7, 9, 11, 13,
- 15, 17, 19, 20, 22,
- 24, 26, 28, 30, 32,
- 34, 36, 38, 40, 50, // master
- 52, 55, 58, 61, 63,
- 66, 69, 72, 75, 80, // grand_master
- 82, 84, 87, 90, 95,
- 100,110,120,130,150,// perfect_master
- 150,
- };
- return CHEONMA_SKILL_POWERS[level];
- }
- // 0 5 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 50 52 54 56 58 60 63 66 69 72 82 85 88 91 94 98 102 106 110 115 125 125 125 125 125
- static unsigned INTERNATIONAL_SKILL_POWERS[SKILL_POWER_NUM]=
- {
- 0,
- 5, 6, 8, 10, 12,
- 14, 16, 18, 20, 22,
- 24, 26, 28, 30, 32,
- 34, 36, 38, 40, 50, // master
- 52, 54, 56, 58, 60,
- 63, 66, 69, 72, 82, // grand_master
- 85, 88, 91, 94, 98,
- 102,106,110,115,125,// perfect_master
- 125,
- };
- return INTERNATIONAL_SKILL_POWERS[level];
- }
- const char* LocaleService_GetSecurityKey()
- {
- return __SECURITY_KEY_STRING__.c_str();
- }
- // CHEONMA
- void LocaleService_SetCHEONMA(bool isEnable)
- {
- IS_CHEONMA = isEnable;
- }
- bool LocaleService_IsCHEONMA()
- {
- return LocaleService_IsYMIR();
- }
- // END_OF_CHEONMA
- #if defined(LOCALE_SERVICE_EUROPE) || defined(LOCALE_SERVICE_BRAZIL) || defined(LOCALE_SERVICE_CANADA) || defined(LOCALE_SERVICE_SINGAPORE) || defined(LOCALE_SERVICE_VIETNAM) || defined(LOCALE_SERVICE_TAIWAN) || defined(LOCALE_SERVICE_NEWCIBN)
- #define _LSS_USE_LOCALE_CFG 1
- #define _LSS_SERVICE_NAME LSS_EUROPE
- #elif defined(LOCALE_SERVICE_ITALY)
- #define _LSS_SERVICE_NAME LSS_ITALY
- #define _LSS_SERVICE_CODEPAGE CP_LATIN
- #define _LSS_SERVICE_LOCALE_NAME "it"
- #define _LSS_SERVICE_LOCALE_PATH "locale/it"
- #elif defined(LOCALE_SERVICE_ENGLISH)
- #define _LSS_SERVICE_NAME LSS_ENGLISH
- #define _LSS_SERVICE_CODEPAGE CP_LATIN
- #define _LSS_SERVICE_LOCALE_NAME "english"
- #define _LSS_SERVICE_LOCALE_PATH "locale/english"
- #elif defined(LOCALE_SERVICE_JAPAN)
- #define _LSS_SERVICE_NAME LSS_JAPAN
- #define _LSS_SERVICE_CODEPAGE CP_JAPANESE
- #define _LSS_SERVICE_LOCALE_NAME "japan"
- #define _LSS_SERVICE_LOCALE_PATH "locale/japan"
- #elif defined(LOCALE_SERVICE_YMIR)
- #define _LSS_SERVICE_NAME LSS_YMIR
- #define _LSS_SERVICE_CODEPAGE CP_HANGUL
- #define _LSS_SERVICE_LOCALE_NAME "ymir"
- #define _LSS_SERVICE_LOCALE_PATH "locale/ymir"
- #elif defined(LOCALE_SERVICE_HONGKONG)
- #define _LSS_SERVICE_NAME LSS_HONGKONG
- #define _LSS_SERVICE_CODEPAGE CP_CHINESE_TRAD
- #define _LSS_SERVICE_LOCALE_NAME "hongkong"
- #define _LSS_SERVICE_LOCALE_PATH "locale/hongkong"
- #elif defined(LOCALE_SERVICE_TAIWAN)
- #define _LSS_SERVICE_NAME LSS_TAIWAN
- #define _LSS_SERVICE_CODEPAGE CP_CHINESE_TRAD
- #define _LSS_SERVICE_LOCALE_NAME "taiwan"
- #define _LSS_SERVICE_LOCALE_PATH "locale/taiwan"
- #elif defined(LOCALE_SERVICE_NEWCIBN)
- #define _LSS_SERVICE_NAME LSS_NEWCIBN
- #define _LSS_SERVICE_CODEPAGE CP_CHINESE_SIMPLE
- #define _LSS_SERVICE_LOCALE_NAME "newcibn"
- #define _LSS_SERVICE_LOCALE_PATH "locale/newcibn"
- #endif
- #if defined(_LSS_USE_LOCALE_CFG)
- #if defined(_LSS_SERVICE_NAME)
- const char* LocaleService_GetName() { return _LSS_SERVICE_NAME;}
- #else
- const char* LocaleService_GetName() { return MULTI_LOCALE_SERVICE; }
- #endif
- unsigned int LocaleService_GetCodePage() { return MULTI_LOCALE_CODE; }
- const char* LocaleService_GetLocaleName() { return MULTI_LOCALE_NAME; }
- const char* LocaleService_GetLocalePath() { return MULTI_LOCALE_PATH; }
- #elif defined(_LSS_SERVICE_NAME)
- const char* LocaleService_GetName() { return _LSS_SERVICE_NAME;}
- unsigned int LocaleService_GetCodePage() { return _LSS_SERVICE_CODEPAGE; }
- const char* LocaleService_GetLocaleName() { return _LSS_SERVICE_LOCALE_NAME; }
- const char* LocaleService_GetLocalePath() { return _LSS_SERVICE_LOCALE_PATH; }
- #endif
- void LocaleService_ForceSetLocale(const char* name, const char* localePath)
- {
- strcpy(MULTI_LOCALE_NAME, name);
- strcpy(MULTI_LOCALE_PATH, localePath);
- // ±âÁ¸ õ¸¶ Ľąö·Î Á˘ĽÓ˝Ăżˇ´Â security key şŻ°ć (WE ąöŔü Ŭ¶ó·Î õ¸¶Ľąö Á˘ĽÓÇϱâ Ŕ§ÇÔ)
- if (0 == stricmp(name, "ymir"))
- __SECURITY_KEY_STRING__ = "testtesttesttest";
- if (0 == stricmp(name, "we_korea"))
- __SECURITY_KEY_STRING__ = "1234abcd5678efgh";
- }
- #if defined(LOCALE_SERVICE_GLOBAL)
- struct SLOCALEDATA
- {
- const char* szServiceName;
- const char* szLocaleName;
- WORD wCodePage;
- const char* szSecurityKey;
- } gs_stLocaleData[] = {
- { LSS_YMIR, "ymir", 949, "testtesttesttest" }, // Korea
- { LSS_EUROPE, "de", 1252, "1234abcd5678efgh" }, // GameForge (Germany)
- { LSS_EUROPE, "en", 1252, "1234abcd5678efgh" }, // GameForge (United Kingdom)
- { LSS_EUROPE, "us", 1252, "1234abcd5678efgh" }, // GameForge (USA)
- { LSS_EUROPE, "es", 1252, "1234abcd5678efgh" }, // GameForge (Spain)
- { LSS_EUROPE, "it", 1252, "1234abcd5678efgh" }, // GameForge (Italy)
- { LSS_EUROPE, "fr", 1252, "1234abcd5678efgh" }, // GameForge (France)
- { LSS_EUROPE, "pt", 1252, "1234abcd5678efgh" }, // GameForge (Portugal)
- { LSS_EUROPE, "tr", 1253, "1234abcd5678efgh" }, // GameForge (Greece)
- { LSS_EUROPE, "pl", 1250, "1234abcd5678efgh" }, // GameForge (Poland)
- { LSS_EUROPE, "tr", 1254, "1234abcd5678efgh" }, // GameForge (Turkey)
- { LSS_EUROPE, "dk", 1252, "1234abcd5678efgh" }, // GameForge (Demmark)
- { LSS_EUROPE, "ae", 1256, "1234abcd5678efgh" }, // GameForge (United Arab Emirate)
- { LSS_EUROPE, "mx", 1252, "1234abcd5678efgh" }, // GameForge (Mexico)
- { LSS_EUROPE, "nl", 1252, "1234abcd5678efgh" }, // GameForge (Netherlands)
- { LSS_EUROPE, "cz", 1252, "1234abcd5678efgh" }, // GameForge (Czech Republic)
- { LSS_EUROPE, "ru", 1251, "1234abcd5678efgh" }, // GameForge (Russian Federation)
- { LSS_EUROPE, "hu", 1250, "1234abcd5678efgh" }, // GameForge (Hungary)
- { LSS_EUROPE, "ro", 1250, "1234abcd5678efgh" }, // GameForge (Romania)
- { LSS_EUROPE, "ca", 1252, "testtesttesttest" }, // Z8Games (Canada)
- { LSS_EUROPE, "sg", 1252, "testtesttesttest" }, // TEC (Singapore)
- { LSS_JAPAN, "japan", 932, "testtesttesttest" }, // Japan
- { LSS_EUROPE, "br", 1252, "testtesttesttest" }, // OnGame (Brazil)
- { LSS_HONGKONG, "hongkong", 950, "testtesttesttest" }, // HongKong & Taiwan
- { LSS_NEWCIBN, "newcibn", 936, "testtesttesttest" }, // CIBN (Free world)
- { LSS_ENGLISH, "english", 949, "testtesttesttest" }, // English (Obsoleted)
- { LSS_YMIR, "kr", 949, "testtesttesttest" }, // Korea (Obsoleted)
- { NULL, NULL, 0, "testtesttesttest" }
- };
- const char* LocaleService_GetName()
- {
- return MULTI_LOCALE_SERVICE;
- }
- unsigned int LocaleService_GetCodePage()
- {
- return MULTI_LOCALE_CODE;
- }
- const char* LocaleService_GetLocaleName()
- {
- return MULTI_LOCALE_NAME;
- }
- const char* LocaleService_GetLocalePath()
- {
- return MULTI_LOCALE_PATH;
- }
- static int gs_iLocale = -1;
- LRESULT CALLBACK SelectDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
- {
- switch( uMsg ) {
- case WM_INITDIALOG : {
- char szLocalePath[256], szDisplayName[256];
- for(int i=0; gs_stLocaleData[i].szServiceName; i++ ) {
- sprintf(szLocalePath, "locale/%s/item_proto", gs_stLocaleData[i].szLocaleName);
- if( NVFS::Instance().isExist(szLocalePath)) {
- sprintf(szDisplayName, "%s (%s, %d)", gs_stLocaleData[i].szLocaleName, gs_stLocaleData[i].szServiceName, gs_stLocaleData[i].wCodePage);
- int iIndex = ListBox_AddString(GetDlgItem(hDlg, IDC_LOCALE_LIST), szDisplayName);
- ListBox_SetItemData(GetDlgItem(hDlg, IDC_LOCALE_LIST), iIndex, i);
- }
- }
- return TRUE;
- }
- case WM_COMMAND :
- switch( LOWORD( wParam ) ) {
- case IDC_LOCALE_LIST: {
- int iSelected = ListBox_GetCurSel(GetDlgItem(hDlg, IDC_LOCALE_LIST));
- switch(HIWORD(wParam)) {
- case LBN_SELCHANGE :
- gs_iLocale = ListBox_GetItemData(GetDlgItem(hDlg, IDC_LOCALE_LIST), iSelected);
- break;
- case LBN_DBLCLK :
- gs_iLocale = ListBox_GetItemData(GetDlgItem(hDlg, IDC_LOCALE_LIST), iSelected);
- ::EndDialog(hDlg, 0);
- break;
- }
- break;
- }
- case IDC_START: {
- ::EndDialog(hDlg, 0);
- break;
- }
- case IDC_EXIT: {
- gs_iLocale = -1;
- ::EndDialog(hDlg, 0);
- break;
- }
- }
- return FALSE;
- }
- return FALSE;
- }
- bool LocaleService_LoadGlobal(HINSTANCE hInstance)
- {
- int nFoundLocales = 0;
- char szLocalePath[256];
- for(int i=0; gs_stLocaleData[i].szServiceName; i++ ) {
- sprintf(szLocalePath, "locale/%s/item_proto", gs_stLocaleData[i].szLocaleName);
- if( NVFS::Instance().isExist(szLocalePath)) {
- nFoundLocales++;
- if(gs_iLocale == -1)
- gs_iLocale = i;
- }
- }
- if (gs_iLocale < 0)
- return false;
- if(nFoundLocales > 1)
- ::DialogBox(hInstance, MAKEINTRESOURCE(IDD_SELECT_LOCALE), NULL, (DLGPROC) SelectDlgProc);
- if (gs_iLocale < 0)
- return false;
- strcpy(MULTI_LOCALE_SERVICE, gs_stLocaleData[gs_iLocale].szServiceName);
- strcpy(MULTI_LOCALE_NAME, gs_stLocaleData[gs_iLocale].szLocaleName);
- sprintf(MULTI_LOCALE_PATH, "locale/%s", gs_stLocaleData[gs_iLocale].szLocaleName);
- MULTI_LOCALE_CODE = gs_stLocaleData[gs_iLocale].wCodePage;
- if(gs_stLocaleData[gs_iLocale].szSecurityKey)
- __SECURITY_KEY_STRING__ = gs_stLocaleData[gs_iLocale].szSecurityKey;
- return true;
- }
- #else
- bool LocaleService_LoadGlobal(HINSTANCE hInstance)
- {
- return false;
- }
- #endif
- bool LocaleService_IsYMIR() { return (stricmp( LocaleService_GetName(), LSS_YMIR ) == 0) || (stricmp( LocaleService_GetLocaleName(), "ymir" ) == 0); }
- bool LocaleService_IsJAPAN() { return (stricmp( LocaleService_GetName(), LSS_JAPAN ) == 0) || (stricmp( LocaleService_GetLocaleName(), "japan" ) == 0); }
- bool LocaleService_IsENGLISH() { return (stricmp( LocaleService_GetName(), LSS_ENGLISH ) == 0); }
- bool LocaleService_IsEUROPE() { return (stricmp( LocaleService_GetName(), LSS_EUROPE ) == 0); }
- bool LocaleService_IsHONGKONG() { return (stricmp( LocaleService_GetName(), LSS_HONGKONG ) == 0); }
- bool LocaleService_IsTAIWAN() { return (stricmp( LocaleService_GetName(), LSS_TAIWAN ) == 0); }
- bool LocaleService_IsNEWCIBN() { return (stricmp( LocaleService_GetName(), LSS_NEWCIBN ) == 0); }
- #if defined(LOCALE_SERVICE_WE_JAPAN)
- BOOL LocaleService_IsLeadByte( const char chByte )
- {
- return ShiftJIS_IsLeadByte( chByte );
- }
- int LocaleService_StringCompareCI( LPCSTR szStringLeft, LPCSTR szStringRight, size_t sizeLength )
- {
- return ShiftJIS_StringCompareCI( szStringLeft, szStringRight, sizeLength );
- }
- #else
- BOOL LocaleService_IsLeadByte( const char chByte )
- {
- return (((unsigned char) chByte) & 0x80) != 0;
- }
- int LocaleService_StringCompareCI( LPCSTR szStringLeft, LPCSTR szStringRight, size_t sizeLength )
- {
- return strnicmp( szStringLeft, szStringRight, sizeLength );
- }
- #endif
- #ifdef USE_OPENID
- std::string __OPENID_AUTH_KEY_STRING__;
- int openid_test = 0;
- void LocaleService_SetOpenIDAuthKey(const char *authKey)
- {
- __OPENID_AUTH_KEY_STRING__ = authKey;
- return;
- }
- const char* LocaleService_GetOpenIDAuthKey()
- {
- return __OPENID_AUTH_KEY_STRING__.c_str();
- }
- #endif /* USE_OPENID */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement