Class: Relyze::ExecutableFileModel::BasicBlock
- Inherits:
-
Object
- Object
- Relyze::ExecutableFileModel::BasicBlock
- Defined in:
- C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb
Instance Method Summary collapse
-
#add_reference(owner_rva, target_rva, target, flags = nil) ⇒ Object
Add a new reference from this block to a target location.
-
#adjacent ⇒ BasicBlock
Get the BasicBlock adjacent to this block.
-
#code? ⇒ true, false
Check of this basic block is code.
-
#color ⇒ Integer?
Get the color of this block, if any.
-
#color=(color) ⇒ Integer?
Set of clear the color of this block.
-
#custom_name? ⇒ true, false
Returns true if this blocks name was set by either symbols or user input.
-
#data? ⇒ true, false
Check of this basic block is data.
-
#datatype ⇒ DataType?
Get the DataType of this block, if any.
-
#datatype=(data_type) ⇒ Relyze::ExecutableFileModel::DataType
Sets this blocks data type.
-
#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.
-
#join ⇒ true, false
Try to join this block to its adjacent block.
-
#length ⇒ Integer
Get this basic blocks length in bytes.
-
#name(rva = nil) ⇒ String
Get the name of this basic block.
-
#name=(name) ⇒ String
Set or clear this blocks custom name.
-
#nearest_boundary(rva) ⇒ Integer
Return the RVA of the nearest boundary which contains the given RVA.
-
#next_boundary(rva) ⇒ Integer
Return the RVA of the next boundary relative to the current boundary at the given RVA.
-
#previous ⇒ BasicBlock
Get the BasicBlock previous to this block.
-
#previous_boundary(rva) ⇒ Integer
Return the RVA of the previous boundary relative to the current boundary at the given RVA.
-
#references(direction = nil) {|ref| ... } ⇒ Array<Relyze::ExecutableFileModel::Reference>?
Get every reference in to and out of this block.
-
#remove_reference(reference) ⇒ Object
Remove a reference out from this block and destroy it.
-
#render ⇒ String
Render this block to text as it is seen in the GUI.
-
#reprocess ⇒ BasicBlock
Reprocess this block if possible.
-
#rva ⇒ Integer
Get this basic blocks RVA location.
-
#segment ⇒ Segment
Get the Segment this basic block belongs to.
-
#set_datatype(data_type) ⇒ true, false
Sets this blocks data type.
-
#split(rva, type = nil) ⇒ BasicBlock
Split this block at the RVA location (which must be inside this block).
-
#to_s ⇒ String
Get a simple description of this basic block.
Instance Method Details
#add_reference(owner_rva, target_rva, target, flags = nil) ⇒ Object
Add a new reference from this block to a target location.
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 |
#adjacent ⇒ BasicBlock
Get the Relyze::ExecutableFileModel::BasicBlock 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.
908 909 910 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 908 def code? return self.type == :code end |
#color ⇒ Integer?
Get the color of this block, if any.
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.
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.
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.
901 902 903 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 901 def data? return self.type == :data end |
#datatype ⇒ DataType?
Get the DataType of this block, if any.
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.
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.
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 |
#join ⇒ true, 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.
1046 1047 1048 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1046 def join return false end |
#length ⇒ Integer
Get this basic blocks length in bytes.
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.
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.
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.
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.
1107 1108 1109 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1107 def next_boundary( rva ) return nil end |
#previous ⇒ BasicBlock
Get the Relyze::ExecutableFileModel::BasicBlock 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.
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.
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.
1073 1074 1075 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1073 def remove_reference( reference ) return false end |
#render ⇒ String
Render this block to text as it is seen in the GUI.
922 923 924 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 922 def render return nil end |
#reprocess ⇒ BasicBlock
Reprocess this block if possible.
1080 1081 1082 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 1080 def reprocess return self end |
#rva ⇒ Integer
Get this basic blocks RVA location.
929 930 931 |
# File 'C:/Program Files/Relyze/lib/relyze/core/executable_file_model.rb', line 929 def rva return nil end |
#segment ⇒ Segment
Get the Segment this basic block belongs to.
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.
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).
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_s ⇒ String
Get a simple description of this basic block.
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 |