Ejemplo n.º 1
0
        private bool RelativeBranchCall(EndianImageReader rdr, uint opcode, out uint target)
        {
            int callOffset = (sbyte)opcode;

            if (callOffset == -1// bsr.l
                &&
                rdr.IsValidOffset(rdr.Offset + 4u))
            {
                callOffset = rdr.PeekBeInt32(2);
                target     = (uint)(callOffset + (long)rdr.Address.ToLinear() + 2);
                return(true);
            }
            if (callOffset == 0x00 // bsr.w)
                &&
                rdr.IsValidOffset(rdr.Offset + 2u))
            {
                callOffset = rdr.PeekBeInt16(2);
                target     = (uint)(callOffset + (long)rdr.Address.ToLinear() + 2);
                return(true);
            }
            target = (uint)(callOffset + (long)rdr.Address.ToLinear() + 2);
            return(true);
        }