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 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);
        }