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



283
284
285
286
287
288
289
290
291
# File 'lib/dap/filter/udp.rb', line 283

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