memtab.models module¶
Shared data models used across the memtab package.
This module defines the common data structures used by various parsers and other components of the memtab package to ensure a consistent interface.
- class memtab.models.MemtabCPU(memory_regions=<factory>, gcc_prefix='', name='', exclude_arm_sections=True, exclude_debug_sections=True, allow_zero_address_sections=False)¶
Bases:
objectDetails about the CPU. This is used to categorize symbols
-
allow_zero_address_sections:
bool= False¶
-
exclude_arm_sections:
bool= True¶
-
exclude_debug_sections:
bool= True¶
-
gcc_prefix:
str= ''¶
-
name:
str= ''¶
-
allow_zero_address_sections:
- class memtab.models.MemtabCategory(name='', categories=<factory>)¶
Bases:
objectName and subcategories for a symbol. This is used to categorize symbols
-
categories:
List[MemtabCategory]¶
-
name:
str= ''¶
-
categories:
- class memtab.models.MemtabConfig(Project='', CPU=<factory>, SourceCode=<factory>)¶
Bases:
objectConfiguration for the memory tabulator
-
Project:
str= ''¶
-
SourceCode:
MemtabSourceCode¶
- asdict()¶
Convert the config to a dictionary.
- Return type:
Dict[str,Any]
-
Project:
- class memtab.models.MemtabSourceCode(categories=<factory>, root='')¶
Bases:
objectDetails about source code
-
categories:
List[Dict[str,MemtabCategory]]¶
-
root:
str= ''¶
-
categories:
- class memtab.models.ParserResult(sections=<factory>, symbols=<factory>, regions=<factory>, metadata=<factory>)¶
Bases:
objectCommon result structure for all parsers.
This provides a consistent interface for Memtab to process parsing results from different sources.
-
metadata:
Dict[str,Any]¶
-
metadata:
- class memtab.models.Region(name, start, end, spare, size=0, flags='', region='')¶
Bases:
objectRepresents a memory region in the target system.
A memory region is a contiguous block of physical memory with specific properties (e.g., flash, RAM).
-
end:
int¶
-
flags:
str= ''¶
-
name:
str¶
-
region:
str= ''¶
-
size:
int= 0¶
-
spare:
int¶
-
start:
int¶
-
end:
- class memtab.models.Section(name, address, size, flags='', type='', calculated_symbol_size=0, unused=0)¶
Bases:
objectRepresents a section in a binary.
A section is a segment of the binary that contains code or data with specific properties (e.g., read-only, executable).
-
address:
int¶
-
calculated_symbol_size:
int= 0¶
-
flags:
str= ''¶
-
name:
str¶
-
size:
int¶
-
type:
str= ''¶
-
unused:
int= 0¶
-
address:
- class memtab.models.SubRegion(name, start, end, size=0, parent_region='')¶
Bases:
objectRepresents a sub-region of a memory region.
A sub-region is a segment of a memory region with specific properties, such as flash, RAM, etc.
-
end:
int¶
-
name:
str¶
-
parent_region:
str= ''¶
-
size:
int= 0¶
-
start:
int¶
-
end:
- class memtab.models.Symbol(name, address, size=0, type='', file='', line_number=0, region='', subregion='', elf_section='', commit='unknown', repo='', categories=<factory>)¶
Bases:
objectRepresents a symbol in a binary.
A symbol typically represents a function, variable, or other named entity in the compiled code.
-
address:
int¶
-
categories:
Dict[str,str]¶
-
commit:
str= 'unknown'¶
-
elf_section:
str= ''¶
-
file:
str= ''¶
-
line_number:
int= 0¶
-
name:
str¶
-
region:
str= ''¶
-
repo:
str= ''¶
-
size:
int= 0¶
-
subregion:
str= ''¶
- to_dict()¶
Convert the symbol to a dictionary representation.
- Return type:
Dict[str,Any]
-
type:
str= ''¶
-
address: