Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
PEFile Class Reference
Inheritance diagram for PEFile:

Public Member Functions

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

Public Attributes

 code_size
 
 exp_rva
 
 file_alignment
 
 fp
 
 header_size
 
 image_size
 
 imp_rva
 
 imports
 
 initialized_size
 
 machine
 
 res_rva
 
 resources
 
 rva_offset
 
 section_alignment
 
 sections
 
 uninitialized_size
 
 vmem
 

Static Public Attributes

tuple imports = ()
 

Protected Member Functions

 _mark_address_modified (self, rva)
 

Member Function Documentation

◆ _mark_address_modified()

_mark_address_modified ( self,
rva )
protected

◆ add_icon()

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

◆ add_resource_section()

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()

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()

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

◆ close()

close ( self)

◆ get_address_offset()

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

◆ get_address_section()

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

◆ get_export_address()

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

◆ open()

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

◆ read()

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

◆ rename_export()

rename_export ( self,
old_name,
new_name )
 Renames a symbol in the export table. 

◆ write_changes()

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

◆ code_size

code_size

◆ exp_rva

exp_rva

◆ file_alignment

file_alignment

◆ fp

fp

◆ header_size

header_size

◆ image_size

image_size

◆ imp_rva

imp_rva

◆ imports [1/2]

tuple imports = ()
static

◆ imports [2/2]

imports

◆ initialized_size

initialized_size

◆ machine

machine

◆ res_rva

res_rva

◆ resources

resources

◆ rva_offset

rva_offset

◆ section_alignment

section_alignment

◆ sections

sections

◆ uninitialized_size

uninitialized_size

◆ vmem

vmem