Sha256: 3b1c33b40a5b41301367589bbff10db0cdb5f02a629c5254387a55e448c13b4f

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

module RubySMB
  module Dcerpc
    module Winreg

      class RpcHkey < Ndr::NdrContextHandle; end

      # This class represents a BaseRegEnumValue Request Packet as defined in
      # [3.1.5.11 BaseRegEnumValue (Opnum 10)](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rrp/56e99ef3-05dc-4f24-bcf5-9cff00412945)
      class EnumValueRequest < BinData::Record
        attr_reader :opnum

        endian :little

        rpc_hkey           :hkey
        uint32             :dw_index
        rrp_unicode_string :lp_value_name
        string             :pad, length: -> { pad_length }
        ndr_lp_dword       :lp_type
        ndr_lp_byte        :lp_data
        ndr_lp_dword       :lpcb_data
        ndr_lp_dword       :lpcb_len

        def initialize_instance
          super
          @opnum = REG_ENUM_VALUE
        end

        # Determines the correct length for the padding in front of
        # #lp_type. It should always force a 4-byte alignment.
        def pad_length
          offset = (lp_value_name.abs_offset + lp_value_name.to_binary_s.length) % 4
          (4 - offset) % 4
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby_smb-2.0.2 lib/ruby_smb/dcerpc/winreg/enum_value_request.rb
ruby_smb-2.0.1 lib/ruby_smb/dcerpc/winreg/enum_value_request.rb
ruby_smb-2.0.0 lib/ruby_smb/dcerpc/winreg/enum_value_request.rb
ruby_smb-1.1.0 lib/ruby_smb/dcerpc/winreg/enum_value_request.rb