Class: TurboRex::Windows::ALPC::Client::ServerProxy
- Inherits:
-
Object
- Object
- TurboRex::Windows::ALPC::Client::ServerProxy
- Defined in:
- lib/turborex/windows/alpc.rb
Instance Method Summary collapse
- #disconnect ⇒ Object
- #gets(opts = {}) ⇒ Object (also: #read)
-
#initialize(communication_handle, transport, server_pid, server_tid) ⇒ ServerProxy
constructor
A new instance of ServerProxy.
- #puts(message, opts = {}) ⇒ Object (also: #write)
- #send_recv(message, opts = {}) ⇒ Object
Constructor Details
#initialize(communication_handle, transport, server_pid, server_tid) ⇒ ServerProxy
Returns a new instance of ServerProxy.
605 606 607 608 609 610 |
# 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 |
Instance Method Details
#disconnect ⇒ Object
646 647 648 |
# File 'lib/turborex/windows/alpc.rb', line 646 def disconnect @transport.close end |
#gets(opts = {}) ⇒ Object Also known as: read
612 613 614 |
# File 'lib/turborex/windows/alpc.rb', line 612 def gets(opts = {}) @transport.recv(@communication_handle, opts) end |
#puts(message, opts = {}) ⇒ Object Also known as: write
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 |
# File 'lib/turborex/windows/alpc.rb', line 616 def puts(, opts = {}) if .is_a? String = PortMessage.new(payload: ) if opts[:last_header] .header = opts[:last_header] end elsif .is_a? PortMessage = else raise TurboRex::Exception::ALPC::UnknownPayloadType end = opts.delete(:message_attr) || MessageAttribute.new.struct @transport.send(@communication_handle, ., , opts) end |
#send_recv(message, opts = {}) ⇒ Object
632 633 634 635 636 637 638 639 640 641 642 643 644 |
# File 'lib/turborex/windows/alpc.rb', line 632 def send_recv(, opts = {}) if .is_a? String = PortMessage.new(payload: ) elsif .is_a? ::Metasm::C::AllocCStruct = else raise TurboRex::Exception::ALPC::UnknownPayloadType end send_attr = .attributes || opts[:attributes] || 0 recv_attr = opts[:recv_attr] || MessageAttribute.new.struct @transport.send_recv(@communication_handle, ., send_attr, recv_attr) end |