Public paste
whoops
By: Guest | Date: Jan 14 2008 19:30 | Format: None | Expires: never | Size: 1.05 KB | Hits: 1164

  1. def InjectPacket (self, sOpcode, sData, blnToServer, blnEncrypted):
  2.         sLen = self.LongToHex(len(sData) / 2)
  3.         if sOpcode == '':
  4.             raise RuntimeError, 'no opcode supplied'
  5.         sOpcode = sOpcode[len(sOpcode)-2:] + sOpcode[:2]
  6.         if blnEncrypted == True:
  7.             if blnToServer == True:
  8.                 sPacket = self.HexToString(sLen + sOpcode + "0300" + sData)
  9.             else :
  10.                 sPacket = self.HexToString(sLen + sOpcode + "0400" + sData)
  11.         else :
  12.             if blnToServer == True:
  13.                 sPacket = self.HexToString(sLen + sOpcode + "0100" + sData)
  14.             else :
  15.                 sPacket = self.HexToString(sLen + sOpcode + "0200" + sData)
  16.         self.Send(sPacket)
  17.  
  18. def InjectNotice(self, sMessage):
  19.         sData = struct.pack('<b h', 7, len(sMessage))
  20.         sText = ''
  21.         for letter in sMessage:
  22.             sText += letter.encode('hex-codec') + "00"
  23.         sPacket = sData.encode('hex-codec') + sText
  24.         self.InjectPacket('3667', sPacket.upper(), False, True)
Latest pastes
51 minutes ago
10 hours ago
1 days ago
2 days ago
2 days ago