Module: Ronin::Payloads::Mixins::Binary
- Defined in:
 - lib/ronin/payloads/mixins/binary.rb
 
Overview
Adds support for packing binary data.
Instance Method Summary collapse
- 
  
    
      #pack(type, value)  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
Packs a binary value for the given type.
 - 
  
    
      #perform_validate  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Validates that the payload defines an
archmethod and that all required params are set. - 
  
    
      #platform  ⇒ Ronin::Support::Binary::CTypes, ... 
    
    
  
  
  
  
  
  
  
  
  
    
The target platform.
 
Instance Method Details
#pack(type, value) ⇒ String
Packs a binary value for the given type.
      100 101 102  | 
    
      # File 'lib/ronin/payloads/mixins/binary.rb', line 100 def pack(type,value) platform[type].pack(value) end  | 
  
#perform_validate ⇒ Object
Validates that the payload defines an arch method and that all
required params are set.
      48 49 50 51 52 53 54 55 56 57 58  | 
    
      # File 'lib/ronin/payloads/mixins/binary.rb', line 48 def perform_validate unless respond_to?(:arch) raise(ValidationError,"payload #{self.class} did not include Ronin::Payloads::Metadata::Arch") end unless arch raise(ValidationError,"payload #{self.class} did not include define an architecture") end super() end  |