private bool AbsoluteJumpCall(EndianImageReader rdr, uint opcode, out uint target) { if ((opcode & 1) == 0) { if (rdr.IsValidOffset(rdr.Offset + 2u)) { target = (uint)(int)rdr.PeekBeInt16(2); return(true); } } else { if (rdr.IsValidOffset(rdr.Offset + 4u)) { target = rdr.PeekBeUInt32(2); return(true); } } target = 0; return(false); }
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); }