Class: Dap::Filter::FilterDecodeMSSQLReply

Inherits:
Object
  • Object
show all
Includes:
BaseDecoder
Defined in:
lib/dap/filter/udp.rb

Overview

Decode a MSSQL reply

Instance Attribute Summary

Attributes included from Base

#name, #opts

Instance Method Summary collapse

Methods included from BaseDecoder

#process

Methods included from Base

#initialize, #process

Instance Method Details

#decode(data) ⇒ Object



295
296
297
298
299
300
301
302
303
# File 'lib/dap/filter/udp.rb', line 295

def decode(data)
  info = {}
  # Some binary characters often proceed key, restrict to alphanumeric and a few other common chars
  data.scan(/([A-Za-z0-9 \.\-_]+?);(.+?);/).each do | var, val|
    info["mssql.#{var.encode!( 'UTF-8', invalid: :replace, undef: :replace, replace: '' )}"] = val.encode!( 'UTF-8', invalid: :replace, undef: :replace, replace: '' )
  end

  info
end