-
-
Notifications
You must be signed in to change notification settings - Fork 1
Developer
This page explains
- How mona.py is structured internally
- Naming conventions
- Helper functions
You can find a diagram explaing the desired Class layout here.
Note: this is a work in progress. The current version of mona is note entirely structured like that yet.
mona3 uses a small set of naming conventions to make it easier to recognize the role and scope of an identifier at a glance.
Classes use the Mn prefix followed by PascalCase.
Examples:
MnDebuggerMnProcMnModuleMnConfig
This makes mona-specific classes easy to spot in a large codebase.
Mutable module-level globals use the g_ prefix and snake_case.
Examples:
g_silentg_ptr_counterg_windbg_flavorg_os_version
Use this convention for module-level state that can change during execution.
Module-level cache objects use a leading underscore, snake_case, and a _cache suffix.
Examples:
_memory_page_acl_cache_config_file_cache_cfg_table_cache
Use this convention for dictionaries or lists that cache data for a certain object type or subsystem.
Constant-like values use uppercase names.
Examples:
TOP_USERLANDSTACK_POINTERPROGRAM_COUNTERPTR_SIZE
Use uppercase for values that are treated as fixed for the lifetime of the current mona session or architecture context.
- Prefer snake_case for functions, methods, and non-class variables unless an existing legacy name must be preserved.
- Prefer descriptive names over short abbreviations unless the shorter form is already well-established in mona.
- When adding new module-level mutable state, decide explicitly whether it is regular global state (
g_...) or cache state (_..._cache).