Jump to content

Koray

Active Member
  • Posts

    384
  • Joined

  • Last visited

  • Days Won

    58
  • Feedback

    0%

Posts posted by Koray

  1. Index;

     

    self.Board(parent, moveable, x, y, width, heigh)
    self.ThinBoard(parent, moveable, x, y, width, heigh)
    self.BoardWithTitleBar(parent, moveable, x, y, width, heigh)

    self.BasicButton(parent, buttonName, x, y, func)
    self.Button(parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual)
    self.RadioButton(parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual)
    self.ToggleButton(parent, text, tooltiptext, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual)
    self.DragButton(parent, func, UpVisual, OverVisual, DownVisual)
    self.ResizeableButton(parent, x, y, width, heigh, text, tooltiptext, event)

    self.RGB(r, g,b)
    self.Box(parent, x, y, width, heigh, color)
    self.Line(parent, x, y, width, heigh, color)
    self.TextLine(parent, text, x, y)
    self.EditLine(parent, text, x, y, width, heigh, max)
    self.NumberLine(parent, path, number, x, y)
    self.ComboBox(parent, text, x, y, width)
    self.Gauge(parent, width, color, x, y)

    self.ListBox(parent, x, y, width, heigh)
    self.ListBox2(parent, x, y, width, heigh)
    self.ListBoxEx(parent, x, y, width, heigh)

    self.SlotBar(parent, x, y, width, heigh)
    self.Bar(parent, x, y, width, heigh)
    self.Bar3D(parent, x, y, width, heigh, color)
    self.TitleBar(parent, x, y, width, color, event)
    self.HorizontalBar(parent, x, y, width)
    self.SliderBar(parent, x, y, width, heigh, event)
    self.ProgressBar(parent, x, y, width, heigh, percentage)
    self.ScrollBar(parent, width, heigh)

    self.ImageBox(parent, image, x, y)
    self.AniImageBox(parent, image, x, y)
    self.ExpandedImageBox(parent, image, x, y, min, max)

    self.SlotWindow(parent, x, y, width, heigh, emptyevent, selectItemEvent, itemInEvent, ItemOutEvent)
    self.GridSlotWindow(parent, ItemInEvent, ItemOutEvent, x, y, width, heigh, SlotStartIndex, SlotXCount, SlotYCount, SlotXStep, SlotYStep, SlotXBlank, SlotYBlank)

    self.Popup(text, width, acceptevent)
    self.Input(text, length, acceptevent, cancelevent)
    self.InputDescription(text, description,length, acceptevent, cancelevent)
    self.InputDescription2(text, description, description2, length, acceptevent, cancelevent)
    self.Question(text, width, acceptevent, cancelevent)
    self.Question2(text, text2, width, acceptevent, cancelevent)
    self.QuestionWithLimit(text, limit, width, acceptevent, cancelevent)

     


     

     

    Call example:

    from ui_wrapper import _ui
    veriable = _ui().TextLine(parent, text, x, y)


    Credits:

    Eigenartig
    Script:
    This is the hidden content, please
    • Metin2 Dev 1
    • Love 2
  2. M2 Download Center

    This is the hidden content, please
    This is the hidden content, please
    This is the hidden content, please
    This is the hidden content, please
    This is the hidden content, please
    This is the hidden content, please

    Anti Wait Hack:

     

    Spoiler

    Anti Safezone:

     

    Spoiler

    *char_battle.cpp

    Find:

    
    bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
    {
    	if (test_server)
    		sys_log(0, "[TEST_SERVER] Attack : %s type %d, MobBattleType %d", GetName(), bType, !GetMobBattleType() ? 0 : GetMobAttackRange());
    	//PROF_UNIT puAttack("Attack");
    	if (!CanMove())
    		return false;

    Add it under:

    
    	SECTREE	*sectree = NULL;
    	SECTREE	*vsectree = NULL;
    	sectree = GetSectree();
    	vsectree = pkVictim->GetSectree();
    
    	if (sectree && vsectree){
    		if (sectree->IsAttr(GetX(), GetY(), ATTR_BANPK) || vsectree->IsAttr(pkVictim->GetX(), pkVictim->GetY(), ATTR_BANPK)) {
    			if (GetDesc()) {
    				LogManager::instance().HackLog("ANTISAFEZONE", this);
    				GetDesc()->DelayedDisconnect(3);
    			}
    		}
    	}

     

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    Anti Ghostmode:

     

    Spoiler

    *input_main.cpp

    Find:

    
    if (!test_server)	//2012.05.15 ±è¿ë¿í : Å×¼·¿¡¼­ (¹«Àû»óÅ·Î) ´Ù¼ö ¸ó½ºÅÍ »ó´ë·Î ´Ù¿îµÇ¸é¼­ °ø°İ½Ã ÄŞº¸ÇÙÀ¸·Î Á×´Â ¹®Á¦°¡ ÀÖ¾ú´Ù.

    Add it under:

    
    		if (ch->IsPC() && ch->IsDead()) {
    			if (ch->GetDesc()) {
    				LogManager::instance().HackLog("GHOSTMODE", ch);
    				ch->GetDesc()->DelayedDisconnect(3);
    			}
    		}

     

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    Anti Wallhack:

     

    Spoiler

    *input_main.cpp

    Find:

    
    const float fDist = DISTANCE_SQRT((ch->GetX() - pinfo->lX) / 100, (ch->GetY() - pinfo->lY) / 100);

    Add it upper:

    
    		PIXEL_POSITION pos = ch->GetXYZ();
    		if (!SECTREE_MANAGER::instance().GetMovablePosition(ch->GetMapIndex(), pos.x, pos.y, pos)) {
    			if (ch->GetDesc()) {
    				LogManager::instance().HackLog("WALLHACK", ch);
    				ch->GetDesc()->DelayedDisconnect(3);
    			}
    		}

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    Anti Long name generator:

     

    Spoiler

    *input_login.cpp

    Find:

    
    	if (true == g_BlockCharCreation)
    	{
    		d->Packet(&packFailure, sizeof(packFailure));
    		return;
    	}

    Add it under:

    
    	if (strlen(pinfo->name) > 12){
    		d->Packet(&packFailure, sizeof(packFailure));
    		return;
    	}

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    #Update 1:

    -Clientside-

     

    Spoiler

    PythonPlayerModule.cpp

    
    { "SetItemData",				playerSetItemData,					METH_VARARGS },

    *Fake item creator function

    PythonItemModule.cpp

    
    { "CreateItem",						itemCreateItem,							METH_VARARGS },

    *Fake item creator function

    PythonCharacterModule.cpp

    
    { "IsGameMaster",				chrIsGameMaster,					METH_VARARGS },

    *Gm detector function

    Remove this lines, this functions isn't used anywhere

     

    -Serverside-

    Anti Mining Bot:

     

    Spoiler

    Original post(Lefloyd @epvp)

    *char.cpp

    Find:

    
    	if (mining::GetRawOreFromLoad(chLoad->GetRaceNum()) == 0)
    		return;

    Add it upper:

    
    	if (GetMapIndex() != chLoad->GetMapIndex() || DISTANCE_APPROX(GetX() - chLoad->GetX(), GetY() - chLoad->GetY()) > 1000)
    		return;

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    Fishing without water fix

     

    Spoiler

    Original post(Lefloyd @epvp)

    *char.cpp

    Find:

    
    void CHARACTER::fishing()

    Add it upper:

    
    bool CHARACTER::IsNearWater() const
    {
    	if (!GetSectree())
    		return false;
    
    	for (int x = -1; x <= 1; ++x)
    	{
    		for (int y = -1; y <= 1; ++y)
    		{
    			if (IS_SET(GetSectree()->GetAttribute(GetX() + x * 100, GetY() + y * 100), ATTR_WATER))
    				return true;
    		}
    	}
    
    	return false;
    }

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    Find:

    
    	if (m_pkFishingEvent)
    	{
    		fishing_take();
    		return;
    	}

    Add it under:

    
    	if (!IsNearWater())
    		return;

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    *char.h

    Find:

    
    void			fishing();

    Add it upper:

    
    bool			IsNearWater() const;

     

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    Anti Colorful Shop

     

    Spoiler

    *input_main.cpp

    Find:

    
    	if (uiBytes < sizeof(TPacketCGMyShop) + iExtraLen)
    		return -1;

    Add it under:

    
    	if (strstr(p->szSign, ("|c")) || strstr(p->szSign, ("|C"))){
    		LogManager::instance().HackLog("COLORFUL_SHOP", ch);
    		return (iExtraLen);
    	}

     

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    Anti Drophack

     

    Spoiler

    *char_item.cpp

    Find:

    
    LPCHARACTER owner = funcFindOwnership.owner;

    Add it under:

    
    			if (!owner) {
    				LogManager::instance().HackLog("DROPHACK", this);
    				return false;
    			}

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    #Update 2:

    -Serverside-

    Anti Fish Bot

     

    Spoiler

    *fishing.cpp

    Find:

    
    int ret = Compute(info->fish_id, ms, &item_vnum, GetFishingLevel(ch));

    Add it under:

    
    		if (!ch->GetLastFishTime())
    			ch->SetLastFishTime(ms);
    		else {
    			if (ch->GetFishHackCount() == 3) {
    				ch->ResetFishHackCount();
    				LogManager::instance().HackLog("FISHBOT", ch);
    				ch->GetDesc()->DelayedDisconnect(3);
    			}
    			else {
    				if ((ms == ch->GetLastFishTime()) || (abs(ch->GetLastFishTime() - ms) < 70) || (abs(ms - ch->GetLastFishTime()) < 70))
    					ch->UpdateFishHackCount();
    				else
    					ch->ResetFishHackCount();
    			}
    		}
    
    		if (test_server)
    			ch->ChatPacket(CHAT_TYPE_INFO, "/HACK-TEST/ Last: %d Now: %d HackCount: %d", ch->GetLastFishTime(), ms, ch->GetFishHackCount());

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    *char.cpp

    Find:

    
    m_dwMountTime = 0;

    Add it upper:

    
    	m_iLastFishTime = 0;
    	m_iFishHackCount = 0;

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    Find:

    
    void CHARACTER::ResetChatCounter()

    Add it upper:

    
    void CHARACTER::SetLastFishTime(int time)
    {
    	m_iLastFishTime = time;
    }
    
    int CHARACTER::GetLastFishTime()
    {
    	return m_iLastFishTime;
    }
    
    int CHARACTER::GetFishHackCount()
    {
    	return m_iFishHackCount;
    }
    
    void CHARACTER::UpdateFishHackCount()
    {
    	m_iFishHackCount += 1;
    }
    
    void CHARACTER::ResetFishHackCount()
    {
    	m_iFishHackCount = 0;
    }

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

    *char.h

    Find:

    
    DWORD GetSkipComboAttackByTime() const;

    Add it under:

    
    		int GetFishHackCount();
    		void UpdateFishHackCount();
    		void ResetFishHackCount();
    		void SetLastFishTime(int time);
    		int GetLastFishTime();

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    Find:

    
    DWORD m_dwSkipComboAttackByTime;

    Add it under:

    
    		int m_iFishHackCount;
    		int m_iLastFishTime;

     

    Anti Guild Maker(low level)

     

    Spoiler

    *input_main.cpp

    Find:

    
    	if (ch->GetGold() < 200000)
    		return;

    Add it under:

    
    	if (ch->GetLevel() < 40)
    	{
    		LogManager::instance().HackLog("GUILDMAKER", ch);
    		ch->GetDesc()->DelayedDisconnect(3);
    		return;
    	}

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

     

    Activate Anti Teleport Hack

     

    Spoiler

    *input_main.cpp

    Find:

    
    			if( false == LC_IsEurope() )
    			{
    				const PIXEL_POSITION & warpPos = ch->GetWarpPosition();
    
    				if (warpPos.x == 0 && warpPos.y == 0)
    					LogManager::instance().HackLog("Teleport", ch); // ºÎÁ¤È®ÇÒ ¼ö ÀÖÀ½
    			}
    
    			sys_log(0, "MOVE: %s trying to move too far (dist: %.1fm) Riding(%d)", ch->GetName(), fDist, ch->IsRiding());
    
    			ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
    			ch->Stop();
    			return;

    Change:

    
    			const PIXEL_POSITION & warpPos = ch->GetWarpPosition();
    
    			if (warpPos.x == 0 && warpPos.y == 0)
    				LogManager::instance().HackLog("Teleport", ch); // ºÎÁ¤È®ÇÒ ¼ö ÀÖÀ½
    
    			sys_log(0, "MOVE: %s trying to move too far (dist: %.1fm) Riding(%d)", ch->GetName(), fDist, ch->IsRiding());
    
    			ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
    			ch->Stop();
    			ch->GetDesc()->DelayedDisconnect(0);
    			return;

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

     

     

    -Clientside-

    Activate py inject protection

     

    Spoiler

     

    Anti Anti Stun & Anti Visual GM Effect

     

    Spoiler

    *PythonCharacterManagerModule.cpp

    Remove:

    
    { "SetAffect",					chrmgrSetAffect,						METH_VARARGS },

     

     

    Anti Attackspeed & Anti Movespeed

     

    Spoiler

    *PythonCharacterModule.cpp

    Remove this lines:

    
    		{ "SetMoveSpeed",					chrSetMoveSpeed,					METH_VARARGS },
    		{ "SetAttackSpeed",					chrSetAttackSpeed,					METH_VARARGS },

     

     

     

    This thread subjects enough for general cheats
    For better bot and script cheat security change module or function names
    For this here basic tutorial for change net module name

     

    Spoiler

    *PythonNetworkStreamModule.cpp

    Search:

    
    PyObject* poModule = Py_InitModule("net", s_methods);

    Change to yourselves, example:

    
    PyObject* poModule = Py_InitModule("mt2net", s_methods);

     

    Now, Open your all python scripts with Notepad++

    Press CTRL+H Open Replace tab

    Write to "Find what": import net

    Write to "Replace with": import mt2net as net

    Save your all scripts and enjoy

     

    • Metin2 Dev 88
    • kekw 1
    • Eyes 3
    • Dislove 2
    • Sad 1
    • Cry 1
    • Think 1
    • Confused 1
    • Good 36
    • Love 6
    • Love 90
  3. Client:

    *Packet.h

    typedef struct command_client_version
    {
    	BYTE header;
    	char filename[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion;
    
    typedef struct command_client_version2
    {
    	BYTE header;
    	char filename[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion2;

    Change:

    typedef struct command_client_version
    {
    	BYTE header;
    	char filename[32+1];
    	char filesize[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion;
    
    typedef struct command_client_version2
    {
    	BYTE header;
    	char filename[32+1];
    	char filesize[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion2;

     

    *PythonNetworkStreamPhaseGame.cpp

    Search

    bool CPythonNetworkStream::SendClientVersionPacket()

    Add it upper

    static const char* GetMainFileSize(const char* FileName) {
    	std::string sizebuf;
    	HANDLE hFile = CreateFileA(FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    	sizebuf = GetFileSize(hFile, NULL);
    	return sizebuf.c_str();
    }

     

    Search /2x/

    strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1);

    Add it under /2x/

    strncpy(kVersionPacket.filesize, GetMainFileSize(filename.c_str()), sizeof(kVersionPacket.filename)-1);

     

    Server:

    *Packet.h

    typedef struct command_client_version
    {
    	BYTE header;
    	char filename[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion;
    
    typedef struct command_client_version2
    {
    	BYTE header;
    	char filename[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion2;

    Change:

    typedef struct command_client_version
    {
    	BYTE header;
    	char filename[32+1];
    	char filesize[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion;
    
    typedef struct command_client_version2
    {
    	BYTE header;
    	char filename[32+1];
    	char filesize[32+1];
    	char timestamp[32+1];
    } TPacketCGClientVersion2;

     

    *input.cpp

    Search:

    void CInputProcessor::Version(LPCHARACTER ch, const char* c_pData)
    {
    	if (!ch)
    		return;
    
    	TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData;

    Add it under

    	if (strcmp(p->filesize, "CORRECT_SIZE")){
    		ch->ChatPacket(CHAT_TYPE_NOTICE, "Illegal login detected");
    		LogManager::instance().HackLog("CLIENT_CONFLICT", ch);
    		ch->GetDesc()->SetPhase(PHASE_CLOSE);
    		return;
    	}

    Change CORRECT_SIZE to yourself as string

    untested

    • Love 2
  4. #include <Windows.h>
    
    void Starter(){
    	DWORD pRet[] = { 0x31, 0xC0, 0xC3 };
    	WriteProcessMemory(GetCurrentProcess(), (LPVOID)(VOID*)GetProcAddress(GetModuleHandleA((LPCSTR)"python22.dll"), "PyRun_SimpleFile"), (LPVOID)pRet, sizeof(pRet), 0);
    }
    
    BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    	if(ul_reason_for_call == 1)
    		Starter();
    	return TRUE;
    }

     

    Detours always isn't required

    • Love 1
  5. Create new user for localhost and set privileges after change with this 

    PLAYER_SQL: 127.0.0.1 crn2OjF !23@ player
    COMMON_SQL: 127.0.0.1 crn2OjF !23@ common
    LOG_SQL: 127.0.0.1 crn2OjF !23@ log

    and don't forget conf.txt

    SQL_ACCOUNT = "127.0.0.1 account acc pass 0"
    SQL_PLAYER = "127.0.0.1 player acc pass 0"
    SQL_COMMON = "127.0.0.1 common acc pass 0"
    SQL_HOTBACKUP = "127.0.0.1 hotbackup acc pass 0"

     

    • Love 2
  6. cmd_gm.cpp

    	if (tch && ch != tch)
    		tch->AddAffect(AFFECT_BLOCK_CHAT, POINT_NONE, 0, AFF_NONE, lBlockDuration, 0, true);

    change

    	if (tch && ch != tch) {
    		char buf_blchat[56];
    		snprintf(buf_blchat, sizeof(buf_blchat), "BLOCKCHAT FOR: %s", tch->GetName());
    		LogManager::instance().GMCommandLog(ch->GetPlayerID(), ch->GetName(), ch->GetDesc()->GetHostName(), g_bChannel, buf_blchat);
    
    		tch->AddAffect(AFFECT_BLOCK_CHAT, POINT_NONE, 0, AFF_NONE, lBlockDuration, 0, true);
    	}

    not tested

  7. for syserr;

    EterBase/Debug.cpp

    This function: void TraceError(const char* c_szFormat, ...)

    Comment or remove all codes in this function

     

    for flag;

    Is easily possible with cmd

    ACMD(do_quest_flag_test){
    	ch->SetQuestFlag("questname.flag", value);
    }
    
    ACMD (do_quest_flag_test);
    
    { "quest_flag_test", do_quest_flag_test,	0,		POS_DEAD,	GM_PLAYER	},

    like this

    and call in python part 

    net.SendChatPacket("/quest_flag_test")

     

  8.  

     

    Method 1)

    Enigma plugin

    This is the hidden content, please

    This is the hidden content, please

    Dll version

    This is the hidden content, please

    This is the hidden content, please

     

    Method 2(Alternative way))

    Enigma plugin

    This is the hidden content, please

    This is the hidden content, please

    Dll version

    This is the hidden content, please

    This is the hidden content, please

    • Metin2 Dev 4
    • kekw 1
    • Eyes 1
    • Love 1
    • Love 7
  9. UserInterface/CheckLatestFiles.cpp

    Select all codes and change with this

    #include "StdAfx.h"
    #if defined(CHECK_LATEST_DATA_FILES)
    #include "CheckLatestFiles.h"
    #include "resource.h"
    
    static struct SCHECKFILELIST {
    	const char*		szFileName;
    	DWORD			dwCRC32;
    	ULONGLONG		ullSize;
    } s_astFileHashList[] = {
    	//   filename                   crc(dword)      size(ull)[optional]
    	{ "errorlog.txt",				0xf7c257a0,				135 },
    	{ "file1.py",					0xf15468a0,				169 },
    	{ "file.epk",					0xf7685410,				465 }
    	//etc.
    };
    
    static bool gs_bQuit = false;
    bool CheckLatestFiles_PollEvent( void )
    {
    	return gs_bQuit;
    }
    
    int GetFileSize(char* FileName) {
    	HANDLE hFile = CreateFileA(FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    	return GetFileSize(hFile, NULL);
    }
    
    inline bool is_file_exist(const std::string& name) {
    	struct stat buffer;
    	return (stat(name.c_str(), &buffer) == 0);
    }
    
    // 데이타 파일 CRC32 값 검사하기 //size control added
    bool CheckFileHash( const char* szFileName, DWORD dwCRC32, ULONGLONG ullFileSize = NULL)
    {
    	char szMessage[256];
    
    	if (!is_file_exist(szFileName)) {
    		_snprintf(szMessage, sizeof(szMessage)/sizeof(szMessage[0])-1, ApplicationStringTable_GetStringz(IDS_ERR_CANNOT_READ_FILE, "ERR_CANNOT_READ_FILE"), szFileName);
    		ApplicationSetErrorString(szMessage);
    		return false;
    	}
    
    	else {
    		DWORD dwLocalCRC32 = GetFileCRC32(szFileName);
    		if (dwCRC32 != dwLocalCRC32) {
    			_snprintf(szMessage, sizeof(szMessage)/sizeof(szMessage[0])-1, ApplicationStringTable_GetStringz(IDS_ERR_NOT_LATEST_FILE, "ERR_NOT_LATEST_FILE"), szFileName);
    			ApplicationSetErrorString(szMessage);
    			return false;
    		}
    		else {
    			int ullLocalSize = GetFileSize(szFileName);
    			if ( ullFileSize) {
    				if (ullLocalSize != ullFileSize) {
    					ApplicationSetErrorString(("%s size not valid", szFileName));
    					return false;
    				}
    			}
    		}
    	}
    
    	return true;
    }
    
    UINT CALLBACK CheckLatestFilesEntry(void * pThis)
    {
    	::Sleep( 500 );
    	for( int i=0; s_astFileHashList[i].szFileName; i++ ) {
    		if(s_astFileHashList[i].ullSize) {
    			if(!CheckFileHash(s_astFileHashList[i].szFileName, s_astFileHashList[i].dwCRC32, s_astFileHashList[i].ullSize)){
    				gs_bQuit = true;
    				break;
    			}
    		}
    		else {
    			if(!CheckFileHash(s_astFileHashList[i].szFileName, s_astFileHashList[i].dwCRC32)){
    				gs_bQuit = true;
    				break;
    			}
    		}
    	}
    	return true;
    }
    
    bool CheckLatestFiles( void )
    {
    	unsigned int uThreadID = 0;
    
    	HANDLE hThread = (HANDLE) _beginthreadex(NULL, 0, CheckLatestFilesEntry, NULL, 0, &uThreadID);
    	::SetThreadPriority(hThread, THREAD_PRIORITY_LOWEST);
    	return true;
    }
    #endif
    

     

     

    Now change or add

    	{ "errorlog.txt",				0xf7c257a0,				135 },
    	{ "file1.py",					0xf15468a0,				169 },
    	{ "file.epk",					0xf7685410,				465 }

    This list according to yourself(Size is optional)

     

    Now open Locale_inc.h 

    #define CHECK_LATEST_DATA_FILES

    and add this line

    • Love 2
  10. Everything is ok but why are you try to call functions from external? It was a little bit strange. What ever thanks for share.

    // Edit

    I don't like part of serverside. I wait good things from ymir/webzen games. That's my function for this.

    void CInputMain::Hack(LPCHARACTER ch, const char * c_pData)
    {
            TPacketCGHack * p = (TPacketCGHack *)c_pData;
            
            if (ch && ch->GetDesc())
            {
                    sys_log(0, "HACK REPORT SENT BY %s", ch->GetName);
                    LogManager::instance().HackLog(p->szBuf, ch);
            }
    }

    Kind Regards

    Ken

    D​irect log is dangerous so have potential sql injection risk

  11. M2 Download Center

    This is the hidden content, please
    ( Internal )

    .gif

     
    Tutorial:

    PythonNetworkStreamModule.cpp

    Search:

    PyObject* netSendMessengerAddByNamePacket(PyObject* poSelf, PyObject* poArgs)

     

    Add it upper:

    PyObject* netSendHackPacket(PyObject* poSelf, PyObject* poArgs)
    {
    	char * szMsg;
    	if (!PyTuple_GetString(poArgs, 0, &szMsg))
    		return Py_BuildException();
    
    	CPythonNetworkStream& rns=CPythonNetworkStream::Instance();
    	rns.__SendHack(szMsg);
    	
    	return Py_BuildNone();
    }

     

    .gif

     

    Search:

    		{ "RegisterErrorLog",						netRegisterErrorLog,						METH_VARARGS },
    		

    Add it under:

    		{ "HackReport",								netSendHackPacket,							METH_VARARGS },

     

    .gif

     

    PythonNetworkStream.h

     

    Search:

    bool __SendHack(const char* c_szMsg);

     

    Add it upper:

    public:

     

    .gif

     

    Usage:

    Python:

    net.HackReport("explanation_in_here")

    C++:

    Without Client Source:

    void SendReport(char* why){
    	PyObject* args = PyTuple_New(1);
    	PyTuple_SetItem(args, 0, PyString_FromString(why));
    	PyObject* ret = PyObject_Call(PyObject_GetAttrString(PyImport_ImportModule("net"), "HackReport"), args, NULL);
    
    	Py_XDECREF(ret);
    	Py_XDECREF(args);
    }
    SendReport("explanation_in_here");

    Client Source:

    #include "PythonNetworkStream.h"
    
    CPythonNetworkStream netStream;
    netStream.__SendHack("explanation_in_here");

     

    • Metin2 Dev 3
    • Good 1
    • Love 3
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.