Ejemplo n.º 1
0
        public void SetSection(SearchSectionType type, NSOSegmentHeader section)
        {
            var secs = new List <SearchSection>();

            secs.Add(new SearchSection
            {
                offset     = section.FileOffset,
                offsetEnd  = section.FileOffset + section.DecompressedSize,
                address    = section.MemoryOffset,
                addressEnd = section.MemoryOffset + section.DecompressedSize
            });
            SetSection(type, secs);
        }
        public void SetSection(SearchSectionType type, ulong imageBase, SectionHeader[] sections)
        {
            var secs = new List <SearchSection>();

            foreach (var section in sections)
            {
                secs.Add(new SearchSection {
                    offset     = section.PointerToRawData,
                    offsetEnd  = section.PointerToRawData + section.SizeOfRawData,
                    address    = section.VirtualAddress + imageBase,
                    addressEnd = section.VirtualAddress + section.VirtualSize + imageBase
                });
            }
            SetSection(type, secs);
        }
Ejemplo n.º 3
0
        private void SetSection(SearchSectionType type, List <SearchSection> secs)
        {
            switch (type)
            {
            case SearchSectionType.Exec:
                exec = secs;
                break;

            case SearchSectionType.Data:
                data = secs;
                break;

            case SearchSectionType.Bss:
                bss = secs;
                break;
            }
        }
Ejemplo n.º 4
0
        public void SetSection(SearchSectionType type, MachoSection64Bit[] sections)
        {
            var secs = new List <SearchSection>();

            foreach (var section in sections)
            {
                if (section != null)
                {
                    secs.Add(new SearchSection
                    {
                        offset     = section.offset,
                        offsetEnd  = section.offset + section.size,
                        address    = section.addr,
                        addressEnd = section.addr + section.size
                    });
                }
            }
            SetSection(type, secs);
        }
Ejemplo n.º 5
0
        public void SetSection(SearchSectionType type, Elf64_Phdr[] sections)
        {
            var secs = new List <SearchSection>();

            foreach (var section in sections)
            {
                if (section != null)
                {
                    secs.Add(new SearchSection
                    {
                        offset     = section.p_offset,
                        offsetEnd  = section.p_offset + section.p_filesz,
                        address    = section.p_vaddr,
                        addressEnd = section.p_vaddr + section.p_memsz
                    });
                }
            }
            SetSection(type, secs);
        }
Ejemplo n.º 6
0
        public void SetSection(SearchSectionType type, params NSOSegmentHeader[] sections)
        {
            var secs = new List <SearchSection>();

            foreach (var section in sections)
            {
                if (section != null)
                {
                    secs.Add(new SearchSection
                    {
                        offset     = section.FileOffset,
                        offsetEnd  = section.FileOffset + section.DecompressedSize,
                        address    = section.MemoryOffset,
                        addressEnd = section.MemoryOffset + section.DecompressedSize
                    });
                }
            }
            SetSection(type, secs);
        }
Ejemplo n.º 7
0
 public void SetSection(SearchSectionType type, params SearchSection[] secs)
 {
     SetSection(type, secs.ToList());
 }