def __init__(self,cp,directives="-defaultlib:LIBCMT -defaultlib:OLDNAMES "): self.cp = cp self.directives=directives self.lastFunction = None self.lastBf = None self.lastEf = None self.lastEfPos = 0 c = coffFile() c.MachineType = coffFile.I386MAGIC self.coff = c
def __init__(self, cp, directives="-defaultlib:LIBCMT -defaultlib:OLDNAMES "): self.cp = cp self.directives = directives self.lastFunction = None self.lastBf = None self.lastEf = None self.lastEfPos = 0 c = coffFile() c.MachineType = coffFile.I386MAGIC self.coff = c
# Copyright 2004-2010 Grant T. Olson. # See license.txt for terms. from pyasm.coff import coffFile, coffSection, coffRelocationEntry, coffSymbolEntry from pyasm.coffConst import * import time,os,sys """Creates a simple .objfile that should be good enough to link as a hello world program""" c = coffFile() c.MachineType = coffFile.I386MAGIC s1 = coffSection() s1.Name = ".drectve" s1.Flags = (SectionFlags.LNK_REMOVE | SectionFlags.LNK_INFO | SectionFlags.ALIGN_1BYTES) s1.RawData = '-defaultlib:LIBCMT -defaultlib:OLDNAMES ' c.Sections.append(s1) s2 = coffSection() s2.Name = ".text\x00\x00\x00" s2.Flags = (SectionFlags.CNT_CODE | SectionFlags.LNK_COMDAT | SectionFlags.MEM_EXECUTE | SectionFlags.MEM_READ | SectionFlags.ALIGN_16BYTES) s2.RawData = "\x68\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x83\xC4\x04\x33\xC0\xC3"
# Copyright 2004-2010 Grant T. Olson. # See license.txt for terms. from pyasm.coff import coffFile, coffSection, coffRelocationEntry, coffSymbolEntry from pyasm.coffConst import * import time, os, sys """Creates a simple .objfile that should be good enough to link as a hello world program""" c = coffFile() c.MachineType = coffFile.I386MAGIC s1 = coffSection() s1.Name = ".drectve" s1.Flags = SectionFlags.LNK_REMOVE | SectionFlags.LNK_INFO | SectionFlags.ALIGN_1BYTES s1.RawData = "-defaultlib:LIBCMT -defaultlib:OLDNAMES " c.Sections.append(s1) s2 = coffSection() s2.Name = ".text\x00\x00\x00" s2.Flags = ( SectionFlags.CNT_CODE | SectionFlags.LNK_COMDAT | SectionFlags.MEM_EXECUTE | SectionFlags.MEM_READ | SectionFlags.ALIGN_16BYTES ) s2.RawData = "\x68\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x83\xC4\x04\x33\xC0\xC3"