This project is read-only.

Project Description
hex editor which is created with WPF with a xaml designed UI.

It is a Visual Studio 10 and .NET Framework 4.0 WPF project. It can open as many file at same time and wpf UI responding very well for very big files. In the picture it looks like much more a Integer editor, because product is not completed yet, there should a menu button in edit and in the toolbar, which can actually changes the base type of the buffered bytes :).

screenshot.png

   public partial class HexaGrid : UserControl
    {
        
        private MainWindow _mymainwindow;
        private string _filename;
        public string FileName
        {
            get 
            {
                return _filename;
            }
            set
            {
                _filename=value;
            }
        }
        

        public string ShortFileName
        {
            get     
            {
                FileInfo MyInfo = new FileInfo(_filename);
                return MyInfo.Name;
            }
        }


        public byte[] myBytes;        
        DataSet1.Bytetable1DataTable oTable = new DataSet1.Bytetable1DataTable();
        public void Get_myBytes_fromFile()
        {
            myBytes = File.ReadAllBytes(_filename);
        }

        public void Bytes_To_Grid()
        {                                   
            int j=0;
            for (int i=0; i<myBytes.Length; i+=16)
            {                
                string[] myStringArr = new string[17];
               
                myStringArr[0] = j.ToString();                
                for (int k=0; k<=15 & i+k<myBytes.Length; k++) 
                {
                    //_mymainwindow.MoveStatus(((i + k) / myBytes.Length * 100).ToString() + "% Completed", 0, myBytes.Length, i + k);                    
                    myStringArr[k+1]=myBytes[i+k].ToString();
                }
                oTable.Rows.Add(myStringArr);
                j++;
            }            
            dataGrid1.ItemsSource = oTable;
        }

        public HexaGrid()
        {
            InitializeComponent();

        }
        public HexaGrid(string pfilename, MainWindow MyMainWindow)
        {
            InitializeComponent();
            _mymainwindow = MyMainWindow;
            _filename = pfilename;
            Get_myBytes_fromFile();
            Bytes_To_Grid();
            //System.Threading.Thread MyThread = new System.Threading.Thread(Bytes_To_Grid);
            //MyThread.Start();
        }


    }

The Hexagrid Usercontrol can load the file into the a datatable from a specified data set and can show the content in the datagrid of the wpf.

Last edited Jun 29, 2011 at 4:09 PM by ogu, version 4