Class: Relyze::FileModel
- Inherits:
-
Object
- Object
- Relyze::FileModel
- Defined in:
- C:/Program Files/Relyze/lib/relyze/core/file_model.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Array, Information, Structure, Value
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
A frozen String of this files data.
Instance Method Summary collapse
-
#abort ⇒ Object
If this model is currently being analyzed, abort and terminate analysis.
-
#add_auxiliary_text(title, text) ⇒ true, false
Add a blob of text to the model, which is displayed in the Overview section.
-
#add_entropy_marker(name, offset, length) ⇒ true, false
Add a new entropy marker to the model.
-
#add_information(info) ⇒ Relyze::FileModel::Information?
Add a new Information object to the model.
-
#current_file_name ⇒ Integer
The current file name for this model which may be different from the original if this model was saved to an archive.
-
#current_file_path ⇒ Integer
The current file path for this model which may be different from the original if this model was saved to an archive.
-
#entropy_markers {|info| ... } ⇒ Array<Array>?
Get all the entropy markers for this model.
-
#file_size ⇒ Integer
The file size.
-
#file_type ⇒ String
A description of the file type.
-
#get_entropy(offset) ⇒ Float
Get the entropy at a specific offset.
-
#information {|info| ... } ⇒ Array<Relyze::FileModel::Information>?
Get all the Information object for this model.
-
#initialize ⇒ FileModel
constructor
A new instance of FileModel.
-
#origional_file_name ⇒ Integer
The original file name when this model was first analyzed.
-
#origional_file_path ⇒ Integer
The original file path when this model was first analyzed.
-
#read_buffer(offset, length) ⇒ String?
Read some data from the models buffer.
-
#realloc_buffer(size) ⇒ true, false
Reallocate the model buffer to hold a new size (in bytes) which may be greater or smaller than the original size, preserving as much of the original contents of the buffer as will fit.
-
#remove_information(info) ⇒ true, false
Remove an Information object from the model.
-
#restart ⇒ Object
If this model is currently being analyzed, restart the analysis from the beginning of the pipeline.
-
#run_plugin(guid, commandline = nil) ⇒ true, false
Run a plugin against a model.
-
#structure ⇒ Relyze::FileModel::Structure
Get this models Structure.
-
#synchronize_read ⇒ Object
Hold the models read lock while executing the supplied block.
-
#synchronize_write ⇒ Object
(also: #synchronize)
Hold the models write lock while executing the supplied block.
- #to_s ⇒ String
-
#type ⇒ Symbol?
Get the type of FileModel.
-
#write_buffer(offset, buffer) ⇒ Integer?
Write some data to the models buffer.
Constructor Details
#initialize ⇒ FileModel
Returns a new instance of FileModel
238 239 240 241 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 238 def initialize # a frozen string @buffer = '' end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
A frozen String of this files data. To modify the buffer, use the #write_buffer method.
236 237 238 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 236 def buffer @buffer end |
Instance Method Details
#abort ⇒ Object
If this model is currently being analyzed, abort and terminate analysis.
439 440 441 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 439 def abort return nil end |
#add_auxiliary_text(title, text) ⇒ true, false
Add a blob of text to the model, which is displayed in the Overview section.
376 377 378 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 376 def add_auxiliary_text( title, text ) return false end |
#add_entropy_marker(name, offset, length) ⇒ true, false
Add a new entropy marker to the model.
394 395 396 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 394 def add_entropy_marker( name, offset, length ) return false end |
#add_information(info) ⇒ Relyze::FileModel::Information?
Add a new Information object to the model.
359 360 361 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 359 def add_information( info ) return info end |
#current_file_name ⇒ Integer
Returns The current file name for this model which may be different from the original if this model was saved to an archive.
314 315 316 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 314 def current_file_name return '' end |
#current_file_path ⇒ Integer
Returns The current file path for this model which may be different from the original if this model was saved to an archive.
319 320 321 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 319 def current_file_path return '' end |
#entropy_markers {|info| ... } ⇒ Array<Array>?
Get all the entropy markers for this model.
408 409 410 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 408 def entropy_markers return nil end |
#file_size ⇒ Integer
Returns The file size.
282 283 284 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 282 def file_size return 0 end |
#file_type ⇒ String
Returns A description of the file type.
287 288 289 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 287 def file_type return '' end |
#get_entropy(offset) ⇒ Float
Get the entropy at a specific offset.
384 385 386 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 384 def get_entropy( offset ) return 0.0 end |
#information {|info| ... } ⇒ Array<Relyze::FileModel::Information>?
Get all the Information object for this model.
333 334 335 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 333 def information return [] end |
#origional_file_name ⇒ Integer
Returns The original file name when this model was first analyzed.
304 305 306 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 304 def origional_file_name return '' end |
#origional_file_path ⇒ Integer
Returns The original file path when this model was first analyzed.
309 310 311 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 309 def origional_file_path return '' end |
#read_buffer(offset, length) ⇒ String?
Read some data from the models buffer.
248 249 250 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 248 def read_buffer( offset, length ) return nil end |
#realloc_buffer(size) ⇒ true, false
Reallocate the model buffer to hold a new size (in bytes) which may be greater or smaller than the original size, preserving as much of the original contents of the buffer as will fit.
267 268 269 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 267 def realloc_buffer( size ) return false end |
#remove_information(info) ⇒ true, false
Remove an Information object from the model.
367 368 369 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 367 def remove_information( info ) return false end |
#restart ⇒ Object
If this model is currently being analyzed, restart the analysis from the beginning of the pipeline. Only the models buffer will be preserved.
446 447 448 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 446 def restart return nil end |
#run_plugin(guid, commandline = nil) ⇒ true, false
Run a plugin against a model. The plugin will run in the current thread so you may hold the models read/write lock if needed. The plugins run method will be called.
464 465 466 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 464 def run_plugin( guid, commandline=nil ) return false end |
#structure ⇒ Relyze::FileModel::Structure
Get this models Structure.
434 435 436 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 434 def structure return nil end |
#synchronize_read ⇒ Object
Hold the models read lock while executing the supplied block.
272 273 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 272 def synchronize_read end |
#synchronize_write ⇒ Object Also known as: synchronize
Hold the models write lock while executing the supplied block.
276 277 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 276 def synchronize_write end |
#to_s ⇒ String
299 300 301 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 299 def to_s return "FileModel: %s (%s)" % [ self.current_file_path, self.file_type ] end |
#type ⇒ Symbol?
Get the type of FileModel
294 295 296 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 294 def type return nil end |
#write_buffer(offset, buffer) ⇒ Integer?
Write some data to the models buffer.
257 258 259 |
# File 'C:/Program Files/Relyze/lib/relyze/core/file_model.rb', line 257 def write_buffer( offset, buffer ) return nil end |