class TurboRex::Windows::ALPC::Client::ServerProxy

Public Class Methods

new(communication_handle, transport, server_pid, server_tid) click to toggle source
# File lib/turborex/windows/alpc.rb, line 605
def initialize(communication_handle, transport, server_pid, server_tid)
  @communication_handle = communication_handle
  @transport = transport
  @server_pid = server_pid
  @server_tid = server_tid
end

Public Instance Methods

disconnect() click to toggle source
# File lib/turborex/windows/alpc.rb, line 646
def disconnect
  @transport.close
end
gets(opts = {}) click to toggle source
# File lib/turborex/windows/alpc.rb, line 612
def gets(opts = {})
  @transport.recv(@communication_handle, opts)
end
Also aliased as: read
puts(message, opts = {}) click to toggle source
# File lib/turborex/windows/alpc.rb, line 616
def puts(message, opts = {})
  if message.is_a? String
    port_message = PortMessage.new(payload: message)
    if opts[:last_header]
      port_message.header = opts[:last_header]
    end
  elsif message.is_a? PortMessage
    port_message = message
  else
    raise TurboRex::Exception::ALPC::UnknownPayloadType
  end

  message_attr = opts.delete(:message_attr) || MessageAttribute.new.struct
  @transport.send(@communication_handle, port_message.message, message_attr, opts)
end
Also aliased as: write
read(opts = {})
Alias for: gets
send_recv(message, opts = {}) click to toggle source
# File lib/turborex/windows/alpc.rb, line 632
def send_recv(message, opts = {})
  if message.is_a? String
    port_message = PortMessage.new(payload: message)
  elsif message.is_a? ::Metasm::C::AllocCStruct
    port_message = message
  else
    raise TurboRex::Exception::ALPC::UnknownPayloadType
  end

  send_attr = port_message.attributes || opts[:attributes] || 0
  recv_attr = opts[:recv_attr] || MessageAttribute.new.struct
  @transport.send_recv(@communication_handle, port_message.message, send_attr, recv_attr)
end
write(message, opts = {})
Alias for: puts