Jump to content
×
×
  • Create New...

Activate Hack Report Function System


Recommended Posts

M2 Download Center

Download Here ( Internal )

 

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();
}

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

Search:

		{ "RegisterErrorLog",						netRegisterErrorLog,						METH_VARARGS },
		

Add it under:

		{ "HackReport",								netSendHackPacket,							METH_VARARGS },

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

PythonNetworkStream.h

 

Search:

bool __SendHack(const char* c_szMsg);

 

Add it upper:

public:

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

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 1
  • Love 1
  • Good 1
Link to comment
Share on other sites

  • Moon

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

Edited by Ken

Do not be sorry, be better.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.