override public IdentificationStatus Identify(int OpCode, int Size, PacketDirection Direction) { if ((OpCode == OpManager.OpCodeNameToNumber("OP_ZoneEntry")) && (Direction == PacketDirection.ClientToServer)) { return(IdentificationStatus.Yes); } return(IdentificationStatus.No); }
public override void RegisterExplorers() { OpManager.RegisterExplorer("OP_ZoneEntry", ExploreZoneEntry); //OpManager.RegisterExplorer("OP_RespawnWindow", ExploreRespawnWindow); //OpManager.RegisterExplorer("OP_ZonePlayerToBind", ExploreZonePlayerToBind); //OpManager.RegisterExplorer("OP_RequestClientZoneChange", ExploreRequestClientZoneChange); //OpManager.RegisterExplorer("OP_DeleteSpawn", ExploreDeleteSpawn); OpManager.RegisterExplorer("OP_HPUpdate", ExploreHPUpdate); }
public override void RegisterExplorers() { //OpManager.RegisterExplorer("OP_PlayerProfile", ExplorePlayerProfile); OpManager.RegisterExplorer("OP_ZoneEntry", ExploreZoneEntry); OpManager.RegisterExplorer("OP_NPCMoveUpdate", ExploreNPCMoveUpdate); OpManager.RegisterExplorer("OP_MobUpdate", ExploreMobUpdate); //OpManager.RegisterExplorer("OP_ClientUpdate", ExploreClientUpdate); OpManager.RegisterExplorer("OP_CharInventory", ExploreInventory); }
override public IdentificationStatus Identify(int opCode, int size, PacketDirection direction) { if ((opCode == OpManager.OpCodeNameToNumber("OP_ZoneEntry")) && (direction == PacketDirection.ClientToServer)) { return(IdentificationStatus.Tentative); } if ((opCode == OpManager.OpCodeNameToNumber("OP_PlayerProfile")) && (direction == PacketDirection.ServerToClient) && (size == ExpectedPPLength)) { return(IdentificationStatus.Yes); } return(IdentificationStatus.No); }
public bool DumpPackets(string FileName, bool ShowTimeStamps) { StreamWriter PacketDumpStream; try { PacketDumpStream = new StreamWriter(FileName); } catch { return(false); } string Direction = ""; foreach (EQApplicationPacket p in Packets.PacketList) { if (ShowTimeStamps) { PacketDumpStream.WriteLine(p.PacketTime.ToString()); } if (p.Direction == PacketDirection.ServerToClient) { Direction = "[Server->Client]"; } else { Direction = "[Client->Server]"; } OpCode oc = OpManager.GetOpCodeByNumber(p.OpCode); string OpCodeName = (oc != null) ? oc.Name : "OP_Unknown"; PacketDumpStream.WriteLine("[OPCode: 0x" + p.OpCode.ToString("x4") + "] " + OpCodeName + " " + Direction + " [Size: " + p.Buffer.Length + "]"); PacketDumpStream.WriteLine(Utils.HexDump(p.Buffer)); if ((oc != null) && (oc.Explorer != null)) { oc.Explorer(PacketDumpStream, new ByteStream(p.Buffer), p.Direction); } } PacketDumpStream.Close(); return(true); }
public int PacketTypeCountByName(string OPCodeName) { UInt32 OpCodeNumber = OpManager.OpCodeNameToNumber(OPCodeName); int Count = 0; foreach (EQApplicationPacket app in Packets.PacketList) { if (app.OpCode == OpCodeNumber) { ++Count; } } return(Count); }
public override IdentificationStatus Identify(int opCode, int size, PacketDirection direction) { var opZoneEntry = OpManager.OpCodeNameToNumber("OP_ZoneEntry"); var opPlayerProfile = OpManager.OpCodeNameToNumber("OP_PlayerProfile"); if (opCode == opZoneEntry && direction == PacketDirection.ClientToServer) { return(IdentificationStatus.Tentative); } if (opCode == opPlayerProfile && direction == PacketDirection.ServerToClient) // &&(Size == ExpectedPPLength)) { return(IdentificationStatus.Yes); } return(IdentificationStatus.No); }
public List <byte[]> GetPacketsOfType(string OpCodeName, PacketDirection Direction) { List <byte[]> ReturnList = new List <byte[]>(); if (OpManager == null) { return(ReturnList); } UInt32 OpCodeNumber = OpManager.OpCodeNameToNumber(OpCodeName); foreach (EQApplicationPacket app in Packets.PacketList) { if ((app.OpCode == OpCodeNumber) && (app.Direction == Direction) && (app.Locked)) { ReturnList.Add(app.Buffer); } } return(ReturnList); }
override public MerchantManager GetMerchantData(NPCSpawnList npcsl) { List <EQApplicationPacket> PacketList = Packets.PacketList; UInt32 OP_ShopRequest = OpManager.OpCodeNameToNumber("OP_ShopRequest"); UInt32 OP_ShopEnd = OpManager.OpCodeNameToNumber("OP_ShopEnd"); UInt32 OP_ItemPacket = OpManager.OpCodeNameToNumber("OP_ItemPacket"); MerchantManager mm = new MerchantManager(); for (int i = 0; i < PacketList.Count; ++i) { EQApplicationPacket p = PacketList[i]; if ((p.Direction == PacketDirection.ServerToClient) && (p.OpCode == OP_ShopRequest)) { ByteStream Buffer = new ByteStream(p.Buffer); UInt32 MerchantSpawnID = Buffer.ReadUInt32(); NPCSpawn npc = npcsl.GetNPC(MerchantSpawnID); UInt32 NPCTypeID; if (npc != null) { NPCTypeID = npc.NPCTypeID; } else { NPCTypeID = 0; } mm.AddMerchant(MerchantSpawnID); for (int j = i + 1; j < PacketList.Count; ++j) { p = PacketList[j]; if (p.OpCode == OP_ShopEnd) { break; } if (p.OpCode == OP_ItemPacket) { Buffer = new ByteStream(p.Buffer); UInt32 StackSize = Buffer.ReadUInt32(); Buffer.SkipBytes(4); UInt32 Slot = Buffer.ReadUInt32(); UInt32 MerchantSlot = Buffer.ReadUInt32(); UInt32 Price = Buffer.ReadUInt32(); Int32 Quantity = Buffer.ReadInt32(); Buffer.SetPosition(68); // Point to item name string ItemName = Buffer.ReadString(true); string Lore = Buffer.ReadString(true); string IDFile = Buffer.ReadString(true); UInt32 ItemID = Buffer.ReadUInt32(); //if (Quantity == -1) mm.AddMerchantItem(MerchantSpawnID, ItemID, ItemName, MerchantSlot, Quantity); } } } } return(mm); }
public override void RegisterExplorers() { OpManager.RegisterExplorer("OP_PlayerProfile", ExplorePlayerProfile); OpManager.RegisterExplorer("OP_ZoneEntry", ExploreZoneEntry); }