Esempio n. 1
0
            public void Update(PreviousType type, MemoryDomain domain, bool bigendian)
            {
                var value = domain.PeekDWord(Address % domain.Size, bigendian);

                if (value != Previous)
                {
                    _changecount++;
                }

                switch (type)
                {
                case PreviousType.Original:
                case PreviousType.LastSearch:
                    break;

                case PreviousType.LastFrame:
                    _previous = _prevFrame;
                    break;

                case PreviousType.LastChange:
                    if (_prevFrame != value)
                    {
                        _previous = _prevFrame;
                    }
                    break;
                }

                _prevFrame = value;
            }
Esempio n. 2
0
 protected uint GetDWord()
 {
     if (Global.CheatList.IsActive(_domain, _address))
     {
         return((uint)Global.CheatList.GetCheatValue(_domain, _address, WatchSize.DWord).Value);
     }
     else
     {
         if (_domain.Size == 0)
         {
             return(_domain.PeekDWord(_address, _bigEndian));                    // TODO: % size stil lisn't correct since it could be the last byte of the domain
         }
         else
         {
             return(_domain.PeekDWord(_address % _domain.Size, _bigEndian));                    // TODO: % size stil lisn't correct since it could be the last byte of the domain
         }
     }
 }
Esempio n. 3
0
 protected uint GetDWord(bool bypassFreeze = false)
 {
     if (!bypassFreeze && Global.CheatList.IsActive(_domain, _address))
     {
         //LIAR logic
         return((uint)(Global.CheatList.GetCheatValue(_domain, _address, WatchSize.DWord) ?? 0));
     }
     else
     {
         if (_domain.Size == 0)
         {
             return(_domain.PeekDWord(_address, _bigEndian));                    // TODO: % size stil lisn't correct since it could be the last byte of the domain
         }
         else
         {
             return(_domain.PeekDWord(_address % _domain.Size, _bigEndian));                    // TODO: % size stil lisn't correct since it could be the last byte of the domain
         }
     }
 }
Esempio n. 4
0
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            _disassemblerInstance.ReadWord = (a) => (short)m.PeekWord(a, m.EndianType == MemoryDomain.Endian.Big);
            _disassemblerInstance.ReadByte = (a) => (sbyte)m.PeekByte(a);
            _disassemblerInstance.ReadLong = (a) => (int)m.PeekDWord(a, m.EndianType == MemoryDomain.Endian.Big);
            var info = _disassemblerInstance.Disassemble((int)addr);

            length = info.Length;

            return(string.Format("{0:X4}  {1,-7} {2}", info.RawBytes.Substring(0, 4), info.Mnemonic, info.Args));
        }
Esempio n. 5
0
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            length = 4;             // TODO: is this right?
            var instruction = m.PeekDWord(addr, true);

            //TODO - reserve buffer here for disassembling into. allocating repeatedly will be slower
            var    result    = api.m64p_decode_op(instruction, addr);
            string strResult = Marshal.PtrToStringAnsi(result);

            return(strResult);
        }
Esempio n. 6
0
        private int GetRamvalue(int addr)
        {
            int val;

            switch (_dataSize)
            {
            default:
            case 1:
                val = _currentDomain.PeekByte(addr);
                break;

            case 2:
                val = _currentDomain.PeekWord(addr, _bigEndian);
                break;

            case 4:
                val = (int)_currentDomain.PeekDWord(addr, _bigEndian);
                break;
            }

            return(val);
        }
Esempio n. 7
0
 public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian)
 {
     _previous = _prevFrame = domain.PeekDWord(Address % domain.Size, bigendian);
 }
Esempio n. 8
0
 public MiniDWordWatch(MemoryDomain domain, long addr, bool bigEndian)
 {
     Address   = addr;
     _previous = domain.PeekDWord(Address % domain.Size, bigEndian);
 }
Esempio n. 9
0
 protected uint GetDWord()
 {
     return(_domain.PeekDWord(_address % _domain.Size, _bigEndian));            // TODO: % size stil lisn't correct since it could be the last byte of the domain
 }