本文整理汇总了C#中Reko.Core.MemoryArea.WriteLeUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# MemoryArea.WriteLeUInt16方法的具体用法?C# MemoryArea.WriteLeUInt16怎么用?C# MemoryArea.WriteLeUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reko.Core.MemoryArea
的用法示例。
在下文中一共展示了MemoryArea.WriteLeUInt16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RelocateSegmentReferences
private void RelocateSegmentReferences(MemoryArea image)
{
foreach (var seg in segments)
{
foreach (var reloc in seg.Relocations)
{
image.WriteLeUInt16((uint)((reloc.Segment.Selector - addrBase.Selector.Value) * 16u + reloc.Offset), seg.Selector);
}
}
}
示例2: Relocate91
// Unpacks the relocation entries in a LzExe 0.91 binary
private SegmentMap Relocate91(byte [] abUncompressed, ushort segReloc, MemoryArea pgmImgNew)
{
const int CompressedRelocationTableAddress = 0x0158;
var relocations = pgmImgNew.Relocations;
int ifile = lzHdrOffset + CompressedRelocationTableAddress;
int rel_off=0;
for (;;)
{
ushort span = abUncompressed[ifile++];
if (span == 0)
{
span = abUncompressed[ifile++];
span |= (ushort) (abUncompressed[ifile++] << 8);
if (span == 0)
{
rel_off += 0x0FFF0;
continue;
}
else if (span == 1)
{
break;
}
}
rel_off += span;
ushort seg = (ushort) (pgmImgNew.ReadLeUInt16((uint)rel_off) + segReloc);
pgmImgNew.WriteLeUInt16((uint)rel_off, seg);
relocations.AddSegmentReference((uint)rel_off, seg);
segmentMap.AddSegment(
new ImageSegment(
seg.ToString("X4"),
Address.SegPtr(seg, 0),
this.imgLoaded,
AccessMode.ReadWriteExecute));
}
return segmentMap;
}