class TurboRex::Windows::ALPC::Server::ClientStub

Public Class Methods

new(communication_handle, conn_handle, transport, conn_message) click to toggle source
# File lib/turborex/windows/alpc.rb, line 690
def initialize(communication_handle, conn_handle, transport, conn_message)
  @communication_handle = communication_handle
  @connection_handle = conn_handle
  @conn_message = conn_message
  @transport = transport
  @client_id = conn_message.client_id
end

Public Instance Methods

gets(opts = {}) click to toggle source
# File lib/turborex/windows/alpc.rb, line 698
def gets(opts = {})
  @transport.recv(@connection_handle, opts)
end
Also aliased as: read
puts(message, message_id = nil, opts = {}) click to toggle source
# File lib/turborex/windows/alpc.rb, line 702
def puts(message, message_id = nil, opts = {})
  if message.is_a? String
    port_message = PortMessage.new(payload: message)
    if opts[:last_header]
      port_message.header = opts[:last_header]
    elsif message_id
      port_message.message_id = message_id
    else
      raise "Message ID must be specified when :last_header option is not specified."
    end
  elsif message.is_a? PortMessage
    port_message = message
  else
    raise TurboRex::Exception::ALPC::UnknownPayloadType
  end

  message_attr = opts.delete(:message_attr) || port_message.attributes
  @transport.send(@communication_handle, port_message.message, message_attr, opts)
end
Also aliased as: write
read(opts = {})
Alias for: gets
write(message, message_id = nil, opts = {})

def impersonate(msg)

ntstatus = APIProxy.ntalpcimpersonateclientofport(@communication_handle, msg.message, 0)
TurboRex::Windows::TinySDK.format_hex_ntstatus ntstatus

end

Alias for: puts