InsertBytes() public méthode

See IByteProvider.InsertBytes for more information.
public InsertBytes ( long index, byte bs ) : void
index long
bs byte
Résultat void
        private void btnInsertWord_Click(object sender, EventArgs e)
        {
            long offset = Position.RoundDown(4);
            long index  = offset / 4;

            DynamicFileByteProvider d = hexBox1.ByteProvider as DynamicFileByteProvider;

            d._supportsInsDel = true;
            d.InsertBytes(offset, new byte[] { 0, 0, 0, 0 });
            d._supportsInsDel = false;

            if (index == _relocations.Count)
            {
                _relocations.Add(new Relocation(_section, (int)index));
            }
            else
            {
                _relocations.Insert((int)index, new Relocation(_section, (int)index));
                foreach (ModuleDataNode s in ((ModuleNode)_section.Root).Sections)
                {
                    foreach (Relocation r in s.Relocations)
                    {
                        FixRelocation(r, 1, offset);
                    }
                }
            }

            for (int i = (int)index + 1; i < _relocations.Count; i++)
            {
                _relocations[i]._index++;
            }

            PosChanged();
        }
Exemple #2
0
        private void btnInsertWord_Click(object sender, EventArgs e)
        {
            long offset = Position.RoundDown(4);
            long index  = offset / 4;

            DynamicFileByteProvider d = hexBox1.ByteProvider as DynamicFileByteProvider;

            d._supportsInsDel = true;
            d.InsertBytes(offset, new byte[] { 0, 0, 0, 0 });
            d._supportsInsDel = false;
            FixRelocations(1, offset);

            PosChanged();
        }