Class: Relyze::ExecutableFileModel::Segment

Inherits:
Object
  • Object
show all
Defined in:
C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb

Instance Method Summary collapse

Instance Method Details

#executable?true, false

Check if this segment is executable.

Returns:

  • (true, false)


787
788
789
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 787

def executable?
    return self.execute
end

#executetrue, false

Check if this segment is executable.

Returns:

  • (true, false)


773
774
775
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 773

def execute
    return nil
end

#execute=(execute) ⇒ Object

Set this segment as executable.

Parameters:

  • execute (true, false)


780
781
782
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 780

def execute=( execute )
    return nil
end

#initialized_lengthInteger

Get this segments initialized length in bytes.

Returns:



822
823
824
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 822

def initialized_length
    return 0
end

#last_initialized_rvaInteger

Get this segments last initialized RVA location.

Returns:



808
809
810
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 808

def last_initialized_rva
    return nil
end

#last_rvaInteger

Get this segments last RVA location.

Returns:



801
802
803
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 801

def last_rva
    return nil
end

#lengthInteger

Get this segments total length in bytes.

Returns:



815
816
817
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 815

def length
    return 0
end

#modelRelyze::ExecutableFileModel

Get the Relyze::ExecutableFileModel which owns this segment.



843
844
845
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 843

def model
    return nil
end

#nameString

Get the segment name

Returns:

  • (String)

    The segment name.



717
718
719
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 717

def name
    return nil
end

#name=(name) ⇒ Object

Set the segment name.

Parameters:

  • name (String)

    The segment name.



724
725
726
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 724

def name=( name )
    return nil
end

#offset2rva(offset) ⇒ Integer?

Convert a segment offset to an RVA location if possible.

Parameters:

  • offset (Integer)

    An offset in this segment

Returns:

  • (Integer, nil)

    An RVA location corresponding to the given offset in this segment, or nil on failure.



884
885
886
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 884

def offset2rva( offset )
    return nil
end

#readtrue, false

Check if this segment is readable.

Returns:

  • (true, false)


731
732
733
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 731

def read
    return nil
end

#read=(read) ⇒ Object

Set this segment as readable.

Parameters:

  • read (true, false)


738
739
740
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 738

def read=( read )
    return nil
end

#read_buffer(offset, length) ⇒ String?

Read some data from this segment.

Parameters:

  • offset (Integer)

    An offset into this segment to read from.

  • length (Integer)

    The number of bytes to read.

Returns:

  • (String, nil)

    The read data or nil on failure.



859
860
861
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 859

def read_buffer( offset, length )
    return nil
end

#readable?true, false

Check if this segment is readable.

Returns:

  • (true, false)


745
746
747
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 745

def readable?
    return self.read
end

#rvaInteger

Get this segments RVA within the model that owns it.

Returns:



794
795
796
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 794

def rva
    return nil
end

#rva2offset(rva) ⇒ Integer?

Convert an RVA location to a segment offset if possible.

Parameters:

  • rva (Integer)

    An RVA location in this segment.

Returns:

  • (Integer, nil)

    An offset in this segment corresponding to the given RVA location, or nil on failure.



876
877
878
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 876

def rva2offset( rva )
    return nil
end

#to_sString

Get a simple description of this segment.

Returns:

  • (String)

    This segments description.



850
851
852
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 850

def to_s
    return "Segment: %s (%s%s%s)" % [ self.name, (self.readable? ? 'R' : '-'), (self.writable? ? 'W' : '-'), (self.executable? ? 'X' : '-') ]
end

#uninitialized?true, false

Check if this segment is entirely uninitialized.

Returns:

  • (true, false)


836
837
838
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 836

def uninitialized?
    return false
end

#uninitialized_lengthInteger

Get this segments uninitialised length in bytes.

Returns:



829
830
831
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 829

def uninitialized_length
    return 0
end

#writable?true, false

Check if this segment is writable.

Returns:

  • (true, false)


766
767
768
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 766

def writable?
    return self.write
end

#writetrue, false

Check if this segment is writable.

Returns:

  • (true, false)


752
753
754
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 752

def write
    return nil
end

#write=(write) ⇒ Object

Set this segment as writable.

Parameters:

  • write (true, false)


759
760
761
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 759

def write=( write )
    return nil
end

#write_buffer(offset, buffer) ⇒ Integer?

Write some data to this segment.

Parameters:

  • offset (Integer)

    An offset into this segment to write to.

  • buffer (String)

    The data to write.

Returns:

  • (Integer, nil)

    Nil on failure or else the number of bytes written.



868
869
870
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 868

def write_buffer( offset, buffer )
    return nil
end