예제 #1
0
        public virtual ISection CopySectionType(ISection tmpl, string new_name)
        {
            ISection ret;

            if (tmpl is ContentsSection)
            {
                ret = new ContentsSection(this);
            }
            else if (tmpl is BssSection)
            {
                ret = new BssSection(this);
            }
            else
            {
                throw new NotImplementedException();
            }

            ret.AddrAlign    = tmpl.AddrAlign;
            ret.IsAlloc      = tmpl.IsAlloc;
            ret.IsExecutable = tmpl.IsExecutable;
            ret.IsWriteable  = tmpl.IsWriteable;
            ret.LoadAddress  = tmpl.LoadAddress;
            ret.Name         = new_name ?? tmpl.Name;

            AddSection(ret);

            return(ret);
        }
예제 #2
0
 public virtual ISection GetRDataSection()
 {
     if (rdata == null)
     {
         rdata              = new ContentsSection(this);
         rdata.Name         = ".rdata";
         rdata.IsAlloc      = true;
         rdata.IsWriteable  = false;
         rdata.IsExecutable = false;
         rdata.AddrAlign    = (int)Bitness / 4;
         AddSection(rdata);
     }
     return(rdata);
 }