Class: Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::Malloc

Inherits:
Base
  • Object
show all
Defined in:
lib/metasploit/framework/obfuscation/crandomizer/code_factory/malloc.rb

Instance Attribute Summary

Attributes inherited from Base

#code, #dep

Instance Method Summary collapse

Methods inherited from Base

#good_dep?, #normalized_stub

Constructor Details

#initializeMalloc

Returns a new instance of Malloc.



11
12
13
14
# File 'lib/metasploit/framework/obfuscation/crandomizer/code_factory/malloc.rb', line 11

def initialize
  super
  @dep = ['malloc']
end

Instance Method Details

#stubObject



16
17
18
19
20
21
22
23
# File 'lib/metasploit/framework/obfuscation/crandomizer/code_factory/malloc.rb', line 16

def stub
  var_name = "m#{Metasploit::Framework::Obfuscation::CRandomizer::Utility.rand_int}"
  %Q|
  void* malloc(unsigned int);
  void stub() {
    void* #{var_name} = malloc(#{Metasploit::Framework::Obfuscation::CRandomizer::Utility.rand_int});
  }|
end