Пример #1
0
        public void writeOptionalHeader(BinaryOut outfile)
        {
            outfile.putTwo(magicNum);
            outfile.putOne(majorLinkerVersion);
            outfile.putOne(minorLinkerVersion);
            outfile.putFour(sizeOfCode);
            outfile.putFour(sizeOfInitializedData);
            outfile.putFour(sizeOfUninitializedData);
            outfile.putFour(addressOfEntryPoint);
            outfile.putFour(baseOfCode);
            outfile.putFour(baseOfData);
            outfile.putFour(imageBase);
            outfile.putFour(memAlignment);
            outfile.putFour(fileAlignment);
            outfile.putTwo(majorOSVersion);
            outfile.putTwo(minorOSVersion);
            outfile.putTwo(majorImageVersion);
            outfile.putTwo(minorImageVersion);
            outfile.putTwo(majorSubsystemVersion);
            outfile.putTwo(minorSubsystemVersion);
            outfile.putFour(win32VersionValue);
            outfile.putFour(sizeOfImage);
            outfile.putFour(sizeOfHeaders);
            outfile.putFour(checksum);
            outfile.putTwo(subsystem);
            outfile.putTwo(dLLCharacteristics);
            outfile.putFour(sizeOfStackReserve);
            outfile.putFour(sizeOfStackCommit);
            outfile.putFour(sizeOfHeapReserve);
            outfile.putFour(sizeOfHeapCommit);
            outfile.putFour(loaderFlags);
            outfile.putFour(numberOfRvaAndSizes);

            dExportTable.writeOut(outfile);
            dImportTable.writeOut(outfile);
            dResourceTable.writeOut(outfile);
            exceptionTable.writeOut(outfile);
            certificatesTable.writeOut(outfile);
            baseRelocationTable.writeOut(outfile);
            debugTable.writeOut(outfile);
            architecture.writeOut(outfile);
            globalPtr.writeOut(outfile);
            threadLocalStorageTable.writeOut(outfile);
            loadConfigurationTable.writeOut(outfile);
            boundImportTable.writeOut(outfile);
            importAddressTable.writeOut(outfile);
            delayImportDescriptor.writeOut(outfile);
            CLRRuntimeHeader.writeOut(outfile);
            reserved.writeOut(outfile);
        }
Пример #2
0
 public void writeToFile(BinaryOut outfile)
 {
     outfile.putString(name);
     outfile.putFour((uint)addr);
     //int b = (typ == IMPORTTYPE.DIR32) ? 0 : 1;
     outfile.putOne((uint)typ);
 }