diff --git a/modules/encoders/x86/unicode_mixed.rb b/modules/encoders/x86/unicode_mixed.rb index f298cf5ef2..6c755d9dd6 100644 --- a/modules/encoders/x86/unicode_mixed.rb +++ b/modules/encoders/x86/unicode_mixed.rb @@ -32,9 +32,11 @@ class UnicodeMixed < Msf::Encoder::Alphanum # being encoded. # def decoder_stub(state) - reg = datastore['BufferRegister'] || raise RuntimeError, "Need BufferRegister" + reg = datastore['BufferRegister'] offset = datastore['BufferOffset'].to_i || 0 - + if (not reg) + raise RuntimeError, "Need BufferRegister" + end Rex::Encoder::Alpha2::UnicodeMixed::gen_decoder(reg, offset) end diff --git a/modules/encoders/x86/unicode_upper.rb b/modules/encoders/x86/unicode_upper.rb index fdcccecf9b..39eee7faa9 100644 --- a/modules/encoders/x86/unicode_upper.rb +++ b/modules/encoders/x86/unicode_upper.rb @@ -32,9 +32,11 @@ class UnicodeUpper < Msf::Encoder::Alphanum # being encoded. # def decoder_stub(state) - reg = datastore['BufferRegister'] || raise RuntimeError, "Need BufferRegister" + reg = datastore['BufferRegister'] offset = datastore['BufferOffset'].to_i || 0 - + if (not reg) + raise RuntimeError, "Need BufferRegister" + end Rex::Encoder::Alpha2::UnicodeUpper::gen_decoder(reg, offset) end