Class: TurboRex::MSRPC::IStream

Inherits:
Object
  • Object
show all
Defined in:
lib/turborex/msrpc/decompiler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(isource, base) ⇒ IStream

Returns a new instance of IStream.



8
9
10
11
# File 'lib/turborex/msrpc/decompiler.rb', line 8

def initialize(isource, base)
  @isource = isource
  @base = @init_base = base
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



6
7
8
# File 'lib/turborex/msrpc/decompiler.rb', line 6

def base
  @base
end

Instance Method Details

#base_drift(drift) ⇒ Object



21
22
23
# File 'lib/turborex/msrpc/decompiler.rb', line 21

def base_drift(drift)
  @base += drift
end

#read(len, offset = 0) ⇒ Object



13
14
15
# File 'lib/turborex/msrpc/decompiler.rb', line 13

def read(len, offset=0)
  @isource.read(@base+offset, len)
end

#resetObject



25
26
27
28
# File 'lib/turborex/msrpc/decompiler.rb', line 25

def reset
  @base = @init_base
  true
end

#set_base(base) ⇒ Object



17
18
19
# File 'lib/turborex/msrpc/decompiler.rb', line 17

def set_base(base)
  @base = base
end