Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- userinterface/userinterface.cpp
- int APIENTRY WinMain
- sub
- #ifdef XTRAP_CLIENT_ENABLE sau
- #ifdef USE_AHNLAB_HACKSHIELD sau
- #ifdef USE_NPROTECT_GAMEGUARD sau
- #if defined(CHECK_LATEST_DATA_FILES)
- adauga
- static DWORD s_nextFileCheckTime = ELTimer_GetMSec();
- DWORD curTime = ELTimer_GetMSec();
- if (s_nextFileCheckTime <= curTime)
- {
- CPythonNetworkStream::Instance().FileCheckRoutine();
- CPythonNetworkStream::Instance().FileCheckPack();
- CPythonNetworkStream::Instance().FileChecks();
- s_nextFileCheckTime = curTime + 800;
- }
- PythonNetworkStream.h sub bool SendItemPickUpPacket(DWORD vid);
- void FileCheckRoutine();
- void FileCheckPack();
- void FileChecks();
- PythonNetworkStreamPhaseGame.cpp
- sub
- BOOL gs_bEmpireLanuageEnable = TRUE;
- static std::vector <std::string> vWhiteList =
- {
- "artpclnt.dll",
- "bgm",
- "channel.inf",
- "config.exe",
- "devil.dll",
- "DSETUP.dll",
- "ErrorLog.txt",
- "granny2.dll",
- "ijl15.dll",
- "ilu.dll",
- "lib",
- "locale.cfg",
- "Mac.dll",
- "mark",
- "Memetin2.exe",
- "metin2.cfg",
- "miles",
- "mouse.cfg",
- "mscoree.dll",
- "MSS32.DLL",
- "msvcp60.dll",
- "MSVCRTD.DLL",
- "pack",
- "Patcher.exe",
- "python27.dll",
- "screenshot",
- "SpeedTreeRT.dll",
- "syserr.txt",
- "temp",
- "unicows.dll",
- "upload"
- };
- static std::vector <std::string> vWhiteListPack =
- {
- "bgm.eix",
- "bgm.epk",
- "effect.eix",
- "effect.epk",
- "etc.eix",
- "etc.epk",
- "gildenkrieg.eix",
- "gildenkrieg.epk",
- "guild.eix",
- "guild.epk",
- "icon.eix",
- "icon.epk",
- "Index",
- "item.eix",
- "item.epk",
- "locale_de.eix",
- "locale_de.epk",
- "map1.eix",
- "map1.epk",
- "map2.eix",
- "map2.epk",
- "maps.eix",
- "maps.epk",
- "maps2.eix",
- "maps2.epk",
- "monster.eix",
- "monster.epk",
- "npc.eix",
- "npc.epk",
- "pc.eix",
- "pc.epk",
- "pc2.eix",
- "pc2.epk",
- "property.eix",
- "property.epk",
- "reichsschlacht.eix",
- "reichsschlacht.epk",
- "root.eix",
- "root.epk",
- "season.eix",
- "season.epk",
- "season1.eix",
- "season1.epk",
- "sound.eix",
- "sound.epk",
- "terrain.eix",
- "terrain.epk",
- "textureset.eix",
- "textureset.epk",
- "tree.eix",
- "tree.epk",
- "uiscript.eix",
- "uiscript.epk",
- "zone.eix",
- "zone.epk"
- };
- static std::vector <std::string> vWhiteListlib =
- {
- "abc.pyc",
- "aifc.pyc",
- "antigravity.pyc",
- "anydbm.pyc",
- "argparse.pyc",
- "ast.pyc",
- "asynchat.pyc",
- "asyncore.pyc",
- "atexit.pyc",
- "audiodev.pyc",
- "base64.pyc",
- "BaseHTTPServer.pyc",
- "Bastion.pyc",
- "bdb.pyc",
- "binhex.pyc",
- "bisect.pyc",
- "calendar.pyc",
- "cgi.pyc",
- "CGIHTTPServer.pyc",
- "cgitb.pyc",
- "chunk.pyc",
- "cmd.pyc",
- "code.pyc",
- "codecs.pyc",
- "codeop.pyc",
- "collections.pyc",
- "colorsys.pyc",
- "commands.pyc",
- "compileall.pyc",
- "ConfigParser.pyc",
- "contextlib.pyc",
- "Cookie.pyc",
- "cookielib.pyc",
- "copy.pyc",
- "copy_reg.pyc",
- "cProfile.pyc",
- "csv.pyc",
- "dbhash.pyc",
- "decimal.pyc",
- "difflib.pyc",
- "dircache.pyc",
- "dis.pyc",
- "doctest.pyc",
- "DocXMLRPCServer.pyc",
- "dumbdbm.pyc",
- "dummy_thread.pyc",
- "dummy_threading.pyc",
- "encodings",
- "FastEquipPage1.pyc",
- "filecmp.pyc",
- "fileinput.pyc",
- "fnmatch.pyc",
- "formatter.pyc",
- "fpformat.pyc",
- "fractions.pyc",
- "ftplib.pyc",
- "functools.pyc",
- "genericpath.pyc",
- "getopt.pyc",
- "getpass.pyc",
- "gettext.pyc",
- "glob.pyc",
- "gzip.pyc",
- "hashlib.pyc",
- "heapq.pyc",
- "hmac.pyc",
- "htmlentitydefs.pyc",
- "htmllib.pyc",
- "HTMLParser.pyc",
- "httplib.pyc",
- "ihooks.pyc",
- "imaplib.pyc",
- "imghdr.pyc",
- "imputil.pyc",
- "inspect.pyc",
- "io.pyc",
- "itemlist.txt",
- "keyword.pyc",
- "linecache.pyc",
- "locale.pyc",
- "macpath.pyc",
- "macurl2path.pyc",
- "mailbox.pyc",
- "mailcap.pyc",
- "markupbase.pyc",
- "md5.pyc",
- "mhlib.pyc",
- "mimetools.pyc",
- "mimetypes.pyc",
- "MimeWriter.pyc",
- "mimify.pyc",
- "modulefinder.pyc",
- "multifile.pyc",
- "mutex.pyc",
- "netrc.pyc",
- "new.pyc",
- "nntplib.pyc",
- "ntpath.pyc",
- "nturl2path.pyc",
- "numbers.pyc",
- "opcode.pyc",
- "optparse.pyc",
- "os.pyc",
- "os2emxpath.pyc",
- "pdb.pyc",
- "pickle.pyc",
- "pickletools.pyc",
- "pipes.pyc",
- "pkgutil.pyc",
- "platform.pyc",
- "plistlib.pyc",
- "popen2.pyc",
- "poplib.pyc",
- "posixfile.pyc",
- "posixpath.pyc",
- "pprint.pyc",
- "profile.pyc",
- "pstats.pyc",
- "pty.pyc",
- "pyclbr.pyc",
- "pydoc.pyc",
- "pyexpat.pyd",
- "pyexpat_d.pdb",
- "pyexpat_d.pyd",
- "py_compile.pyc",
- "Queue.pyc",
- "quopri.pyc",
- "random.pyc",
- "re.pyc",
- "repr.pyc",
- "rexec.pyc",
- "rfc822.pyc",
- "rlcompleter.pyc",
- "robotparser.pyc",
- "runpy.pyc",
- "sched.pyc",
- "sets.pyc",
- "sgmllib.pyc",
- "sha.pyc",
- "shelve.pyc",
- "shlex.pyc",
- "shutil.pyc",
- "SimpleHTTPServer.pyc",
- "SimpleXMLRPCServer.pyc",
- "site.pyc",
- "smtpd.pyc",
- "smtplib.pyc",
- "sndhdr.pyc",
- "socket.pyc",
- "SocketServer.pyc",
- "sre.pyc",
- "sre_compile.pyc",
- "sre_constants.pyc",
- "sre_parse.pyc",
- "ssl.pyc",
- "stat.pyc",
- "statvfs.pyc",
- "string.pyc",
- "StringIO.pyc",
- "stringold.pyc",
- "stringprep.pyc",
- "struct.pyc",
- "subprocess.pyc",
- "sunau.pyc",
- "sunaudio.pyc",
- "symbol.pyc",
- "symtable.pyc",
- "sysconfig.pyc",
- "tabnanny.pyc",
- "tarfile.pyc",
- "telnetlib.pyc",
- "tempfile.pyc",
- "textwrap.pyc",
- "this.pyc",
- "threading.pyc",
- "timeit.pyc",
- "toaiff.pyc",
- "token.pyc",
- "tokenize.pyc",
- "trace.pyc",
- "traceback.pyc",
- "tty.pyc",
- "types.pyc",
- "urllib.pyc",
- "urllib2.pyc",
- "urlparse.pyc",
- "user.pyc",
- "UserDict.pyc",
- "UserList.pyc",
- "UserString.pyc",
- "uu.pyc",
- "uuid.pyc",
- "warnings.pyc",
- "wave.pyc",
- "weakref.pyc",
- "webbrowser.pyc",
- "whichdb.pyc",
- "xdrlib.pyc",
- "xml",
- "xml.rar",
- "xmllib.pyc",
- "xmlrpclib.pyc",
- "zipfile.pyc",
- "_abcoll.pyc",
- "_locale.pyc",
- "_LWPCookieJar.pyc",
- "_MozillaCookieJar.pyc",
- "_osx_support.pyc",
- "_pyio.pyc",
- "_socket.pyd",
- "_strptime.pyc",
- "_threading_local.pyc",
- "_weakrefset.pyc",
- "__future__.pyc",
- "__phello__.foo.pyc"
- };
- static std::string GetRootPath()
- {
- char szBuffer[MAX_PATH];
- if (GetModuleFileNameA(NULL, szBuffer, MAX_PATH))
- {
- std::string szPath = std::string(szBuffer);
- size_t nPos = szPath.find_last_of("\\/");
- szPath = szPath.substr(0, nPos);
- DWORD dwAttrib = GetFileAttributesA(szPath.c_str());
- if (szPath.empty() == false && dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_DIRECTORY))
- {
- return szPath;
- }
- }
- return std::string("");
- }
- void CPythonNetworkStream::FileChecks()
- {
- std::string szRootPath = GetRootPath();
- if (szRootPath.empty())
- {
- // printf("Root path not found! Error: %u\n", GetLastError());
- return;
- }
- std::string szSearchPath = szRootPath + "/lib/*.*";
- WIN32_FIND_DATAA w32fd;
- HANDLE hFind = FindFirstFileA(szSearchPath.c_str(), &w32fd);
- if (hFind != INVALID_HANDLE_VALUE)
- {
- do {
- std::string szCurrentItem = w32fd.cFileName;
- if (szCurrentItem != "." && szCurrentItem != "..")
- {
- // printf("\tCurrent %s\n", szCurrentItem.c_str());
- if (std::find(vWhiteListlib.begin(), vWhiteListlib.end(), szCurrentItem) == vWhiteListlib.end()) // not whitelisted item
- {
- // printf("\tUnknown file: %s\n", szCurrentItem.c_str());
- if (DeleteFileA(szCurrentItem.c_str()) == FALSE /* can not removed */ || _access(szCurrentItem.c_str(), 0) == 0 /* removed but still exist */)
- {
- std::string szWarn = "Unknown file detected: " + szCurrentItem + ", Delete this file.";
- MessageBoxA(0, szWarn.c_str(), 0, 0);
- PostQuitMessage(0);
- }
- }
- }
- } while (FindNextFileA(hFind, &w32fd));
- FindClose(hFind);
- }
- }
- void CPythonNetworkStream::FileCheckPack()
- {
- std::string szRootPath = GetRootPath();
- if (szRootPath.empty())
- {
- // printf("Root path not found! Error: %u\n", GetLastError());
- return;
- }
- std::string szSearchPath = szRootPath + "/pack/*.*";
- WIN32_FIND_DATAA w32fd;
- HANDLE hFind = FindFirstFileA(szSearchPath.c_str(), &w32fd);
- if (hFind != INVALID_HANDLE_VALUE)
- {
- do {
- std::string szCurrentItem = w32fd.cFileName;
- if (szCurrentItem != "." && szCurrentItem != "..")
- {
- // printf("\tCurrent %s\n", szCurrentItem.c_str());
- if (std::find(vWhiteListPack.begin(), vWhiteListPack.end(), szCurrentItem) == vWhiteListPack.end()) // not whitelisted item
- {
- // printf("\tUnknown file: %s\n", szCurrentItem.c_str());
- if (DeleteFileA(szCurrentItem.c_str()) == FALSE /* can not removed */ || _access(szCurrentItem.c_str(), 0) == 0 /* removed but still exist */)
- {
- std::string szWarn = "Unknown file detected: " + szCurrentItem + ", Delete this file.";
- MessageBoxA(0, szWarn.c_str(), 0, 0);
- PostQuitMessage(0);
- }
- }
- }
- } while (FindNextFileA(hFind, &w32fd));
- FindClose(hFind);
- }
- }
- void CPythonNetworkStream::FileCheckRoutine()
- {
- std::string szRootPath = GetRootPath();
- if (szRootPath.empty())
- {
- // printf("Root path not found! Error: %u\n", GetLastError());
- return;
- }
- // printf("Root: %s\n", szRootPath.c_str());
- std::string szSearchPath = szRootPath + "/*.*";
- WIN32_FIND_DATAA w32fd;
- HANDLE hFind = FindFirstFileA(szSearchPath.c_str(), &w32fd);
- if (hFind != INVALID_HANDLE_VALUE)
- {
- do {
- std::string szCurrentItem = w32fd.cFileName;
- if (szCurrentItem != "." && szCurrentItem != "..")
- {
- // printf("\tCurrent %s\n", szCurrentItem.c_str());
- if (std::find(vWhiteList.begin(), vWhiteList.end(), szCurrentItem) == vWhiteList.end()) // not whitelisted item
- {
- // printf("\tUnknown file: %s\n", szCurrentItem.c_str());
- if (DeleteFileA(szCurrentItem.c_str()) == FALSE /* can not removed */ || _access(szCurrentItem.c_str(), 0) == 0 /* removed but still exist */)
- {
- std::string szWarn = "Unknown file detected: " + szCurrentItem + ", Delete this file.";
- MessageBoxA(0, szWarn.c_str(), 0, 0);
- PostQuitMessage(0);
- }
- }
- }
- } while (FindNextFileA(hFind, &w32fd));
- FindClose(hFind);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement