Exemplo n.º 1
0
        static void Main()
        {
            Binparser bp = new Binparser();

            UpdateFieldsLoader.LoadUpdateFields();

            DateTime starttime = DateTime.Now;

            Console.WriteLine("Starting at {0}", starttime);

            DirectoryInfo di = new DirectoryInfo(".");                            // DirectoryInfo

            FileInfo[] fi = di.GetFiles("*.sqlite", SearchOption.AllDirectories); // Get file list

            Console.WriteLine("Found {0} files to parse", fi.Length);

            foreach (FileInfo f in fi)
            {
                ParseFile(f);
            }

            TimeSpan worktime = DateTime.Now - starttime;

            Console.WriteLine("Done in " + worktime.ToString() + "!");
            Console.ReadKey();
        }
Exemplo n.º 2
0
        public WowCorePacketReader(string filename)
        {
            _reader = new BinaryReader(new FileStream(filename, FileMode.Open, FileAccess.Read), Encoding.ASCII);
            _reader.ReadBytes(3);                   // PKT
            var    version = _reader.ReadUInt16();  // sniff version (0x0201, 0x0202)
            ushort build;

            switch (version)
            {
            case 0x0201:
                build = _reader.ReadUInt16();       // build
                _reader.ReadBytes(40);              // session key
                break;

            case 0x0202:
                _reader.ReadByte();                 // 0x06
                build = _reader.ReadUInt16();       // build
                _reader.ReadBytes(4);               // client locale
                _reader.ReadBytes(20);              // packet key
                _reader.ReadBytes(64);              // realm name
                break;

            default:
                throw new Exception(String.Format("Unknown sniff version {0:X2}", version));
            }

            UpdateFieldsLoader.LoadUpdateFields(build);
        }
Exemplo n.º 3
0
        public SniffitztPacketReader(string filename)
        {
            _document = new XmlDocument();
            _document.Load(filename);

            var build = Convert.ToUInt32(_document.GetElementsByTagName("header")[0].Attributes["clientBuild"].Value);

            _packets = _document.GetElementsByTagName("packet");

            UpdateFieldsLoader.LoadUpdateFields(build);
        }
Exemplo n.º 4
0
        public void PrintObjectInfo(ulong guid, ListView listView)
        {
            var obj  = objects[guid];
            var type = obj.TypeId;

            foreach (var kvp in obj.Data)
            {
                var uf    = UpdateFieldsLoader.GetUpdateField(type, kvp.Key);
                var value = GetValueBaseOnType(kvp.Value, uf.Type);
                listView.Items.Add(new ListViewItem(new[] { uf.Name, value }));
            }
        }
Exemplo n.º 5
0
        public SqLitePacketReader(string filename)
        {
            var connection = factory.CreateConnection();

            connection.ConnectionString = "Data Source=" + filename;
            connection.Open();

            //TODO: Добавить определение билда!
            var command = connection.CreateCommand();

            command.CommandText = "SELECT opcode, data FROM packets WHERE opcode=169 OR opcode=502 ORDER BY id;";
            command.Prepare();

            _reader = command.ExecuteReader();

            //TODO: Добавить определение билда!
            UpdateFieldsLoader.LoadUpdateFields(10026);
        }
Exemplo n.º 6
0
        public void PrintObjectUpdatesInfo(ulong guid, ListView listView)
        {
            var obj = objects[guid];

            // make a temp copy of original values
            var objData = new Dictionary <int, uint>();

            foreach (var v in obj.Data)
            {
                objData[v.Key] = v.Value;
            }

            var c = 0;

            foreach (var update in obj.Updates)
            {
                c++;
                var group = new ListViewGroup(String.Format("Update {0}:", c));
                listView.Groups.Add(group);

                foreach (var kvp in update.Data)
                {
                    var uf       = UpdateFieldsLoader.GetUpdateField(obj.TypeId, kvp.Key);
                    var oldValue = GetValueBaseOnType((uint)0, uf.Type); // default value 0

                    if (objData.ContainsKey(kvp.Key))
                    {
                        oldValue         = GetValueBaseOnType(objData[kvp.Key], uf.Type);
                        objData[kvp.Key] = kvp.Value;
                    }

                    var newValue = GetValueBaseOnType(kvp.Value, uf.Type);
                    listView.Items.Add(new ListViewItem(new[] { uf.Name, oldValue, newValue }, group));
                }
            }
        }