mrcrowbar.lib.os.dos module

class mrcrowbar.lib.os.dos.B800Char(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

ansi_format()[source]
bg_colour = <Bits: offset=0x1, bits=0b1110000>
property char
code_point = <UInt8: offset=0x0>
fg_colour = <Bits: offset=0x1, bits=0b1111>
class mrcrowbar.lib.os.dos.B800Screen(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

B800_SCREEN_WIDTH = 80
ansi_format()[source]
chars = <BlockField: 0x00007f0c83471a90>
print()[source]
property text
class mrcrowbar.lib.os.dos.EXE(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

mz_header = <BlockField: 0x00007f0c834712b0>
class mrcrowbar.lib.os.dos.MZHeader(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

checksum = <UInt16_LE: offset=0x12>
property extra_offset
property header_size
header_size_raw = <UInt16_LE: offset=0x8>
initial_cs = <UInt16_LE: offset=0x16>
initial_ip = <UInt16_LE: offset=0x14>
initial_sp = <UInt16_LE: offset=0x10>
initial_ss = <UInt16_LE: offset=0xe>
last_page_size = <UInt16_LE: offset=0x2>
magic = <Bytes: offset=0x0, length=2>
max_alloc_raw = <UInt16_LE: offset=0xc>
min_alloc_raw = <UInt16_LE: offset=0xa>
overlay = <UInt16_LE: offset=0x1a>
page_count = <UInt16_LE: offset=0x4>
reltable_count = <UInt16_LE: offset=0x6>
reltable_offset = <UInt16_LE: offset=0x18>
class mrcrowbar.lib.os.dos.Relocation(source_data=None, parent=None, preload_attrs=None, endian=None, cache_bytes=False, path_hint=None)[source]

Bases: Block

Base class for Blocks.

source_data

Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.

parent

Parent Block object where this Block is defined. Used for e.g. evaluating Refs.

preload_attrs

Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.

endian

Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.

cache_bytes

Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.

path_hint

Cache a string containing the path of the current Block, relative to the root.

offset = <UInt16_LE: offset=0x0>
segment = <UInt16_LE: offset=0x2>
mrcrowbar.lib.os.dos.decode_nfo(buffer)[source]

Decodes a byte string in NFO format (beloved by PC scener groups) from DOS Code Page 437 to Unicode.