Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
PEFile Class Reference
Inheritance diagram for PEFile:

Public Member Functions

def add_icon (self, icon, ordinal=2)
 
def add_resource_section (self)
 
def add_section (self, name, flags, data)
 
def add_version_info (self, file_ver, product_ver, data, lang=1033, codepage=1200)
 
def close (self)
 
def get_address_offset (self, addr)
 
def get_address_section (self, addr)
 
def get_export_address (self, symbol_name)
 
def open (self, fn, mode='r')
 
def read (self, fp)
 
def write_changes (self)
 

Public Attributes

 exp_rva
 
 file_alignment
 
 fp
 
 header_size
 
 imp_rva
 
 imports
 
 res_rva
 
 resources
 
 rva_offset
 
 sections
 
 uninitialized_size
 
 vmem
 

Static Public Attributes

tuple imports = ()
 

Member Function Documentation

◆ add_icon()

def add_icon (   self,
  icon,
  ordinal = 2 
)
Adds an icon resource from the given Icon object.  Requires
calling add_resource_section() afterwards. 

◆ add_resource_section()

def add_resource_section (   self)
Adds a resource section to the file containing the resources that
were previously added via add_icon et al.  Assumes the file does not
contain a resource section yet. 

◆ add_section()

def add_section (   self,
  name,
  flags,
  data 
)
Adds a new section with the given name, flags and data.  The
virtual address space is automatically resized to fit the new data.

Returns the newly created Section object. 

◆ add_version_info()

def add_version_info (   self,
  file_ver,
  product_ver,
  data,
  lang = 1033,
  codepage = 1200 
)
Adds a version info resource to the file. 

◆ close()

def close (   self)

◆ get_address_offset()

def get_address_offset (   self,
  addr 
)
Turns an address into a offset relative to the file beginning. 

◆ get_address_section()

def get_address_section (   self,
  addr 
)
Returns the section that this virtual address belongs to. 

◆ get_export_address()

def get_export_address (   self,
  symbol_name 
)
Finds the virtual address for a named export symbol. 

◆ open()

def open (   self,
  fn,
  mode = 'r' 
)

◆ read()

def read (   self,
  fp 
)
Reads a PE file from the given file object, which must be opened
in binary mode. 

◆ write_changes()

def write_changes (   self)
Assuming the file was opened in read-write mode, writes back the
changes made via this class to the .exe file. 

Member Data Documentation

◆ exp_rva

exp_rva

◆ file_alignment

file_alignment

◆ fp

fp

◆ header_size

header_size

◆ imp_rva

imp_rva

◆ imports [1/2]

tuple imports = ()
static

◆ imports [2/2]

imports

◆ res_rva

res_rva

◆ resources

resources

◆ rva_offset

rva_offset

◆ sections

sections

◆ uninitialized_size

uninitialized_size

◆ vmem

vmem