public string[] ParseItem(SearchListView.SearchListViewItem item, int ind)
        {
            string[] ret = new string[4];

            ret[0] = item.addr.ToString("X8");
            ret[1] = misc.ByteAToStringHex(item.oldVal, "");
            ret[2] = misc.ByteAToStringHex(item.newVal, "");
            if (useTime)
            {
                int hour    = item.align >> 24;
                int minute  = (item.align >> 16) & 0xFF;
                int seconds = item.align & 0xFFFF;
                ret[3] = hour.ToString() + ":" + minute.ToString().PadLeft(2, '0') + ":" + seconds.ToString().PadLeft(2, '0');
            }
            else
            {
                if (currentItemValues[ind].Length == 0)
                {
                    RefreshItemCurrent(item, ind);
                }
                ret[3] = misc.ByteAToStringHex(currentItemValues[ind], "");
            }

            return(ret);
        }
Esempio n. 2
0
 string[] sTypeText_ItemToLString(SearchListView.SearchListViewItem item)
 {
     SearchControl.ncSearchType type = SearchTypes[item.align];
     string[] ret = new string[4];
     ret[0] = item.addr.ToString("X8");
     ret[1] = misc.ByteAToString(item.newVal, "");
     ret[2] = "Invalid";
     ret[3] = type.Name;
     return(ret);
 }
Esempio n. 3
0
        SearchListView.SearchListViewItem standardByte_ToItem(ulong addr, byte[] newVal, byte[] oldVal, int typeIndex, uint misc = 0)
        {
            SearchListView.SearchListViewItem ret = new SearchListView.SearchListViewItem();

            ret.addr   = (uint)addr;
            ret.align  = typeIndex;
            ret.oldVal = oldVal;
            ret.newVal = newVal;
            ret.misc   = misc;

            return(ret);
        }
        private void rewriteNewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (searchListView1.SelectedIndices.Count <= 0)
            {
                return;
            }
            int ind = searchListView1.SelectedIndices[0];

            SearchListView.SearchListViewItem item = searchListView1.GetItemAtIndex(ind);
            Form1.apiSetMem((ulong)item.addr, item.newVal);
            RefreshItemCurrent(item, ind);
            searchListView1.Refresh();
        }
 public void AddItem(uint addr, byte[] ogp, byte[] cop)
 {
     SearchListView.SearchListViewItem slvi = new SearchListView.SearchListViewItem();
     if (useTime)
     {
         slvi.align = (DateTime.Now.Hour << 24) | (DateTime.Now.Minute << 16) | (DateTime.Now.Second);
     }
     slvi.addr   = addr;
     slvi.oldVal = ogp;
     slvi.newVal = cop;
     currentItemValues.Add(cop);
     searchListView1.AddItemRange(new SearchListView.SearchListViewItem[] { slvi });
     searchListView1.Refresh();
 }
Esempio n. 6
0
        string[] standardByte_ItemToLString(SearchListView.SearchListViewItem item)
        {
            SearchControl.ncSearchType type = SearchTypes[item.align];
            string[] ret  = new string[4];
            int      size = type.ByteSize;
            string   post = "";

            if (type.ByteSize > 8)
            {
                size = 8;
                post = "...";
            }

            ulong val = misc.ByteArrayToLong(item.newVal, 0, size);

            ret[0] = item.addr.ToString("X8");
            ret[1] = val.ToString("X" + (type.ByteSize * 2).ToString()) + post;
            ret[2] = val.ToString();
            ret[3] = type.Name;
            return(ret);
        }
 void RefreshItemCurrent(SearchListView.SearchListViewItem item, int ind)
 {
     byte[] curr = new byte[item.oldVal.Length];
     Form1.apiGetMem((ulong)item.addr, ref curr);
     currentItemValues[ind] = curr;
 }
Esempio n. 8
0
 string sTypeText_ItemToString(SearchListView.SearchListViewItem item)
 {
     return("1 " + item.addr.ToString("X8") + " " + SearchTypes[item.align].BAToString(item.newVal));
 }