Class: RubySMB::Field::Stringz16
- Inherits:
-
BinData::Stringz
- Object
- BinData::Stringz
- RubySMB::Field::Stringz16
- Defined in:
- lib/ruby_smb/field/stringz16.rb
Overview
Represents a NULL-Terminated String in UTF-16
Direct Known Subclasses
Dcerpc::Ndr::NdrConfVarWideStringz, Dcerpc::Ndr::NdrVarWideStringz, Dcerpc::Samr::PsamprServerName
Instance Method Summary collapse
Instance Method Details
#assign(val) ⇒ Object
5 6 7 |
# File 'lib/ruby_smb/field/stringz16.rb', line 5 def assign(val) super(binary_string(val.encode('utf-16le'))) end |
#snapshot ⇒ Object
9 10 11 12 13 14 |
# File 'lib/ruby_smb/field/stringz16.rb', line 9 def snapshot # override to always remove trailing zero bytes result = _value result = trim_and_zero_terminate(result) result.chomp("\0\0").force_encoding('utf-16le') end |