Class: Msf::EncoderState
- Inherits:
-
Object
- Object
- Msf::EncoderState
- 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
-
#badchars ⇒ Object
:nodoc:.
-
#buf ⇒ Object
:nodoc:.
-
#context ⇒ Object
:nodoc:.
-
#context_address ⇒ Object
The address that contains they key on the target machine.
-
#context_encoding ⇒ Object
A boolean that indicates whether context encoding is enabled.
-
#decoder_key_offset ⇒ Object
Decoder settings.
-
#decoder_key_pack ⇒ Object
Decoder settings.
-
#decoder_key_size ⇒ Object
Decoder settings.
-
#decoder_stub ⇒ Object
:nodoc:.
-
#encoded ⇒ Object
:nodoc:.
-
#key ⇒ Object
:nodoc:.
-
#orig_buf ⇒ Object
readonly
:nodoc:.
-
#orig_key ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#init_key(key) ⇒ Object
Set the initial encoding key.
-
#initialize(key = nil) ⇒ EncoderState
constructor
Initializes a new encoder state, optionally with a key.
-
#reset(key = nil) ⇒ Object
Reset the encoder state by initializing the encoded buffer to an empty string.
Constructor Details
#initialize(key = nil) ⇒ EncoderState
Initializes a new encoder state, optionally with a key.
16 17 18 19 20 |
# File 'lib/msf/core/encoder.rb', line 16 def initialize(key = nil) @orig_buf = nil @buf = nil reset(key) end |
Instance Attribute Details
#badchars ⇒ Object
:nodoc:
54 55 56 |
# File 'lib/msf/core/encoder.rb', line 54 def badchars @badchars end |
#buf ⇒ Object
:nodoc:
50 51 52 |
# File 'lib/msf/core/encoder.rb', line 50 def buf @buf end |
#context ⇒ Object
:nodoc:
53 54 55 |
# File 'lib/msf/core/encoder.rb', line 53 def context @context end |
#context_address ⇒ Object
The address that contains they key on the target machine
59 60 61 |
# File 'lib/msf/core/encoder.rb', line 59 def context_address @context_address end |
#context_encoding ⇒ Object
A boolean that indicates whether context encoding is enabled
57 58 59 |
# File 'lib/msf/core/encoder.rb', line 57 def context_encoding @context_encoding end |
#decoder_key_offset ⇒ Object
Decoder settings
62 63 64 |
# File 'lib/msf/core/encoder.rb', line 62 def decoder_key_offset @decoder_key_offset end |
#decoder_key_pack ⇒ Object
Decoder settings
62 63 64 |
# File 'lib/msf/core/encoder.rb', line 62 def decoder_key_pack @decoder_key_pack end |
#decoder_key_size ⇒ Object
Decoder settings
62 63 64 |
# File 'lib/msf/core/encoder.rb', line 62 def decoder_key_size @decoder_key_size end |
#decoder_stub ⇒ Object
:nodoc:
63 64 65 |
# File 'lib/msf/core/encoder.rb', line 63 def decoder_stub @decoder_stub end |
#encoded ⇒ Object
:nodoc:
52 53 54 |
# File 'lib/msf/core/encoder.rb', line 52 def encoded @encoded end |
#key ⇒ Object
:nodoc:
48 49 50 |
# File 'lib/msf/core/encoder.rb', line 48 def key @key end |
#orig_buf ⇒ Object (readonly)
:nodoc:
51 52 53 |
# File 'lib/msf/core/encoder.rb', line 51 def orig_buf @orig_buf end |
#orig_key ⇒ Object
:nodoc:
49 50 51 |
# File 'lib/msf/core/encoder.rb', line 49 def orig_key @orig_key end |
Instance Method Details
#init_key(key) ⇒ Object
Set the initial encoding key.
35 36 37 38 |
# File 'lib/msf/core/encoder.rb', line 35 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.
26 27 28 29 30 |
# File 'lib/msf/core/encoder.rb', line 26 def reset(key = nil) init_key(key) self.encoded = '' end |