EQPacket.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "debug.h"
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <iostream>
  20. #include <iomanip>
  21. #include "EQPacket.h"
  22. #include "misc.h"
  23. #include "op_codes.h"
  24. #include "CRC16.h"
  25. #include "opcodemgr.h"
  26. #include "packet_dump.h"
  27. #include <map>
  28. #include "Log.h"
  29. #include <time.h>
  30. using namespace std;
  31. extern map<int16,OpcodeManager*>EQOpcodeManager;
  32. uint8 EQApplicationPacket::default_opcode_size=2;
  33. EQPacket::EQPacket(const uint16 op, const unsigned char *buf, uint32 len)
  34. {
  35. this->opcode=op;
  36. this->pBuffer=NULL;
  37. this->size=0;
  38. version = 0;
  39. setTimeInfo(0,0);
  40. if (len>0) {
  41. this->size=len;
  42. pBuffer= new unsigned char[this->size];
  43. if (buf) {
  44. memcpy(this->pBuffer,buf,this->size);
  45. } else {
  46. memset(this->pBuffer,0,this->size);
  47. }
  48. }
  49. }
  50. int8 EQ2Packet::PreparePacket(int16 MaxLen){
  51. int16 OpcodeVersion = GetOpcodeVersion(version);
  52. // stops a crash for incorrect version
  53. if(EQOpcodeManager.count(OpcodeVersion) == 0)
  54. {
  55. LogWrite(PACKET__ERROR, 0, "Packet", "Version %i is not listed in the opcodes table.",version);
  56. return -1;
  57. }
  58. packet_prepared = true;
  59. int16 login_opcode = EQOpcodeManager[OpcodeVersion]->EmuToEQ(login_op);
  60. int8 offset = 0;
  61. //one of the int16s is for the seq, other is for the EQ2 opcode and compressed flag (OP_Packet is the header, not the opcode)
  62. int32 new_size = size + sizeof(int16) + sizeof(int8);
  63. bool oversized = false;
  64. if(login_opcode != 2){
  65. new_size+=sizeof(int8); //for opcode
  66. if(login_opcode >= 255){
  67. new_size += sizeof(int16);
  68. oversized = true;
  69. }
  70. else
  71. login_opcode = ntohs(login_opcode);
  72. }
  73. uchar* new_buffer = new uchar[new_size];
  74. memset(new_buffer,0,new_size);
  75. uchar* ptr = new_buffer + sizeof(int16); // sequence is first
  76. if(login_opcode != 2){
  77. if(oversized){
  78. ptr += sizeof(int8); //compressed flag
  79. int8 addon = 0xff;
  80. memcpy(ptr, &addon, sizeof(int8));
  81. ptr += sizeof(int8);
  82. }
  83. memcpy(ptr, &login_opcode, sizeof(int16));
  84. ptr += sizeof(int16);
  85. }
  86. else{
  87. memcpy(ptr, &login_opcode, sizeof(int8));
  88. ptr += sizeof(int8);
  89. }
  90. memcpy(ptr, pBuffer, size);
  91. safe_delete_array(pBuffer);
  92. pBuffer = new_buffer;
  93. offset = new_size - size - 1;
  94. size = new_size;
  95. return offset;
  96. }
  97. uint32 EQProtocolPacket::serialize(unsigned char *dest, int8 offset) const
  98. {
  99. if (opcode>0xff) {
  100. *(uint16 *)dest=opcode;
  101. } else {
  102. *(dest)=0;
  103. *(dest+1)=opcode;
  104. }
  105. memcpy(dest+2,pBuffer+offset,size-offset);
  106. return size+2;
  107. }
  108. uint32 EQApplicationPacket::serialize(unsigned char *dest) const
  109. {
  110. uint8 OpCodeBytes = app_opcode_size;
  111. if (app_opcode_size==1)
  112. *(unsigned char *)dest=opcode;
  113. else
  114. {
  115. // Application opcodes with a low order byte of 0x00 require an extra 0x00 byte inserting prior to the opcode.
  116. if ((opcode & 0x00ff) == 0)
  117. {
  118. *(uint8*)dest = 0;
  119. *(uint16*)(dest + 1) = opcode;
  120. ++OpCodeBytes;
  121. }
  122. else
  123. *(uint16*)dest = opcode;
  124. }
  125. memcpy(dest+app_opcode_size,pBuffer,size);
  126. return size+ OpCodeBytes;
  127. }
  128. EQPacket::~EQPacket()
  129. {
  130. safe_delete_array(pBuffer);
  131. pBuffer=NULL;
  132. }
  133. void EQPacket::DumpRawHeader(uint16 seq, FILE* to) const
  134. {
  135. /*if (timestamp.tv_sec) {
  136. char temp[20];
  137. tm t;
  138. const time_t sec = timestamp.tv_sec;
  139. localtime_s(&t, &sec);
  140. strftime(temp, 20, "%F %T", &t);
  141. fprintf(to, "%s.%06lu ", temp, timestamp.tv_usec);
  142. }*/
  143. DumpRawHeaderNoTime(seq, to);
  144. }
  145. const char* EQPacket::GetOpcodeName(){
  146. int16 OpcodeVersion = GetOpcodeVersion(version);
  147. if(EQOpcodeManager.count(OpcodeVersion) > 0)
  148. return EQOpcodeManager[OpcodeVersion]->EQToName(opcode);
  149. else
  150. return NULL;
  151. }
  152. void EQPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
  153. {
  154. if (src_ip) {
  155. string sIP,dIP;;
  156. sIP=long2ip(src_ip);
  157. dIP=long2ip(dst_ip);
  158. fprintf(to, "[%s:%d->%s:%d] ",sIP.c_str(),src_port,dIP.c_str(),dst_port);
  159. }
  160. if (seq != 0xffff)
  161. fprintf(to, "[Seq=%u] ",seq);
  162. string name;
  163. int16 OpcodeVersion = GetOpcodeVersion(version);
  164. if(EQOpcodeManager.count(OpcodeVersion) > 0)
  165. name = EQOpcodeManager[OpcodeVersion]->EQToName(opcode);
  166. fprintf(to, "[OpCode 0x%04x (%s) Size=%u]\n",opcode,name.c_str(),size);
  167. }
  168. void EQPacket::DumpRaw(FILE *to) const
  169. {
  170. DumpRawHeader();
  171. if (pBuffer && size)
  172. dump_message_column(pBuffer, size, " ", to);
  173. fprintf(to, "\n");
  174. }
  175. EQProtocolPacket::EQProtocolPacket(const unsigned char *buf, uint32 len, int in_opcode)
  176. {
  177. uint32 offset = 0;
  178. if(in_opcode>=0)
  179. opcode = in_opcode;
  180. else{
  181. offset=2;
  182. opcode=ntohs(*(const uint16 *)buf);
  183. }
  184. if (len-offset) {
  185. pBuffer= new unsigned char[len-offset];
  186. size=len-offset;
  187. if(buf)
  188. memcpy(pBuffer,buf+offset,len-offset);
  189. else
  190. memset(pBuffer,0,size);
  191. } else {
  192. pBuffer=NULL;
  193. size=0;
  194. }
  195. version = 0;
  196. eq2_compressed = false;
  197. packet_prepared = false;
  198. packet_encrypted = false;
  199. sent_time = 0;
  200. attempt_count = 0;
  201. sequence = 0;
  202. }
  203. bool EQ2Packet::AppCombine(EQ2Packet* rhs){
  204. bool result = false;
  205. uchar* tmpbuffer = 0;
  206. bool over_sized_packet = false;
  207. int32 new_size = 0;
  208. //bool whee = false;
  209. // DumpPacket(this);
  210. // DumpPacket(rhs);
  211. /*if(rhs->size >= 255){
  212. DumpPacket(this);
  213. DumpPacket(rhs);
  214. whee = true;
  215. }*/
  216. if (opcode==OP_AppCombined && ((size + rhs->size + 3) < 255)){
  217. int16 tmp_size = rhs->size - 2;
  218. if(tmp_size >= 255){
  219. new_size = size+tmp_size+3;
  220. over_sized_packet = true;
  221. }
  222. else
  223. new_size = size+tmp_size+1;
  224. tmpbuffer = new uchar[new_size];
  225. uchar* ptr = tmpbuffer;
  226. memcpy(ptr, pBuffer, size);
  227. ptr += size;
  228. if(over_sized_packet){
  229. memset(ptr, 255, sizeof(int8));
  230. ptr += sizeof(int8);
  231. tmp_size = htons(tmp_size);
  232. memcpy(ptr, &tmp_size, sizeof(int16));
  233. ptr += sizeof(int16);
  234. }
  235. else{
  236. memcpy(ptr, &tmp_size, sizeof(int8));
  237. ptr += sizeof(int8);
  238. }
  239. memcpy(ptr, rhs->pBuffer+2, rhs->size-2);
  240. delete[] pBuffer;
  241. size = new_size;
  242. pBuffer=tmpbuffer;
  243. safe_delete(rhs);
  244. result=true;
  245. }
  246. else if((size + rhs->size + 6) < 255){
  247. int32 tmp_size = size - 2;
  248. int32 tmp_size2 = rhs->size - 2;
  249. opcode=OP_AppCombined;
  250. bool over_sized_packet2 = false;
  251. new_size = size;
  252. if(tmp_size >= 255){
  253. new_size += 5;
  254. over_sized_packet = true;
  255. }
  256. else
  257. new_size += 3;
  258. if(tmp_size2 >= 255){
  259. new_size += tmp_size2+3;
  260. over_sized_packet2 = true;
  261. }
  262. else
  263. new_size += tmp_size2+1;
  264. tmpbuffer = new uchar[new_size];
  265. tmpbuffer[2]=0;
  266. tmpbuffer[3]=0x19;
  267. uchar* ptr = tmpbuffer+4;
  268. if(over_sized_packet){
  269. memset(ptr, 255, sizeof(int8));
  270. ptr += sizeof(int8);
  271. tmp_size = htons(tmp_size);
  272. memcpy(ptr, &tmp_size, sizeof(int16));
  273. ptr += sizeof(int16);
  274. }
  275. else{
  276. memcpy(ptr, &tmp_size, sizeof(int8));
  277. ptr += sizeof(int8);
  278. }
  279. memcpy(ptr, pBuffer+2, size-2);
  280. ptr += (size-2);
  281. if(over_sized_packet2){
  282. memset(ptr, 255, sizeof(int8));
  283. ptr += sizeof(int8);
  284. tmp_size2 = htons(tmp_size2);
  285. memcpy(ptr, &tmp_size2, sizeof(int16));
  286. ptr += sizeof(int16);
  287. }
  288. else{
  289. memcpy(ptr, &tmp_size2, sizeof(int8));
  290. ptr += sizeof(int8);
  291. }
  292. memcpy(ptr, rhs->pBuffer+2, rhs->size-2);
  293. size = new_size;
  294. delete[] pBuffer;
  295. pBuffer=tmpbuffer;
  296. safe_delete(rhs);
  297. result=true;
  298. }
  299. /*if(whee){
  300. DumpPacket(this);
  301. cout << "fsdfsdf";
  302. }*/
  303. //DumpPacket(this);
  304. return result;
  305. }
  306. bool EQProtocolPacket::combine(const EQProtocolPacket *rhs)
  307. {
  308. if (opcode == OP_Ack || rhs->opcode == OP_Ack)
  309. return false;
  310. bool result=false;
  311. //if(dont_combine)
  312. // return false;
  313. //if (opcode==OP_Combined && size+rhs->size+5<256) {
  314. if (opcode == OP_Combined && size + rhs->size + 5 < 256) {
  315. auto tmpbuffer = new unsigned char[size + rhs->size + 3];
  316. memcpy(tmpbuffer, pBuffer, size);
  317. uint32 offset = size;
  318. tmpbuffer[offset++] = rhs->Size();
  319. offset += rhs->serialize(tmpbuffer + offset);
  320. size = offset;
  321. delete[] pBuffer;
  322. pBuffer = tmpbuffer;
  323. result = true;
  324. }
  325. else if (size + rhs->size + 7 < 256) {
  326. auto tmpbuffer = new unsigned char[size + rhs->size + 6];
  327. uint32 offset = 0;
  328. tmpbuffer[offset++] = Size();
  329. offset += serialize(tmpbuffer + offset);
  330. tmpbuffer[offset++] = rhs->Size();
  331. offset += rhs->serialize(tmpbuffer + offset);
  332. size = offset;
  333. delete[] pBuffer;
  334. pBuffer = tmpbuffer;
  335. opcode = OP_Combined;
  336. result = true;
  337. }
  338. return result;
  339. }
  340. EQApplicationPacket::EQApplicationPacket(const unsigned char *buf, uint32 len, uint8 opcode_size)
  341. {
  342. uint32 offset=0;
  343. app_opcode_size=(opcode_size==0) ? EQApplicationPacket::default_opcode_size : opcode_size;
  344. if (app_opcode_size==1) {
  345. opcode=*(const unsigned char *)buf;
  346. offset++;
  347. } else {
  348. opcode=*(const uint16 *)buf;
  349. offset+=2;
  350. }
  351. if ((len-offset)>0) {
  352. pBuffer=new unsigned char[len-offset];
  353. memcpy(pBuffer,buf+offset,len-offset);
  354. size=len-offset;
  355. } else {
  356. pBuffer=NULL;
  357. size=0;
  358. }
  359. emu_opcode = OP_Unknown;
  360. }
  361. bool EQApplicationPacket::combine(const EQApplicationPacket *rhs)
  362. {
  363. cout << "CALLED AP COMBINE!!!!\n";
  364. return false;
  365. }
  366. void EQApplicationPacket::SetOpcode(EmuOpcode emu_op) {
  367. if(emu_op == OP_Unknown) {
  368. opcode = 0;
  369. emu_opcode = OP_Unknown;
  370. return;
  371. }
  372. opcode = EQOpcodeManager[GetOpcodeVersion(version)]->EmuToEQ(emu_op);
  373. if(opcode == OP_Unknown) {
  374. LogWrite(PACKET__DEBUG, 0, "Packet", "Unable to convert Emu opcode %s (%d) into an EQ opcode.", OpcodeNames[emu_op], emu_op);
  375. }
  376. //save the emu opcode we just set.
  377. emu_opcode = emu_op;
  378. }
  379. const EmuOpcode EQApplicationPacket::GetOpcodeConst() const {
  380. if(emu_opcode != OP_Unknown) {
  381. return(emu_opcode);
  382. }
  383. if(opcode == 10000) {
  384. return(OP_Unknown);
  385. }
  386. EmuOpcode emu_op;
  387. emu_op = EQOpcodeManager[GetOpcodeVersion(version)]->EQToEmu(opcode);
  388. if(emu_op == OP_Unknown) {
  389. LogWrite(PACKET__DEBUG, 1, "Packet", "Unable to convert EQ opcode 0x%.4X (%i) to an emu opcode (%s)", opcode, opcode, __FUNCTION__);
  390. }
  391. return(emu_op);
  392. }
  393. EQApplicationPacket *EQProtocolPacket::MakeApplicationPacket(uint8 opcode_size) const {
  394. EQApplicationPacket *res = new EQApplicationPacket;
  395. res->app_opcode_size=(opcode_size==0) ? EQApplicationPacket::default_opcode_size : opcode_size;
  396. if (res->app_opcode_size==1) {
  397. res->pBuffer= new unsigned char[size+1];
  398. memcpy(res->pBuffer+1,pBuffer,size);
  399. *(res->pBuffer)=htons(opcode)&0xff;
  400. res->opcode=opcode&0xff;
  401. res->size=size+1;
  402. } else {
  403. res->pBuffer= new unsigned char[size];
  404. memcpy(res->pBuffer,pBuffer,size);
  405. res->opcode=opcode;
  406. res->size=size;
  407. }
  408. res->copyInfo(this);
  409. return(res);
  410. }
  411. bool EQProtocolPacket::ValidateCRC(const unsigned char *buffer, int length, uint32 Key)
  412. {
  413. bool valid=false;
  414. // OP_SessionRequest, OP_SessionResponse, OP_OutOfSession are not CRC'd
  415. if (buffer[0]==0x00 && (buffer[1]==OP_SessionRequest || buffer[1]==OP_SessionResponse || buffer[1]==OP_OutOfSession)) {
  416. valid=true;
  417. } else if(buffer[2] == 0x00 && buffer[3] == 0x19){
  418. valid = true;
  419. }
  420. else {
  421. uint16 comp_crc=CRC16(buffer,length-2,Key);
  422. uint16 packet_crc=ntohs(*(const uint16 *)(buffer+length-2));
  423. #ifdef EQN_DEBUG
  424. if (packet_crc && comp_crc != packet_crc) {
  425. cout << "CRC mismatch: comp=" << hex << comp_crc << ", packet=" << packet_crc << dec << endl;
  426. }
  427. #endif
  428. valid = (!packet_crc || comp_crc == packet_crc);
  429. }
  430. return valid;
  431. }
  432. uint32 EQProtocolPacket::Decompress(const unsigned char *buffer, const uint32 length, unsigned char *newbuf, uint32 newbufsize)
  433. {
  434. uint32 newlen=0;
  435. uint32 flag_offset=0;
  436. newbuf[0]=buffer[0];
  437. if (buffer[0]==0x00) {
  438. flag_offset=2;
  439. newbuf[1]=buffer[1];
  440. } else
  441. flag_offset=1;
  442. if (length>2 && buffer[flag_offset]==0x5a) {
  443. LogWrite(PACKET__DEBUG, 0, "Packet", "In Decompress 1");
  444. newlen=Inflate(const_cast<unsigned char *>(buffer+flag_offset+1),length-(flag_offset+1)-2,newbuf+flag_offset,newbufsize-flag_offset)+2;
  445. newbuf[newlen++]=buffer[length-2];
  446. newbuf[newlen++]=buffer[length-1];
  447. } else if (length>2 && buffer[flag_offset]==0xa5) {
  448. LogWrite(PACKET__DEBUG, 0, "Packet", "In Decompress 2");
  449. memcpy(newbuf+flag_offset,buffer+flag_offset+1,length-(flag_offset+1));
  450. newlen=length-1;
  451. } else {
  452. memcpy(newbuf,buffer,length);
  453. newlen=length;
  454. }
  455. return newlen;
  456. }
  457. uint32 EQProtocolPacket::Compress(const unsigned char *buffer, const uint32 length, unsigned char *newbuf, uint32 newbufsize) {
  458. uint32 flag_offset=1,newlength;
  459. //dump_message_column(buffer,length,"Before: ");
  460. newbuf[0]=buffer[0];
  461. if (buffer[0]==0) {
  462. flag_offset=2;
  463. newbuf[1]=buffer[1];
  464. }
  465. if (length>30) {
  466. newlength=Deflate(const_cast<unsigned char *>(buffer+flag_offset),length-flag_offset,newbuf+flag_offset+1,newbufsize);
  467. *(newbuf+flag_offset)=0x5a;
  468. newlength+=flag_offset+1;
  469. } else {
  470. memmove(newbuf+flag_offset+1,buffer+flag_offset,length-flag_offset);
  471. *(newbuf+flag_offset)=0xa5;
  472. newlength=length+1;
  473. }
  474. //dump_message_column(newbuf,length,"After: ");
  475. return newlength;
  476. }
  477. void EQProtocolPacket::ChatDecode(unsigned char *buffer, int size, int DecodeKey)
  478. {
  479. if (buffer[1]!=0x01 && buffer[0]!=0x02 && buffer[0]!=0x1d) {
  480. int Key=DecodeKey;
  481. unsigned char *test=(unsigned char *)malloc(size);
  482. buffer+=2;
  483. size-=2;
  484. int i;
  485. for (i = 0 ; i+4 <= size ; i+=4)
  486. {
  487. int pt = (*(int*)&buffer[i])^(Key);
  488. Key = (*(int*)&buffer[i]);
  489. *(int*)&test[i]=pt;
  490. }
  491. unsigned char KC=Key&0xFF;
  492. for ( ; i < size ; i++)
  493. {
  494. test[i]=buffer[i]^KC;
  495. }
  496. memcpy(buffer,test,size);
  497. free(test);
  498. }
  499. }
  500. void EQProtocolPacket::ChatEncode(unsigned char *buffer, int size, int EncodeKey)
  501. {
  502. if (buffer[1]!=0x01 && buffer[0]!=0x02 && buffer[0]!=0x1d) {
  503. int Key=EncodeKey;
  504. char *test=(char*)malloc(size);
  505. int i;
  506. buffer+=2;
  507. size-=2;
  508. for ( i = 0 ; i+4 <= size ; i+=4)
  509. {
  510. int pt = (*(int*)&buffer[i])^(Key);
  511. Key = pt;
  512. *(int*)&test[i]=pt;
  513. }
  514. unsigned char KC=Key&0xFF;
  515. for ( ; i < size ; i++)
  516. {
  517. test[i]=buffer[i]^KC;
  518. }
  519. memcpy(buffer,test,size);
  520. free(test);
  521. }
  522. }
  523. bool EQProtocolPacket::IsProtocolPacket(const unsigned char* in_buff, uint32_t len, bool bTrimCRC) {
  524. bool ret = false;
  525. uint16_t opcode = ntohs(*(uint16_t*)in_buff);
  526. uint32_t offset = 2;
  527. switch (opcode) {
  528. case OP_SessionRequest:
  529. case OP_SessionDisconnect:
  530. case OP_KeepAlive:
  531. case OP_SessionStatResponse:
  532. case OP_Packet:
  533. case OP_Combined:
  534. case OP_Fragment:
  535. case OP_Ack:
  536. case OP_OutOfOrderAck:
  537. case OP_OutOfSession:
  538. {
  539. ret = true;
  540. break;
  541. }
  542. }
  543. return ret;
  544. }
  545. void DumpPacketHex(const EQApplicationPacket* app)
  546. {
  547. DumpPacketHex(app->pBuffer, app->size);
  548. }
  549. void DumpPacketAscii(const EQApplicationPacket* app)
  550. {
  551. DumpPacketAscii(app->pBuffer, app->size);
  552. }
  553. void DumpPacket(const EQProtocolPacket* app) {
  554. DumpPacketHex(app->pBuffer, app->size);
  555. }
  556. void DumpPacket(const EQApplicationPacket* app, bool iShowInfo) {
  557. if (iShowInfo) {
  558. cout << "Dumping Applayer: 0x" << hex << setfill('0') << setw(4) << app->GetOpcode() << dec;
  559. cout << " size:" << app->size << endl;
  560. }
  561. DumpPacketHex(app->pBuffer, app->size);
  562. // DumpPacketAscii(app->pBuffer, app->size);
  563. }
  564. void DumpPacketBin(const EQApplicationPacket* app) {
  565. DumpPacketBin(app->pBuffer, app->size);
  566. }