Class: Relyze::ExecutableFileModel::BasicBlock

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

Direct Known Subclasses

CodeBlock, DataBlock

Instance Method Summary collapse

Instance Method Details

#add_reference(owner_rva, target_rva, target, flags = nil) ⇒ Object

Add a new reference from this block to a target location.

Parameters:

  • owner_rva (Integer)

    The RVA location where this reference is from. The owner_rva must be inside this block.

  • target_rva (Integer)

    The RVA location where this reference is to. The target_rva must be inside the target bock.

  • target (BasicBlock)

    The target block where this reference is to.

  • flags (Array<Symbol>, nil) (defaults to: nil)

    Optional flags to describe the reference. May contain :controlflow, :true, :false :unconditional. If :controlflow is used, an implicit reference is created, both the owner (this block) and target must be of type :code. If :controlflow is not used, then an explicit reference is created.



1066
1067
1068
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1066

def add_reference( owner_rva, target_rva, target, flags=nil )
    return nil
end

#adjacentBasicBlock

Get the Relyze::ExecutableFileModel::BasicBlock adjacent to this block.

Returns:

  • (BasicBlock)

    The block adjacent to this block



1004
1005
1006
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1004

def adjacent
    return nil
end

#code?true, false

Check of this basic block is code.

Returns:

  • (true, false)


908
909
910
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 908

def code?
    return self.type == :code
end

#colorInteger?

Get the color of this block, if any.

Returns:

  • (Integer, nil)

    Nil if no color set otherwise the color value.



982
983
984
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 982

def color
    return nil
end

#color=(color) ⇒ Integer?

Set of clear the color of this block.

Parameters:

  • color (Integer, nil)

    Nil to clear the color otherwise the color value to set.

Returns:

  • (Integer, nil)

    Nil if no color set otherwise the color value.



990
991
992
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 990

def color=( color )
    return color
end

#custom_name?true, false

Returns true if this blocks name was set by either symbols or user input. Returns false if analysis generated the name.

Returns:

  • (true, false)


943
944
945
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 943

def custom_name?
    return false
end

#data?true, false

Check of this basic block is data.

Returns:

  • (true, false)


901
902
903
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 901

def data?
    return self.type == :data
end

#datatypeDataType?

Get the DataType of this block, if any.

Returns:

  • (DataType, nil)

    This blocks data type or nil if none set.



1011
1012
1013
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1011

def datatype
    return nil
end

#datatype=(data_type) ⇒ Relyze::ExecutableFileModel::DataType

Sets this blocks data type. Returning the data type regardless of success or failure.

Parameters:

Returns:



1019
1020
1021
1022
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1019

def datatype=( data_type )
    self.set_datatype( data_type )
    return data_type
end

#display_name(rva = nil) ⇒ String

Get the name of this basic block as displayed in the GUI, which may be displaying mangled or unmangled names depending on the application settings.

Parameters:

  • rva (Integer, nil) (defaults to: nil)

    An optional RVA located in this basic block to use as an offset when composing the name.

Returns:

  • (String)

    the basic block name



952
953
954
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 952

def display_name( rva=nil )
    return nil
end

#jointrue, false

Try to join this block to its adjacent block. If the adjacent block is in a different segment it cannot be joined. If the adjacent block is of a different type is cannot be joined.

Returns:

  • (true, false)


1046
1047
1048
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1046

def join
    return false
end

#lengthInteger

Get this basic blocks length in bytes.

Returns:



936
937
938
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 936

def length
    return 0
end

#name(rva = nil) ⇒ String

Get the name of this basic block.

Parameters:

  • rva (Integer, nil) (defaults to: nil)

    An optional RVA located in this basic block to use as an offset when composing the name.

Returns:

  • (String)

    the basic block name



960
961
962
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 960

def name( rva=nil )
    return nil
end

#name=(name) ⇒ String

Set or clear this blocks custom name.

Parameters:

  • name (String, nil)

    Use a string to set the name. Use nil to clear the name.

Returns:



968
969
970
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 968

def name=( name )
    return name
end

#nearest_boundary(rva) ⇒ Integer

Return the RVA of the nearest boundary which contains the given RVA. For a CodeBlock a boundary is an Instruction. For a DataBlock a boundary is a DataType.

Parameters:

Returns:



1098
1099
1100
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1098

def nearest_boundary( rva )
    return nil
end

#next_boundary(rva) ⇒ Integer

Return the RVA of the next boundary relative to the current boundary at the given RVA. For a CodeBlock a boundary is an Instruction. For a DataBlock a boundary is a DataType.

Parameters:

Returns:



1107
1108
1109
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1107

def next_boundary( rva )
    return nil
end

#previousBasicBlock

Get the Relyze::ExecutableFileModel::BasicBlock previous to this block.

Returns:

  • (BasicBlock)

    The block previous to this block



997
998
999
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 997

def previous
    return nil
end

#previous_boundary(rva) ⇒ Integer

Return the RVA of the previous boundary relative to the current boundary at the given RVA. For a CodeBlock a boundary is an Instruction. For a DataBlock a boundary is a DataType.

Parameters:

Returns:



1089
1090
1091
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1089

def previous_boundary( rva )
    return nil
end

#references(direction = nil) {|ref| ... } ⇒ Array<Relyze::ExecutableFileModel::Reference>?

Get every reference in to and out of this block.

Parameters:

  • direction (Symbol, nil) (defaults to: nil)

    Either :in, :out, :any, or nil for both directions

Yields:

  • (ref)

    yields the ref to the block.

Yield Parameters:

Returns:



1056
1057
1058
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1056

def references( direction=nil )
    return nil
end

#remove_reference(reference) ⇒ Object

Remove a reference out from this block and destroy it.

Parameters:

  • reference (Reference)

    The reference to remove.



1073
1074
1075
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1073

def remove_reference( reference )
    return false
end

#renderString

Render this block to text as it is seen in the GUI.

Returns:

  • (String)

    The full text content of this block.



922
923
924
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 922

def render
    return nil
end

#reprocessBasicBlock

Reprocess this block if possible.

Returns:



1080
1081
1082
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1080

def reprocess
    return self
end

#rvaInteger

Get this basic blocks RVA location.

Returns:



929
930
931
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 929

def rva
    return nil
end

#segmentSegment

Get the Segment this basic block belongs to.

Returns:



975
976
977
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 975

def segment
    return nil
end

#set_datatype(data_type) ⇒ true, false

Sets this blocks data type. Returning true on success of false on failure.

Parameters:

Returns:

  • (true, false)

    True is the data type was set successfully, or false on failure.



1028
1029
1030
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1028

def set_datatype( data_type )
    return false
end

#split(rva, type = nil) ⇒ BasicBlock

Split this block at the RVA location (which must be inside this block).

Parameters:

  • rva (Integer)

    The RVA location to split the block at.

  • type (Symbol, nil) (defaults to: nil)

    The block type for the split portion, :code or :data or nil to split to the same type as self

Returns:

  • (BasicBlock)

    The new block created from the split or nil



1037
1038
1039
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1037

def split( rva, type=nil )
    return nil
end

#to_sString

Get a simple description of this basic block.

Returns:

  • (String)

    This basic blocks description.



915
916
917
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 915

def to_s
    return "BasicBlock: 0x%08X - %s - %s (%d bytes)" % [ self.rva, self.type, self.name, self.length ]
end
Generated on Tue Aug 9 11:52:01 2022 by yard 0.9.20 (ruby-2.6.5).