Flutter Engine
The Flutter Engine
|
Classes | |
class | MachOError |
Functions | |
def | CheckedSeek (file, offset) |
def | CheckedRead (file, count) |
def | ReadUInt32 (file, endian) |
def | ReadMachHeader (file, endian) |
def | ReadFatArch (file) |
def | WriteUInt32 (file, uint32, endian) |
def | HandleMachOFile (file, options, offset=0) |
def | HandleFatFile (file, options, fat_offset=0) |
def | main (me, args) |
Variables | |
int | FAT_MAGIC = 0xcafebabe |
int | FAT_CIGAM = 0xbebafeca |
int | MH_MAGIC = 0xfeedface |
int | MH_CIGAM = 0xcefaedfe |
int | MH_MAGIC_64 = 0xfeedfacf |
int | MH_CIGAM_64 = 0xcffaedfe |
int | MH_EXECUTE = 0x2 |
int | MH_PIE = 0x00200000 |
int | MH_NO_HEAP_EXECUTION = 0x01000000 |
def change_mach_o_flags.CheckedRead | ( | file, | |
count | |||
) |
Reads |count| bytes from the file-like |file| object, raising a MachOError if any other number of bytes is read.
Definition at line 111 of file change_mach_o_flags.py.
def change_mach_o_flags.CheckedSeek | ( | file, | |
offset | |||
) |
Seeks the file-like object at |file| to offset |offset| and raises a MachOError if anything funny happens.
Definition at line 100 of file change_mach_o_flags.py.
def change_mach_o_flags.HandleFatFile | ( | file, | |
options, | |||
fat_offset = 0 |
|||
) |
Seeks the file-like |file| object to |offset| and loops over its |fat_header| entries, calling HandleMachOFile for each.
Definition at line 219 of file change_mach_o_flags.py.
def change_mach_o_flags.HandleMachOFile | ( | file, | |
options, | |||
offset = 0 |
|||
) |
Seeks the file-like |file| object to |offset|, reads its |mach_header|, and rewrites the header's |flags| field if appropriate. The header's endianness is detected. Both 32-bit and 64-bit Mach-O headers are supported (mach_header and mach_header_64). Raises MachOError if used on a header that does not have a known magic number or is not of type MH_EXECUTE. The MH_PIE and MH_NO_HEAP_EXECUTION bits are set or cleared in the |flags| field according to |options| and written to |file| if any changes need to be made. If already set or clear as specified by |options|, nothing is written.
Definition at line 173 of file change_mach_o_flags.py.
def change_mach_o_flags.main | ( | me, | |
args | |||
) |
Definition at line 240 of file change_mach_o_flags.py.
def change_mach_o_flags.ReadFatArch | ( | file | ) |
Reads an entire |fat_arch| structure (<mach-o/fat.h>) from the file-like |file| object, treating it as having endianness specified by |endian| (per the |struct| module), and returns a 5-tuple of its members as numbers. Raises a MachOError if the proper length of data can't be read from |file|.
Definition at line 149 of file change_mach_o_flags.py.
def change_mach_o_flags.ReadMachHeader | ( | file, | |
endian | |||
) |
Reads an entire |mach_header| structure (<mach-o/loader.h>) from the file-like |file| object, treating it as having endianness specified by |endian| (per the |struct| module), and returns a 7-tuple of its members as numbers. Raises a MachOError if the proper length of data can't be read from |file|.
Definition at line 135 of file change_mach_o_flags.py.
def change_mach_o_flags.ReadUInt32 | ( | file, | |
endian | |||
) |
Reads an unsigned 32-bit integer from the file-like |file| object, treating it as having endianness specified by |endian| (per the |struct| module), and returns it as a number. Raises a MachOError if the proper length of data can't be read from |file|.
Definition at line 123 of file change_mach_o_flags.py.
def change_mach_o_flags.WriteUInt32 | ( | file, | |
uint32, | |||
endian | |||
) |
Writes |uint32| as an unsigned 32-bit integer to the file-like |file| object, treating it as having endianness specified by |endian| (per the |struct| module).
Definition at line 162 of file change_mach_o_flags.py.
int change_mach_o_flags.FAT_CIGAM = 0xbebafeca |
Definition at line 82 of file change_mach_o_flags.py.
int change_mach_o_flags.FAT_MAGIC = 0xcafebabe |
Definition at line 81 of file change_mach_o_flags.py.
int change_mach_o_flags.MH_CIGAM = 0xcefaedfe |
Definition at line 86 of file change_mach_o_flags.py.
int change_mach_o_flags.MH_CIGAM_64 = 0xcffaedfe |
Definition at line 88 of file change_mach_o_flags.py.
int change_mach_o_flags.MH_EXECUTE = 0x2 |
Definition at line 89 of file change_mach_o_flags.py.
int change_mach_o_flags.MH_MAGIC = 0xfeedface |
Definition at line 85 of file change_mach_o_flags.py.
int change_mach_o_flags.MH_MAGIC_64 = 0xfeedfacf |
Definition at line 87 of file change_mach_o_flags.py.
int change_mach_o_flags.MH_NO_HEAP_EXECUTION = 0x01000000 |
Definition at line 91 of file change_mach_o_flags.py.
int change_mach_o_flags.MH_PIE = 0x00200000 |
Definition at line 90 of file change_mach_o_flags.py.