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 "../eterpack/EterPackManager.h"
- #include "../eterLocale/Japanese.h"
- #include <windowsx.h>
- #include <windows.h>
- #include <assert.h>
- #include <tlhelp32.h>
- #include <imagehlp.h>
- #include <psapi.h>
- #include <process.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <commdlg.h>
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <vector>
- #pragma comment(lib, "psapi.lib")
- #pragma comment(lib, "imagehlp.lib")
- #pragma comment(lib, "comdlg32.lib")
- #define JUMP_TO_OFFSET(_BaseOffset, _TargetOffset) ((LONG)(_TargetOffset) - (LONG)(_BaseOffset) - 5)
- #define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
- #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
- #define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005L)
- #define SystemHandleInformation 16
- #define APP_TITLE "Metin2 (C) Actiune orientala MMORPG" //CHANGE THIS WITH THE TITLE THAT YOU WANT (REMEMBER TO CHANGE IT IN Locale.cpp)
- #define ARGUMENT "--metin2"
- bool LogMode = false;
- bool LibCheck = false;
- bool YmirWorkFolderCheck = true;
- bool ArgumentEnable = false;
- std::string AppTitle = APP_TITLE;
- std::string FromHex(const std::string& in) {
- std::string output;
- if ((in.length() % 2) != 0) {
- FILE *f=fopen("HackShield.Config.Error.txt", "w");
- fputs("[HackShield] Error while decrypting this text: ", f);
- fputs(in.c_str(), f);
- fputs("\n", f);
- fclose(f);
- exit(-1);
- return "";
- }
- size_t cnt = in.length() / 2;
- for (size_t i = 0; cnt > i; ++i) {
- unsigned long int s = 0;
- std::stringstream ss;
- ss << std::hex << in.substr(i * 2, 2);
- ss >> s;
- output.push_back(static_cast<unsigned char>(s));
- }
- return output;
- }
- std::string UltimateCipher(std::string Str) {
- char Key[3] = { 'A', 'B', 'C' };
- std::string Encrypted = Str;
- for (unsigned int i = 0; i<Str.size(); i++) Encrypted[i] = Str[i] ^ Key[i % (sizeof(Key) / sizeof(char))];
- return Encrypted;
- }
- std::string UltimateDecrypt(std::string MyString) {
- return UltimateCipher(FromHex(MyString));
- }
- std::string WhiteList[] = {
- AppTitle,
- UltimateDecrypt("022d2e312337162b2d252d34"),
- UltimateDecrypt("0d0d04"),
- UltimateDecrypt("0c010a61212c2c2f222f266329232d252e2a2f2563362b2d252d34"),
- UltimateDecrypt("0923202a112b28272f25626e610626352720352b2c2f"),
- UltimateDecrypt("0d233a24302625620b282627242c63162b2d252d34"),
- UltimateDecrypt("0e0010610d33242c040d620772066315272e31620724342a222763162b2d252d34"),
- UltimateDecrypt("060d0c03180c610c2635352c3329630434262f363061112a2f2963162b2d252d34"),
- UltimateDecrypt("05272520372f35620a0c07"),
- UltimateDecrypt("0c110015040a0c0763140b"),
- UltimateDecrypt("050b062c152a2f"),
- UltimateDecrypt("0021372834260c2d35282763162b2d252d34"),
- UltimateDecrypt("0c2b20332d302e243761142a3237222d62006a696313372d352b2e24620f28203120303a"),
- UltimateDecrypt("06060a6a6214282c272e35"),
- UltimateDecrypt("1212060406212836630f2737362d312a620637272d353163122b2d2a6214282c272e35"),
- UltimateDecrypt("022d2e312d2d242c37162b2d252d34"),
- UltimateDecrypt("092b2d35152d25"),
- UltimateDecrypt("092b2d35152d25"),
- UltimateDecrypt("122d13181d1608"),
- UltimateDecrypt("101313282c3a282c1608152d25"),
- UltimateDecrypt("3236223527012030"),
- UltimateDecrypt("06121a1e170a"),
- UltimateDecrypt("112b2d382b2d313737140b"),
- UltimateDecrypt("122d14031d1608"),
- UltimateDecrypt("0c000a2c27"),
- UltimateDecrypt("10131434202a140b142f26"),
- UltimateDecrypt("13011c080c1314161c140b"),
- UltimateDecrypt("282c333436012030"),
- UltimateDecrypt("1774160f0b10110b0e"),
- UltimateDecrypt("160c1318170a"),
- UltimateDecrypt("202b0203013031"),
- UltimateDecrypt("03232a25371c080f16080f0413"),
- UltimateDecrypt("03232a2537202f1d160812312e3a3a"),
- UltimateDecrypt("03232a25371318012f203130"),
- UltimateDecrypt("11232f2c0b2d313737140b"),
- UltimateDecrypt("05041608"),
- UltimateDecrypt("0a170d0d170d1e170a"),
- UltimateDecrypt("122d242e371c1511051e170a"),
- };
- //END CONFIGURATION OF PROTECTION
- typedef LONG NTSTATUS;
- typedef VOID *POBJECT;
- typedef PVOID CONNECTION_CONTEXT;
- typedef struct _SYSTEM_HANDLE {
- ULONG uIdProcess;
- UCHAR ObjectType;
- UCHAR Flags;
- USHORT Handle;
- POBJECT pObject;
- ACCESS_MASK GrantedAccess;
- } SYSTEM_HANDLE, *PSYSTEM_HANDLE;
- typedef struct _SYSTEM_HANDLE_INFORMATION {
- ULONG uCount;
- SYSTEM_HANDLE Handles[1];
- } SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
- typedef struct _UNICODE_STRING {
- USHORT Length;
- USHORT MaximumLength;
- PWSTR Buffer;
- } UNICODE_STRING;
- typedef UNICODE_STRING *PUNICODE_STRING;
- typedef UNICODE_STRING *POBJECT_NAME_INFORMATION;
- typedef enum _OBJECT_INFORMATION_CLASS{
- ObjectBasicInformation,
- ObjectNameInformation,
- ObjectTypeInformation,
- ObjectAllTypesInformation,
- ObjectHandleInformation
- } OBJECT_INFORMATION_CLASS;
- typedef UNICODE_STRING OBJECT_NAME_INFORMATION;
- typedef enum _THREAD_INFORMATION_CLASS2 {
- ThreadBasicInformation,
- ThreadTimes,
- ThreadPriority,
- ThreadBasePriority,
- ThreadAffinityMask,
- ThreadImpersonationToken,
- ThreadDescriptorTableEntry,
- ThreadEnableAlignmentFaultFixup,
- ThreadEventPair,
- ThreadQuerySetWin32StartAddress,
- ThreadZeroTlsCell,
- ThreadPerformanceCount,
- ThreadAmILastThread,
- ThreadIdealProcessor,
- ThreadPriorityBoost,
- ThreadSetTlsArrayAddress,
- ThreadIsIoPending,
- ThreadHideFromDebugger
- } THREAD_INFORMATION_CLASS2, *PTHREAD_INFORMATION_CLASS2;
- void __fastcall Frankie_Hook(PVOID TargetFunction, PVOID Trampoline, PVOID DetouredFunction, DWORD CP_SIZE);
- typedef const UNICODE_STRING *PCUNICODE_STRING;
- typedef int (WINAPI *WINSTATERMINATEPROC)(HANDLE hServer, DWORD dwProcessId, UINT uExitCode);
- typedef NTSTATUS(WINAPI *NtQueryInformationThreadT)(HANDLE, ULONG, PVOID, ULONG, PULONG);
- typedef NTSTATUS(WINAPI *tNTQSI)(DWORD SystemInformationClass, PVOID SystemInformation, DWORD SystemInformationLength, PDWORD ReturnLength);
- typedef NTSTATUS(WINAPI *tNTQO)(HANDLE ObjectHandle, OBJECT_INFORMATION_CLASS ObjectInformationClass, PVOID ObjectInformation, DWORD Length, PDWORD ResultLength);
- void WINAPI NewDebugRemoteBreakin(void);
- void WINAPI CheckThread(void);
- PVOID pLoadLibraryA;
- PVOID pLoadLibraryW;
- PVOID pLdrLoadDll;
- PVOID pHookLdrLoadDll;
- HMODULE hKernel32;
- HMODULE hNtdll;
- HMODULE hWinsta;
- HANDLE WindowThread = NULL;
- HANDLE GuardHandle1 = NULL;
- HANDLE GuardHandle2 = NULL;
- extern bool BobFound = false;
- inline void Anti_Debugger()
- {
- DWORD oldProtect;
- HMODULE hNtdll = GetModuleHandle(UltimateDecrypt("2f36272d2e6d252e2f").c_str());
- PVOID NewDebuggerRemoteBreakin = NewDebugRemoteBreakin;
- BYTE Buffer[5] = { 0xE9, 0x00, 0x00, 0x00, 0x00 };
- PVOID DebugRemoteBreakin = GetProcAddress(hNtdll, UltimateDecrypt("052024142b11242f2c3527013327222a2b2d").c_str());
- if (!DebugRemoteBreakin) { exit(0); return; }
- else{
- *(LONG*)(Buffer + 1) = JUMP_TO_OFFSET(DebugRemoteBreakin, NewDebuggerRemoteBreakin);
- VirtualProtect(DebugRemoteBreakin, 5, PAGE_EXECUTE_READWRITE, &oldProtect);
- RtlMoveMemory(DebugRemoteBreakin, Buffer, 5);
- VirtualProtect(DebugRemoteBreakin, 5, oldProtect, &oldProtect);
- }
- }
- void WINAPI NewDebugRemoteBreakin(void)
- {
- hWinsta = LoadLibraryA(UltimateDecrypt("362b2d3236226f262f2d").c_str());
- WINSTATERMINATEPROC WinStationTerminateProcess = (WINSTATERMINATEPROC)GetProcAddress(hWinsta, UltimateDecrypt("162b2d123622352b2c2f1626332f2a2f23372412312e21263231").c_str());
- WinStationTerminateProcess(NULL, GetCurrentProcessId(), DBG_TERMINATE_PROCESS);
- ExitProcess(DBG_TERMINATE_PROCESS);
- }
- __declspec(naked) NTSTATUS HookLdrLoadDll()
- {
- __asm
- {
- PUSHAD
- CALL CheckThread
- POPAD
- JMP pHookLdrLoadDll
- }
- }
- void __fastcall Frankie_Hook(PVOID TargetFunction, PVOID Trampoline, PVOID DetouredFunction, DWORD CP_SIZE)
- {
- DWORD OldProtect;
- VirtualProtect(TargetFunction, CP_SIZE, PAGE_EXECUTE_READWRITE, &OldProtect);
- RtlMoveMemory(Trampoline, TargetFunction, CP_SIZE);
- LPBYTE JmpOffset = (LPBYTE)Trampoline + CP_SIZE;
- *JmpOffset = (BYTE)0xE9;
- *(PLONG)(JmpOffset + 1) = JUMP_TO_OFFSET(JmpOffset, (LPBYTE)TargetFunction + CP_SIZE);
- JmpOffset = (LPBYTE)TargetFunction;
- *JmpOffset = (BYTE)0xE9;
- *(PLONG)(JmpOffset + 1) = JUMP_TO_OFFSET(JmpOffset, DetouredFunction);
- VirtualProtect(TargetFunction, CP_SIZE, OldProtect, &OldProtect);
- }
- 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);
- }
- void WINAPI CheckThread()
- {
- PVOID addr;
- ULONG tid = GetCurrentThreadId();
- if (tid == NULL) return;
- NtQueryInformationThreadT NtQueryInfThread;
- NtQueryInfThread = (NtQueryInformationThreadT)GetProcAddress(hNtdll, UltimateDecrypt("0f3612342731380b2d272d312c2337282d2d152a31242327").c_str());
- if (!NtQueryInfThread) return;
- HANDLE h = OpenThread(THREAD_QUERY_INFORMATION, FALSE, tid);
- if (!h) return;
- NTSTATUS s = NtQueryInfThread(h, ThreadQuerySetWin32StartAddress, &addr, sizeof(addr), NULL);
- CloseHandle(h);
- if (addr == (PVOID)pLoadLibraryA || addr == (PVOID)pLoadLibraryW) ExitThread(0);
- }
- inline void Anti_DLLInjection()
- {
- hNtdll = GetModuleHandle(UltimateDecrypt("2f36272d2e6d252e2f").c_str());
- if (!hNtdll) { exit(0); return; }
- hKernel32 = GetModuleHandleA(UltimateDecrypt("2a27312f272f72706d252e2f").c_str());
- if (!hKernel32) { exit(0); return; }
- pLoadLibraryA = GetProcAddress(hKernel32, UltimateDecrypt("0d2d22250e2a233022333b02").c_str());
- if (!pLoadLibraryA) { exit(0); return; }
- pLoadLibraryW = GetProcAddress(hKernel32, UltimateDecrypt("0d2d22250e2a233022333b14").c_str());
- if (!pLoadLibraryW) { exit(0); return; }
- pLdrLoadDll = GetProcAddress(hNtdll, UltimateDecrypt("0d26310d2d2225062f2d").c_str());
- if (!pLdrLoadDll) { exit(0); return; }
- pHookLdrLoadDll = VirtualAlloc(NULL, 10, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
- Frankie_Hook(pLdrLoadDll, pHookLdrLoadDll, HookLdrLoadDll, 5);
- }
- template <typename T>
- string ToString(T val)
- {
- stringstream stream;
- stream << val;
- return stream.str();
- }
- inline void Report(std::string Application)
- {
- FILE *f = fopen(UltimateDecrypt("0923202a312b28272f256c0633302c336c373936").c_str(), "w");
- fputs(std::string(UltimateDecrypt("1a0a22222910292b262d261e61060f0d620a2f282622362a2e2c6325273724213724266f61212f2e312661362b2831632032337b62") + Application + std::string("\n")).c_str(), f);
- fclose(f);
- exit(0);
- }
- inline long crc(std::string Filename) {
- FILE *f;
- if ((f = fopen(Filename.c_str(), "rb")) == NULL) return 0;
- unsigned long size;
- fseek(f, 0, SEEK_END);
- size = ftell(f);
- fseek(f, 0, SEEK_SET);
- unsigned char *File = new (std::nothrow) unsigned char[size];
- fread(File, 1, size, f);
- fclose(f);
- unsigned long crc[256];
- for (unsigned int i = 0; i <= 0xFF; i++) {
- unsigned long coso = 0;
- unsigned long I = i;
- for (unsigned int b = 1; b<9; b++) {
- if (I & 1) coso |= 1 << (8 - b);
- I >>= 1;
- }
- crc[i] = coso << 24;
- for (unsigned int c = 0; c<8; c++) crc[i] = (crc[i] << 1) ^ (crc[i] & (1 << 31) ? 0x04c11db7 : 0);
- unsigned long coso2 = 0;
- unsigned long Ii = crc[i];
- for (unsigned int d = 1; d<33; d++) {
- if (Ii & 1) coso2 |= 1 << (32 - d);
- Ii >>= 1;
- }
- crc[i] = coso2;
- }
- unsigned long Crc = 0xffffffff;
- for (unsigned int i = 0; i<size; i++) Crc = (Crc >> 8) ^ crc[(Crc & 0xFF) ^ File[i]];
- delete[] File;
- return Crc ^ 0xffffffff;
- }
- 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];
- char Class[200];
- GetWindowTextA(hnd, Win, 200);
- GetClassNameA(hnd, Class, 200);
- if (!InWhiteList(std::string(Win)) && strcmp(Class, UltimateDecrypt("352d2c2d362a31311c222e2232317073").c_str()) != 0) {
- Report(std::string(Win));
- }
- }
- 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) {
- Report(UltimateDecrypt("11302c05232e202526610a22222963072d362f26").c_str());
- }
- }
- }
- }
- }
- 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);
- ResumeThread(WindowThread);
- ResumeThread(GuardHandle1);
- ResumeThread(GuardHandle2);
- Sleep(1000);
- goto C;
- }
- inline void BlockYmirWork()
- {
- if (GetSystemMetrics(SM_CLEANBOOT) != 0) CloseApp(UltimateDecrypt("182d366121222f653761322f203b63362b37296237292b30612f2c25276d611730246261143126336f0e2e26266362332d272232276d").c_str());
- if (YmirWorkFolderCheck) {
- 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();
- }
- }
- }
- bool file_exists(const std::string& name) {
- if (FILE *file = fopen(name.c_str(), "r")) {
- fclose(file);
- return true;
- } else {
- return false;
- }
- }
- inline bool CheckBotExp(){
- char wname[200];
- HWND w = FindWindowA(UltimateDecrypt("0037372e0a2c35292638").c_str(), NULL);
- GetWindowTextA(w, wname, 200);
- return file_exists(wname);
- }
- // bool CheckInjectorGadget(){
- // if (FindWindowA(UltimateDecrypt("363a14282c272e350d13").c_str(), NULL)) return true; else return false;
- // }
- inline void DetectFiles()
- {
- Restart:
- Pids.pid = GetCurrentProcessId();
- EnumWindows(WindowList, (LPARAM)&Pids);
- if (BobFound) Report(UltimateDecrypt("0c70010e006336233061242c342c27616f63002c37286f0e73002c236213332d37242137282d2d616a00686271717374"));
- // if (CheckInjectorGadget()) Report(UltimateDecrypt("082c292421372e306306232726273761042c342c2760"));
- if (CheckBotExp()) Report(UltimateDecrypt("082c3524212661262a61232d25233124623034622a2f242c332526612363322122332b20203026612b63030d1761071b1162252036372862202e2e6322372f2e62202e2f266133362431372e6e6331272d322363206224282d2020302661212c3330263536222c272d3527637b6b"));
- if (FindWindowA(UltimateDecrypt("122f223336102f2b2527").c_str(), NULL)) Report(UltimateDecrypt("0923202a62213862022d270d24366367621320312861102a2d273520362260"));
- if (FindWindowA(UltimateDecrypt("0e0e0f18060106").c_str(), NULL)) Report(UltimateDecrypt("0e0e0f18060106").c_str());
- if (FindWindowA(UltimateDecrypt("162b2d0520240730222c27002d233032").c_str(), NULL)) Report(UltimateDecrypt("0e0e0f18060106").c_str());
- if (FindWindowA(NULL, UltimateDecrypt("0a27312f272f610626352720352b35246235706c776f73637b7863123b3035272e610b272d276311302c22273032").c_str())) Report(UltimateDecrypt("11302c22273032620639322f2e3026336211282e263723372e63").c_str());
- if (FindWindowA(NULL, UltimateDecrypt("0030376b0f2c6b2c2638").c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("020a70757563720c04700c70")) + std::string(" 9.9")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.3")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.4")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.5")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.6")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.7")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.8")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 5.9")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.0")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.1")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.2")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.3")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.4")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.5")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.6")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.7")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.8")).c_str())) Report(UltimateDecrypt("022a26203663042c24282c26").c_str());
- if (FindWindowA(NULL, std::string(std::string(UltimateDecrypt("022a26203663042c24282c26")) + std::string(" 6.9")).c_str())) Report(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) {
- Report(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) {
- Report(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) {
- Report(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) {
- Report(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) {
- Report(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) {
- Report(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) {
- Report(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) {
- Report(FileC.c_str());
- }
- }
- }
- FindClose(Cur);
- BlockYmirWork();
- Symbols();
- Sleep(2000);
- goto Restart;
- }
- void Protection()
- {
- //DeleteFileA(UltimateDecrypt("0923202a312b28272f256c0633302c336c373936").c_str());
- if (ArgumentEnable) if (strstr(GetCommandLineA(), ARGUMENT) == NULL) exit(0);
- BlockYmirWork();
- Anti_DLLInjection();
- Anti_Debugger();
- WindowThread = CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(DetectFiles), 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);
- }
- 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
- Protection();
- 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( CEterPackManager::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( CEterPackManager::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