示例#1
0
文件: PEData.cs 项目: GeGuNa/mona-os
        private void ReadPEHeaders()
        {
            int offset = Util.GetInt32(this.data, 0x3c);

            offset  += 4;
            this.pe1 = new PEFileHeader();
            this.pe1.ReadData(this.data, offset);
            offset  += 20;
            this.pe2 = new PEHeaderStandardFields();
            this.pe2.ReadData(this.data, offset);
            this.pe3 = new PEHeaderWindowsNTSpecificFields();
            this.pe3.ReadData(this.data, offset);
            this.pe4 = new PEHeaderDataDirectories();
            this.pe4.ReadData(this.data, offset);
            offset += 224;
            this.ReadSections(offset);
            int addr_it = RVAManager.GetAddress(this.pe4.ImportTable);

            if (addr_it == 0)
            {
                return;
            }
            ArrayList list = new ArrayList();

            for (int ad = this.rva.ConvertToPhysical(addr_it); !Util.IsZero(this.data, ad, 20); ad += 20)
            {
                ImportTable it = new ImportTable();
                it.ReadData(this.data, ad);
                it.AppendTitle(string.Format(" \"{0}\"", Util.EscapeText(Util.GetASCIIString(this.data, this.rva.ConvertToPhysical(it.Name)))));
                list.Add(it);
            }
            this.imptbl = list.ToArray(typeof(ImportTable)) as ImportTable[];
        }
示例#2
0
文件: PEData.cs 项目: GeGuNa/mona-os
 private void Init()
 {
     this.data   = null;
     this.rva    = null;
     this.idxm   = null;
     this.pe1    = null;
     this.pe2    = null;
     this.pe3    = null;
     this.pe4    = null;
     this.imptbl = null;
     this.sects  = null;
     this.cli    = null;
     this.mdroot = null;
 }