martysama0134

Developer
  • Content Count

    360
  • Joined

  • Last visited

  • Days Won

    65

martysama0134 last won the day on February 20

martysama0134 had the most liked content!

Community Reputation

919 Unstoppable

About martysama0134

  • Rank
    Noble

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. martysama0134

    python [Py] Metin2 - Color formatter class

    reformatted + passable hex value as arg https://gist.github.com/martysama0134/d35e7354dadb93da6a65948a0d13f341
  2. martysama0134

    [SMALL RELEASE] Same IP Detection

    moved to: https://gist.github.com/martysama0134/806626cbf1ad6dee2a504f8aabbb9677 Added somewhere (even .h) inline bool ch_compare_ip(LPCHARACTER ch1, LPCHARACTER ch2) { if (!ch1 || !ch2 || !ch1->GetDesc() || !ch2->GetDesc()) return false; const std::string ip1 = ch1->GetDesc()->GetHostName(); const std::string ip2 = ch2->GetDesc()->GetHostName(); return (ip1.compare(ip2) == 0); } or if added in char.h inside CHARACTER: inline bool CHARACTER::CompareIP(LPCHARACTER ch2) { if (!ch2 || !this->GetDesc() || !ch2->GetDesc()) return false; const std::string ip1 = this->GetDesc()->GetHostName(); const std::string ip2 = ch2->GetDesc()->GetHostName(); return (ip1.compare(ip2) == 0); }
  3. martysama0134

    c++ Mini dump generator for Windows server

    ah yes, replace Version.h with #pragma once #define VER_FILE_VERSION 1, 0, 40999, 0 #define VER_FILE_VERSION_STR "1.0.40999.1" inline int METIN2_GET_VERSION() { return 40999; } inline and pragma once were missing. I used 40999 but anything is fine. .dmp files can be debugged with visual studio, but the exact .exe, source files and .pdb files are needed, otherwise the result is junk.
  4. martysama0134

    c++ Mini dump generator for Windows server

    moved to: https://gist.github.com/martysama0134/c3644013ec6f2bd361a1c38835f518f0 Few days ago, I did something similar for the client (EterLib\error.cpp) (instead of errorlog): #define ENABLE_CRASH_MINIDUMP #ifdef ENABLE_CRASH_MINIDUMP # include "../UserInterface/Version.h" # include <iomanip> # include <sstream> void make_minidump(EXCEPTION_POINTERS * e) { auto hDbgHelp = LoadLibraryA("dbghelp"); if (hDbgHelp == nullptr) return; auto pMiniDumpWriteDump = (decltype(&MiniDumpWriteDump)) GetProcAddress(hDbgHelp, "MiniDumpWriteDump"); if (pMiniDumpWriteDump == nullptr) return; // folder name std::string folder = "logs"; CreateDirectoryA(folder.c_str(), nullptr); // time format auto t = std::time(nullptr); std::ostringstream timefmt; timefmt << std::put_time(std::localtime(&t), "%Y%m%d_%H%M%S"); // filename std::string filename = fmt::format("{}\\metin2client_{}_{}.dmp", folder, METIN2_GET_VERSION(), timefmt.str()); auto hFile = CreateFileA(filename.c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) return; MINIDUMP_EXCEPTION_INFORMATION exceptionInfo; exceptionInfo.ThreadId = GetCurrentThreadId(); exceptionInfo.ExceptionPointers = e; exceptionInfo.ClientPointers = FALSE; auto dumped = pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory), e ? &exceptionInfo : nullptr, nullptr, nullptr); CloseHandle(hFile); // std::string errMsg = "The application crashed. Send the generated file to the staff: "s + name; // MessageBox(nullptr, errMsg.c_str(), "Metin2Client", MB_ICONSTOP); return; } #endif LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS * pExceptionInfo) { #ifdef ENABLE_CRASH_MINIDUMP make_minidump(pExceptionInfo); #else // eterlog trash #endif return EXCEPTION_EXECUTE_HANDLER; } I'm not using it since I'll use crashrpt2 instead. Version without c++17&libfmt: #define ENABLE_CRASH_MINIDUMP #ifdef ENABLE_CRASH_MINIDUMP #include "../UserInterface/Version.h" #include <iomanip> #include <sstream> void make_minidump(EXCEPTION_POINTERS* e) { auto hDbgHelp = LoadLibraryA("dbghelp"); if(hDbgHelp == nullptr) return; auto pMiniDumpWriteDump = (decltype(&MiniDumpWriteDump))GetProcAddress(hDbgHelp, "MiniDumpWriteDump"); if(pMiniDumpWriteDump == nullptr) return; // folder name std::string folder = "logs"; CreateDirectoryA(folder.c_str(), nullptr); // time format auto t = std::time(nullptr); std::ostringstream timefmt; timefmt << std::put_time(std::localtime(&t), "%Y%m%d_%H%M%S"); // filename std::string filename = folder + "\\"s + "metin2client_"s + std::to_string(METIN2_GET_VERSION()) + "_"s + timefmt.str() + ".dmp"; auto hFile = CreateFileA(filename.c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if(hFile == INVALID_HANDLE_VALUE) return; MINIDUMP_EXCEPTION_INFORMATION exceptionInfo; exceptionInfo.ThreadId = GetCurrentThreadId(); exceptionInfo.ExceptionPointers = e; exceptionInfo.ClientPointers = FALSE; auto dumped = pMiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), hFile, MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory), e ? &exceptionInfo : nullptr, nullptr, nullptr); CloseHandle(hFile); // std::string errMsg = "The application crashed. Send the generated file to the staff: "s + name; // MessageBox(nullptr, errMsg.c_str(), "Metin2Client", MB_ICONSTOP); return; } #endif LONG __stdcall EterExceptionFilter(_EXCEPTION_POINTERS * pExceptionInfo) { #ifdef ENABLE_CRASH_MINIDUMP make_minidump(pExceptionInfo); #else // eterlog trash #endif return EXCEPTION_EXECUTE_HANDLER; }
  5. martysama0134

    AsyncSQL with std::mutex and std::thread

    > AsyncSQL.h This page is no longer available. It has either expired, been removed by its creator, or removed by one of the Pastebin staff.
  6. martysama0134

    open (GDB) Crash Core

    Check each DBManager::instance().DirectQuery if they are either wrapped in smart pointers (auto_ptr/unique_ptr), or freed using delete. Most of the times, it's this.
  7. martysama0134

    open (GDB) Crash Core

    It crashed when calling the new operator, which means it failed to allocate more memory over a 4gb of process (the limit of 32bit apps). Metin2 processes take 4gb of ram only when they have memory leaks. Most of the times, the memory leak comes from fetched mysql queries that didn't get freed.
  8. martysama0134

    CH3HP DDoS

    The moment you pay (a lot), other people will come to ddos you for money. Also, for €300, you can build a quite good infrastructure that mitigates ddos attacks. Narnia2 paid. He joined the owner's pc using teamviewer (to install the fake protection), he stole all of his server files, and he's now trying to resell them. He also leaked their account table already. Best trade ever. 2019 will be the year of booters. Stay tuned!
  9. You need to change some lines related to socket & fdwatch management for fixing linux. Also, as someone already said, you can install freebsd on those systems quite easily (e.g. via dual boot, but there are many alternative ways).
  10. martysama0134

    open freebsd 13.0 source compile

    The upcoming version should be 12.0 (on December). Current release: 11.2 using clang6. No 13.0. For the warning, replace all the 3 possible -mXXX with just -m32.
  11. martysama0134

    bsd libssh vulnerability(CVE-2018-10933)

    To check your libssh version, you just need to fail the command sshd by simply doing something like: sshd -v On FreeBSD 11.0 OpenSSH_7.2p2, OpenSSL 1.0.2k-freebsd 26 Jan 2017 On FreeBSD 9.3 OpenSSH_6.6.1p1, OpenSSL 0.9.8za-freebsd 5 Jun 2014 They both seem fine. https://www.cvedetails.com/cve/CVE-2018-10933/
  12. martysama0134

    solved Weird Commands

    Check my docs for those commands: https://martysama0134.github.io/m2-docs/cmd.html
  13. martysama0134

    WorldEditor ReMIX

    https://github.com/martysama0134/how-to-mt2-general/tree/master/worldeditor-dpi-fix Try to decrease the dpi to 100% from the computer panel, and if not resolved, use the manifest as well. Note: I use win10 and it works all fine
  14. martysama0134

    open databases crashes, server dont start

    Ignore him. He's just iratm shitposting again. 1) A peer can be null, and it's used when we send something without caring for an answer from db. 2) BlockCountry return type isn't handled, so even if it fails, it doesn't exit. Avenuetm didn't reply to Dr3am3r when he asked whether or not a db.core has been generated (in the thread title, it says "db crash", so we expect he got one), but he ended up giving some random likes and nothing more If he doesn't reply, mods should close this thread then. EDIT: how to read a core dump: https://github.com/martysama0134/how-to-general/blob/master/freebsd-tips/how-to-analyze-a-core-dump.md Enjoy.
  15. martysama0134

    open InnoDB or MyISAM the better?

    InnoDB is slightly faster in writing, but it gets totally corrupted very often in case of system crash or reboot (with metin2 server still running) (shutdown -r now is safe). Making Sql backups of InnoDB is mandatory if you don't want to die fast. (cold backups, if not complete, are junk with innodb) MyISAM is slightly faster in reading. MariaDB has also Aria as engine, Mysql8 improves MyISAM and InnoDB by a lot (like InnoDB with improved ACID). https://dev.mysql.com/doc/refman/8.0/en/innodb-benefits.html https://dev.mysql.com/doc/refman/8.0/en/myisam-storage-engine.html