Class: Metasploit::Framework::Obfuscation::CRandomizer::Utility
- Inherits:
-
Object
- Object
- Metasploit::Framework::Obfuscation::CRandomizer::Utility
- Defined in:
- lib/metasploit/framework/obfuscation/crandomizer/utility.rb
Class Method Summary collapse
-
.parse(code) ⇒ Metasm::C::Parser
Returns a Metasm parser.
-
.rand_int ⇒ Integer
Returns a random number.
-
.rand_string ⇒ String
Returns a random string.
Class Method Details
.parse(code) ⇒ Metasm::C::Parser
Returns a Metasm parser.
29 30 31 32 33 34 |
# File 'lib/metasploit/framework/obfuscation/crandomizer/utility.rb', line 29 def self.parse(code) parser = Metasm::C::Parser.new parser.allow_bad_c = true parser.parse(code) parser end |
.rand_int ⇒ Integer
Returns a random number.
14 15 16 |
# File 'lib/metasploit/framework/obfuscation/crandomizer/utility.rb', line 14 def self.rand_int SecureRandom.random_number(100000000) end |
.rand_string ⇒ String
Returns a random string.
21 22 23 |
# File 'lib/metasploit/framework/obfuscation/crandomizer/utility.rb', line 21 def self.rand_string SecureRandom.hex end |