mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-18 15:14:10 +01:00

[#36737359] active_support/dependencies cannot resolve missing constants in Metasploit modules because the wrapper module is anonymous. In order to make the wrapper module non-anonymous, the module must be assigned to a constant. Since we don't want modules colliding, the wrapper module needs a unique name, so use the module lookup name to derive the proper nested module names to namespace the wrapper module. All derived modules are nested under Msf::Modules. The name derivation handles invalid characters for constant names such as digits as the first character or non-alphanumeric character. The invalid constant name characters are converted to their hex value and prefixed with X, so '-' in a name become 'X2d'.