示例#1
0
        private const ushort IMAGE_REL_ARM_SECREL   = 0x000F; // Offset within section

        public override RelocationResults Relocate(Program program, Address addrLoad)
        {
            relocator = CreateRelocator(machine, program);
            var     relocations = imgLoaded.Relocations;
            Section relocSection;

            if ((relocSection = sectionList.Find(section => this.rvaBaseRelocationTable >= section.VirtualAddress && this.rvaBaseRelocationTable < section.VirtualAddress + section.VirtualSize)) != null)
            {
                ApplyRelocations(relocSection.OffsetRawData, relocSection.SizeRawData, addrLoad, relocations);
            }
            var addrEp   = platform.AdjustProcedureAddress(addrLoad + rvaStartAddress);
            var entrySym = CreateMainEntryPoint(
                (this.fileFlags & ImageFileDll) != 0,
                addrEp,
                platform);

            ImageSymbols[entrySym.Address] = entrySym;
            var entryPoints = new List <ImageSymbol> {
                entrySym
            };

            ReadExceptionRecords(addrLoad, rvaExceptionTable, sizeExceptionTable, ImageSymbols);
            AddExportedEntryPoints(addrLoad, SegmentMap, entryPoints);
            ReadImportDescriptors(addrLoad);
            ReadDeferredLoadDescriptors(addrLoad);
            return(new RelocationResults(entryPoints, ImageSymbols));
        }
示例#2
0
        private void RefreshForm()
        {
            List <WindowInstance> windows = Relocator.FindWindows();

            radDropDownListWindow.DataSource = windows;
            radDropDownListWindow.Rebind();

            radDropDownListScreen.DataSource = Screen.AllScreens;
        }
示例#3
0
        private void radButtonRelocate_Click(object sender, EventArgs e)
        {
            WindowInstance selectedWindow = (WindowInstance)radDropDownListWindow.SelectedItem.Value;
            Screen         selectedScreen = (Screen)radDropDownListScreen.SelectedItem.Value;
            int            x = StringFormatter.ToInt(radTextBoxX.Text, 0);
            int            y = StringFormatter.ToInt(radTextBoxY.Text, 0);

            Relocator.Relocate(selectedWindow.handerId, selectedScreen, x, y, radCheckBoxRemoveTitle.Checked);
        }
示例#4
0
        private const ushort IMAGE_REL_ARM_SECREL   = 0x000F; // Offset within section

        public override RelocationResults Relocate(Program program, Address addrLoad)
        {
            relocator = CreateRelocator(machine, program);
            var     relocations = imgLoaded.Relocations;
            Section relocSection;

            if (sectionMap.TryGetValue(".reloc", out relocSection))
            {
                ApplyRelocations(relocSection.OffsetRawData, relocSection.SizeRawData, (uint)addrLoad.ToLinear(), relocations);
            }
            var addrEp      = platform.AdjustProcedureAddress(addrLoad + rvaStartAddress);
            var entryPoints = new List <EntryPoint> {
                CreateMainEntryPoint(
                    (this.fileFlags & ImageFileDll) != 0,
                    addrEp,
                    platform)
            };
            var functions = ReadExceptionRecords(addrLoad, rvaExceptionTable, sizeExceptionTable);

            AddExportedEntryPoints(addrLoad, ImageMap, entryPoints);
            ReadImportDescriptors(addrLoad);
            ReadDeferredLoadDescriptors(addrLoad);
            return(new RelocationResults(entryPoints, functions));
        }
示例#5
0
 /// <summary>
 /// Changes the CurrentDirectory to the new location and updates other properties.
 /// </summary>
 public virtual void Relocate(string path)
 {
     Relocator.Relocate(path);
 }