lib/ruby_smb/smb2/dcerpc.rb in ruby_smb-0.0.22 vs lib/ruby_smb/smb2/dcerpc.rb in ruby_smb-0.0.23

- old
+ new

@@ -11,12 +11,14 @@ shares.map{|s|{name: s[0], type: s[1], comment: s[2]}} end def bind(options={}) bind_req = RubySMB::Dcerpc::Bind.new(options) - ioctl_response = ioctl_send_recv(bind_req, options) + write(data: bind_req.to_binary_s) + @size = 1024 + dcerpc_raw_response = read() begin - dcerpc_response = RubySMB::Dcerpc::BindAck.read(ioctl_response.output_data) + dcerpc_response = RubySMB::Dcerpc::BindAck.read(dcerpc_raw_response) rescue IOError raise RubySMB::Dcerpc::Error::InvalidPacket, "Error reading the DCERPC response" end unless dcerpc_response.pdu_header.ptype == RubySMB::Dcerpc::PTypes::BIND_ACK raise RubySMB::Dcerpc::Error::BindError, "Not a BindAck packet"