private Expression ReadSegmentedValue(DataType dt, Constant seg, Expression eOff) { var off = eOff as Constant; if (eOff != null) { var addr = arch.MakeSegmentedAddress(seg, off); if (!segmentMap.TryFindSegment(addr, out ImageSegment segment)) { return(Constant.Invalid); } var rdr = arch.CreateImageReader(segment.MemoryArea, addr); memAccesses[addr] = dt; if (dt == PrimitiveType.SegPtr32) { var addrRead = arch.ReadCodeAddress(dt.Size, rdr, null); if (addrRead != null) { return(addrRead); } else { //$REVIEW we want a warning here. OR the caller. return(Constant.Invalid); } } else { return(rdr.Read((PrimitiveType)dt)); } } throw new NotImplementedException(); }
public Expression MakeSegmentedAddress(Constant seg, Constant off) { return(arch.MakeSegmentedAddress(seg, off)); }