Active Member Koray 2014 Posted June 21, 2015 Active Member Share Posted June 21, 2015 M2 Download Center This is the hidden content, please Sign In or Sign Up ( 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(); } Search: { "RegisterErrorLog", netRegisterErrorLog, METH_VARARGS }, Add it under: { "HackReport", netSendHackPacket, METH_VARARGS }, PythonNetworkStream.h Search: bool __SendHack(const char* c_szMsg); Add it upper: public: 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"); 3 1 3 Link to comment Share on other sites More sharing options...
Ken 905 Posted June 21, 2015 Share Posted June 21, 2015 (edited) 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 June 21, 2015 by Ken Do not be sorry, be better. Link to comment Share on other sites More sharing options...
Active Member Koray 2014 Posted June 21, 2015 Author Active Member Share Posted June 21, 2015 Client part added Link to comment Share on other sites More sharing options...
Active Member Koray 2014 Posted June 21, 2015 Author Active Member Share Posted June 21, 2015 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 Direct log is dangerous so have potential sql injection risk Link to comment Share on other sites More sharing options...
Recommended Posts