DOS MZ¶
- class cle.backends.MZ[source]¶
Bases:
BackendLoader for ordinary 8086 DOS MZ executables.
The load module is represented in a canonical 20-bit linear address space:
segment * 16 + offset. The Program Segment Prefix and runtime-selected extra allocation beyond the header’s required minimum are not materialized.- is_default = True¶
- __init__(*args, **kwargs)[source]¶
- Parameters:
binary – The path to the binary to load
binary_stream – The open stream to this binary. The reference to this will be held until you call close.
is_main_bin – Whether this binary should be loaded as the main executable
- property mapped_address_bits: int¶
Width of the flat address space CLE uses for this object’s mappings.
- rebase(new_base)[source]¶
Rebase backend’s regions to the new base where they were mapped by the loader
- classmethod is_compatible(stream)[source]¶
Determine quickly whether this backend can load an object from this stream
MZ load modules use a canonical 20-bit linear analysis space. Their linked
base is zero, so default loading preserves the relative segment words stored
in the image. A paragraph-aligned base_addr together with
force_rebase=True models a concrete DOS load segment and applies every
header relocation to the corresponding word.
The single load-module segment includes the minimum allocation requested by the header in its memory size. Only bytes declared by the executable are backed; the Program Segment Prefix, uninitialized allocation, trailing overlays, and other DOS runtime state are not synthesized.
- class cle.backends.mz.MZ[source]¶
Bases:
BackendLoader for ordinary 8086 DOS MZ executables.
The load module is represented in a canonical 20-bit linear address space:
segment * 16 + offset. The Program Segment Prefix and runtime-selected extra allocation beyond the header’s required minimum are not materialized.- is_default = True¶
- __init__(*args, **kwargs)[source]¶
- Parameters:
binary – The path to the binary to load
binary_stream – The open stream to this binary. The reference to this will be held until you call close.
is_main_bin – Whether this binary should be loaded as the main executable
- property mapped_address_bits: int¶
Width of the flat address space CLE uses for this object’s mappings.
- rebase(new_base)[source]¶
Rebase backend’s regions to the new base where they were mapped by the loader
- classmethod is_compatible(stream)[source]¶
Determine quickly whether this backend can load an object from this stream
- class cle.backends.mz.MZHeader[source]¶
Bases:
objectThe fixed DOS MZ executable header.
- property maximum_allocation_size: int¶
The memory DOS gives the program when it has that much to spare.
- property entry_rva: int | None¶
IP names no byte of it.
- Type:
Offset of the entry point in the load module, or None if CS
- property stack_rva: int | None¶
SP names nothing DOS would give the program.
The stack may sit one byte past the end of the allocation, because DOS starts a program with SP at the top of the block and every push decrements it first.
- Type:
Offset of the initial stack, or None if SS
- __init__(bytes_in_last_page: int, pages_in_file: int, relocation_count: int, header_paragraphs: int, minimum_extra_paragraphs: int, maximum_extra_paragraphs: int, initial_ss: int, initial_sp: int, checksum: int, initial_ip: int, initial_cs: int, relocation_table_offset: int, overlay_number: int) None¶
- Parameters:
- Return type:
None