Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: DataServers MuEMU - Anti inject SQL  (Visto 8619 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline ZabiinoOo #20 Posteado: October 19, 2018, 11:51:55 AM

  • MAESTRO

  • US. DE HONOR

  • LEYENDA

  • Administrador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 7.270
  • Gracias recibida: 125201
  • pe
hola se puede aplicar a los update4 de louis muemu s6 ?
otra consulta el codigo se ejecuta en la query? de MuOnline?

si se puede usar aunque creo que los update4 de louis ya lo tiene




Prohibido pedir soporte via MP
Leer las reglas de cada seccion
we trust god

Offline load_01 #21 Posteado: April 27, 2020, 11:21:26 AM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 335
  • Gracias recibida: 2532
  • ve
una pregunta y disculpen la molestia este fix sirve para cualquier version o es solo de s4 para arriba?


Offline demmian2 #22 Posteado: June 03, 2020, 08:32:46 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 13
  • Gracias recibida: 1
  • ar
buenos dias, este es el codigo completo de la solucion de zabino?
estoy agregando todo fix posible al source u13 de louis con las soluciones del foro.

Olvidaron Dejar el El Fix del DataServer(Codigo ) Aprobecho y lo dejo aca.

Dejo toda la Funcion por si la prefieren remplazar completa

Spoiler for Hiden:
void FriendMemoSend(FHP_FRIEND_MEMO_SEND* lpMsg,int index)
{
   FHP_FRIEND_MEMO_SEND_RESULT pMsg;

   pMsg.h.set(0x70,sizeof(pMsg));

   pMsg.Number = lpMsg->Number;

   memcpy(pMsg.Name,lpMsg->Name,sizeof(pMsg.Name));

   pMsg.Result = 1;

   pMsg.WindowGuid = lpMsg->WindowGuid;

   gQueryManager.BindParameterAsString(1, lpMsg->ToName, sizeof(lpMsg->ToName)); //Fix DataServer N#1

   gQueryManager.BindParameterAsString(2, lpMsg->Subject, sizeof(lpMsg->Subject));

   gQueryManager.ExecQuery("WZ_WriteMail '%s',?,?,%d,%d", lpMsg->Name, lpMsg->Dir, lpMsg->Action);


   gQueryManager.Fetch();

   DWORD memo = gQueryManager.GetResult(0);

   DWORD guid = gQueryManager.GetResult(1);

   gQueryManager.Close();

   if(memo <= 10)
   {
      pMsg.Result = (BYTE)memo;
      CSDataSend(index,(BYTE*)&pMsg,pMsg.h.size);
      return;
   }

   BYTE MemoBuff[1000];

   memset(MemoBuff,0,sizeof(MemoBuff));

   memcpy(MemoBuff,lpMsg->Memo,lpMsg->MemoSize);

   gQueryManager.BindParameterAsBinary(1,MemoBuff,sizeof(MemoBuff));

   gQueryManager.BindParameterAsBinary(2,lpMsg->Photo,sizeof(lpMsg->Photo));

   gQueryManager.ExecQuery("UPDATE T_FriendMail SET Memo=?,Photo=? WHERE MemoIndex=%d AND GUID=%d",memo,guid);

   gQueryManager.Close();

   CSDataSend(index,(BYTE*)&pMsg,pMsg.h.size);

   if(pMsg.Result == 1)
   {
      CHARACTER_INFO CharacterInfo;

      if(gCharacterManager.GetCharacterInfo(&CharacterInfo,lpMsg->ToName) != 0)
      {
         gQueryManager.ExecQuery("SELECT MemoIndex,FriendName,wDate,Subject,bRead FROM T_FriendMail WHERE MemoIndex=%d AND GUID=%d",memo,guid);

         gQueryManager.Fetch();

         FHP_FRIEND_MEMO_LIST pMsg;

         pMsg.h.set(0x71,sizeof(pMsg));

         pMsg.Number = CharacterInfo.UserIndex;

         pMsg.MemoIndex = gQueryManager.GetAsInteger("MemoIndex");

         gQueryManager.GetAsString("FriendName",pMsg.SendName,sizeof(pMsg.SendName));

         memcpy(pMsg.RecvName,lpMsg->ToName,sizeof(pMsg.RecvName));

         gQueryManager.GetAsString("wDate",pMsg.Date,sizeof(pMsg.Date));

         gQueryManager.GetAsString("Subject",pMsg.Subject,sizeof(pMsg.Subject));

         pMsg.read = gQueryManager.GetAsInteger("bRead");

         CServerManager* lpServerManager = FindServerByCode(CharacterInfo.GameServerCode);

         if(lpServerManager != 0){CSDataSend(lpServerManager->m_index,(BYTE*)&pMsg,sizeof(pMsg));}

         gQueryManager.Close();
      }
   }
}

C++, Python programmer

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1368 Views
Last post March 22, 2019, 09:01:57 AM
by velmarys
5 Replies
3211 Views
Last post May 31, 2020, 11:44:40 AM
by load_01
2 Replies
2456 Views
Last post February 20, 2018, 09:25:10 PM
by Marote
4 Replies
2542 Views
Last post April 24, 2023, 01:50:37 AM
by Azzlaer
5 Replies
1580 Views
Last post May 24, 2020, 12:07:36 PM
by sebastian