public void AddSegmentsFrom(IHex B) { foreach (var a in B.DecodedSegment) { var seg = this.FindOrCreateSegment(a.Value.lowestoffset); for (int i = 0; i < a.Value.Bytes.Count(); i++) { seg.Set((int)a.Value.lowestoffset + i, a.Value.Bytes[(int)i]); } } }
public static void Merge(string file1, string file2, string outfile) { IHex A = new IHex(file1); IHex B = new IHex(file2); IHex I = new IHex(); I.AddSegmentsFrom(B); I.AddSegmentsFrom(A); I.Save(outfile); }