Class: Msf::EncoderState

Inherits:
Object
  • Object
show all
Defined in:
lib/msf/core/encoder.rb

Overview

This class is used to track the state of a single encoding operation from start to finish.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key = nil) ⇒ EncoderState

Initializes a new encoder state, optionally with a key.


17
18
19
20
21
# File 'lib/msf/core/encoder.rb', line 17

def initialize(key = nil)
  @orig_buf = nil
  @buf = nil
  reset(key)
end

Instance Attribute Details

#badcharsObject

:nodoc:


55
56
57
# File 'lib/msf/core/encoder.rb', line 55

def badchars
  @badchars
end

#bufObject

:nodoc:


51
52
53
# File 'lib/msf/core/encoder.rb', line 51

def buf
  @buf
end

#contextObject

:nodoc: :nodoc:


54
55
56
# File 'lib/msf/core/encoder.rb', line 54

def context
  @context
end

#context_addressObject

The address that contains they key on the target machine


60
61
62
# File 'lib/msf/core/encoder.rb', line 60

def context_address
  @context_address
end

#context_encodingObject

A boolean that indicates whether context encoding is enabled


58
59
60
# File 'lib/msf/core/encoder.rb', line 58

def context_encoding
  @context_encoding
end

#decoder_key_offsetObject

Decoder settings


63
64
65
# File 'lib/msf/core/encoder.rb', line 63

def decoder_key_offset
  @decoder_key_offset
end

#decoder_key_packObject

Decoder settings


63
64
65
# File 'lib/msf/core/encoder.rb', line 63

def decoder_key_pack
  @decoder_key_pack
end

#decoder_key_sizeObject

Decoder settings


63
64
65
# File 'lib/msf/core/encoder.rb', line 63

def decoder_key_size
  @decoder_key_size
end

#decoder_stubObject

:nodoc:


64
65
66
# File 'lib/msf/core/encoder.rb', line 64

def decoder_stub
  @decoder_stub
end

#encodedObject

Returns the value of attribute encoded


53
54
55
# File 'lib/msf/core/encoder.rb', line 53

def encoded
  @encoded
end

#keyObject

:nodoc:


49
50
51
# File 'lib/msf/core/encoder.rb', line 49

def key
  @key
end

#orig_bufObject (readonly)

:nodoc:


52
53
54
# File 'lib/msf/core/encoder.rb', line 52

def orig_buf
  @orig_buf
end

#orig_keyObject

:nodoc:


50
51
52
# File 'lib/msf/core/encoder.rb', line 50

def orig_key
  @orig_key
end

Instance Method Details

#init_key(key) ⇒ Object

Set the initial encoding key.


36
37
38
39
# File 'lib/msf/core/encoder.rb', line 36

def init_key(key)
  self.key      = key
  self.orig_key = key
end

#reset(key = nil) ⇒ Object

Reset the encoder state by initializing the encoded buffer to an empty string.


27
28
29
30
31
# File 'lib/msf/core/encoder.rb', line 27

def reset(key = nil)
  init_key(key)

  self.encoded  = ''
end