Exemple #1
0
 public uint get_p2_move()
 {
     if (is_p2_in_move())
     {
         uint val = (uint)_currentDomain.PeekUint(0x0007E5, _bigEndian);
         return(val);
     }
     return(0);
 }
Exemple #2
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));
            }

            if (_domain.Size == 0)
            {
                return(_domain.PeekUint(Address, BigEndian));                // TODO: % size still isn't correct since it could be the last byte of the domain
            }

            return(_domain.PeekUint(Address % _domain.Size, BigEndian));            // TODO: % size still isn't correct since it could be the last byte of the domain
        }
Exemple #3
0
            public void Update(PreviousType type, MemoryDomain domain, bool bigendian)
            {
                var value = domain.PeekUint(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;
            }
        public static uint GetUint(long address, MemoryDomain domain, bool bigEndian)
        {
            if (!IsValid(address, domain))
            {
                return(0);
            }

            return(domain.PeekUint(address, bigEndian));
        }
Exemple #5
0
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            _disassemblerInstance.ReadWord = (a) => (short)m.PeekUshort(a, m.EndianType == MemoryDomain.Endian.Big);
            _disassemblerInstance.ReadByte = (a) => (sbyte)m.PeekByte(a);
            _disassemblerInstance.ReadLong = (a) => (int)m.PeekUint(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));
        }
        public string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            length = 4;             // TODO: is this right?
            var instruction = m.PeekUint(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);
        }
        public override string Disassemble(MemoryDomain m, uint addr, out int length)
        {
            // FIXME: the PC register is actually 64-bits (although in practice it will only ever be 32-bits)
            _core.GetDisassembly(addr, m.PeekUint(addr, true), _disasmbuf);
            length = 4;
            var ret = Encoding.UTF8.GetString(_disasmbuf);
            var z   = ret.IndexOf('\0');

            if (z > -1)
            {
                ret = ret.Substring(0, z);                         // remove garbage past null terminator
            }
            ret = Regex.Replace(ret, @"\u001b?\[[0-9]{1,2}m", ""); // remove ANSI escape sequences
            ret = Regex.Replace(ret, @"\{.*\}", "");               // remove any {*} patterns
            return(ret);
        }
Exemple #8
0
        private int GetRamvalue(int addr)
        {
            int val;

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

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

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

            return(val);
        }
Exemple #9
0
 public void SetPreviousToCurrent(MemoryDomain domain, bool bigendian)
 {
     _previous = _prevFrame = domain.PeekUint(Address % domain.Size, bigendian);
 }
Exemple #10
0
 public MiniDWordWatch(MemoryDomain domain, long addr, bool bigEndian)
 {
     Address   = addr;
     _previous = domain.PeekUint(Address % domain.Size, bigEndian);
 }
 private uint DereferencePointer(uint ptrAddr, MemoryDomain domain) => domain.PeekUint(ptrAddr, domain.EndianType == MemoryDomain.Endian.Big) % (uint)domain.Size;
Exemple #12
0
 public void SetPreviousToCurrent(MemoryDomain domain, bool bigEndian)
 {
     _previous = domain.PeekUint(Address, bigEndian);
 }