Represents an offset to a value or structure in an assembly, containing the raw, virtual and relative virtual address.
Example #1
0
 public OffsetEditorDlg(Offset offset, Win32Assembly assembly)
 {
     InitializeComponent();
     this.offset = offset;
     this.original = offset;
     this.assembly = assembly;
     RefreshTextBoxes();
 }
Example #2
0
 internal DataDirectory(Section targetSection, uint headerOffset, uint rva, uint size)
 {
     this.headerOffset = headerOffset;
     this.size = size;
     if (rva != 0)
     {
         OffsetConverter converter = new OffsetConverter(targetSection);
         this.targetOffset = Offset.FromRva(rva, targetSection.ParentAssembly);
         this.targetSection = targetSection;
     }
 }
Example #3
0
 internal DataDirectory(DataDirectoryName name, Section targetSection, uint headerOffset, Structures.IMAGE_DATA_DIRECTORY rawDataDir)
 {
     this._name = name;
     this._headerOffset = headerOffset;
     this._rawDataDir = rawDataDir;
     if (rawDataDir.RVA == 0 || targetSection == null)
     {
         _targetOffset = new Offset(0, 0, 0);
     }
     else
     {
         this._targetOffset = Offset.FromRva(rawDataDir.RVA, targetSection.ParentAssembly);
         this._targetSection = targetSection;
     }
 }
Example #4
0
 internal DataDirectory(DataDirectoryName name, Section targetSection, uint headerOffset, Structures.IMAGE_DATA_DIRECTORY rawDataDir)
 {
     this.name = name;
     this.headerOffset = headerOffset;
     this.rawDataDir = rawDataDir;
     if (rawDataDir.RVA == 0)
     {
         targetOffset = new Offset(0, 0, 0, ASM.OperandType.Normal);
     }
     else
     {
         OffsetConverter converter = new OffsetConverter(targetSection);
         this.targetOffset = Offset.FromRva(rawDataDir.RVA, targetSection.ParentAssembly);
         this.targetSection = targetSection;
     }
 }
Example #5
0
        internal DataDirectory(DataDirectoryName name, Section[] assemblySections, uint offset, Structures.IMAGE_DATA_DIRECTORY rawDataDir)
        {
            this._rawDataDir = rawDataDir;
            this._name = name;
            if (rawDataDir.RVA == 0)
            {
                _targetOffset = new Offset(0, 0, 0);
            }
            else
            {
                this._headerOffset = offset;

                _targetSection = Section.GetSectionByRva(assemblySections, rawDataDir.RVA);
                if (_targetSection == null)
                    this.TargetOffset = new Offset(0, rawDataDir.RVA, 0);
                else
                    this._targetOffset = Offset.FromRva(rawDataDir.RVA, assemblySections[0].ParentAssembly);
            }
        }
Example #6
0
        internal DataDirectory(DataDirectoryName name, Section[] assemblySections, uint offset, uint rva, uint size)
        {
            try
            {
                this.name = name;
                if (rva == 0)
                {
                    offset = 0;
                    targetOffset = new Offset(0, 0, 0, ASM.OperandType.Normal);
                    size = 0;
                }
                else
                {
                    this.headerOffset = offset;

                    targetSection = Section.GetSectionByRva(assemblySections, rva);
                    this.size = size;
                    this.targetOffset = Offset.FromRva(rva, assemblySections[0].ParentAssembly);
                }
            }
            catch (Exception ex)
            {
            }
        }
Example #7
0
 private void textBox1_Leave(object sender, EventArgs e)
 {
     try
     {
         offset = Offset.FromFileOffset(uint.Parse(textBox1.Text, NumberStyles.HexNumber), assembly);
         RefreshTextBoxes();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         textBox1.Text = "00000000";
     }
 }
Example #8
0
 private void button2_Click(object sender, EventArgs e)
 {
     offset = original;
     Close();
 }
Example #9
0
 internal Myx86Instruction()
 {
     OpCode = x86OpCodes.Unknown;
     Offset = new Offset(0, 0, 0);
 }