Class: Relyze::Application

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

Overview

The Application is a singleton instance and is always available to a plugin via the @relyze variable.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApplication

Returns a new instance of Application



273
274
275
276
277
278
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 273

def initialize
    @threads       = {}
    @threads_mutex = ::Mutex.new
    @library       = nil
    @plugins       = {}
end

Instance Attribute Details

#libraryObject

Get the Library object.



249
250
251
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 249

def library
  @library
end

#pluginsObject

Get a Hash of every plugin available in the application. The key is the plugin GUID and the value is an Hash of information about the plugin.

Examples:

List the current decoder plugins

@relyze.plugins.each do | plugin_guid, plugin_info |
    if( plugin_info[:type] == :decoder )
        print_message( plugin_info )
    end
end

# prints out a hash containing the following...
# {
#    :file_path   => "C:/Users/Relyze/Documents/Relyze/Plugins/decoders/zlib_decompress.rb", 
#    :name        => "Zlib Decompress", 
#    :description => "Decompress a buffer via Zlib inflate", 
#    :authors     => ["Relyze Software Limited"], 
#    :license     => "Relyze Plugin License", 
#    :type        => :decoder, 
#    :version     => "1.0"
# } 


271
272
273
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 271

def plugins
  @plugins
end

Instance Method Details

#active_tabRelyze::FileModel?

Gets the model for the currently selected tab in the GUI

Returns:



720
721
722
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 720

def active_tab
    return nil
end

#add_plugin_thread(plugin, thread) ⇒ Object

A helper method to manage a plugins threads. Not to be called directly.



281
282
283
284
285
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 281

def add_plugin_thread( plugin, thread )
    @threads_mutex.synchronize do
        @threads[thread] = plugin
    end
end

#analyze_buffer(buffer, options = {}) ⇒ Relyze::FileModel? Also known as: analyse_buffer

Analyze a raw buffer and return the resulting model. No dialogs are displayed and the model is not displayed in the GUI.

Parameters:

  • buffer (String)

    The raw buffer to analyze.

  • options (Hash) (defaults to: {})

    The options to analyze the file with.

Options Hash (options):

  • :file_path (String)

    The pseudo file name to use for this buffers analysis. Default 'file.bin'.

  • :analyze_code (true, false)

    Whether to analyze code or just structure. Default true.

  • :multi_threaded_analysis (true, false)

    Multi thread the analysis for improved performance. Default true.

  • :static_library_analysis (true, false)

    Perform static library analysis. Default true.

  • :static_library_analysis_ignore (true, false)

    Don't perform static library analysis if we already loaded embedded symbols. Default true.

  • :jump_table_analysis (true, false)

    Perform jump table analysis. Default true.

  • :indirect_call_analysis (true, false)

    Perform indirect call analysis. Default true.

  • :propagate_function_datatypes (true, false)

    Propagate function data types. Default true.

  • :embedded_symbols (true, false)

    Load symbols if available. Default true.

  • :embedded_symbols_load_lines (true, false)

    Load symbol lines if available. Default false.

  • :precompiled_header_symbols (true, false)

    Load types from the pre compiled header symbols. Default true.

  • :seh_analysis (true, false)

    Perform Structured Exception Handler (SEH) analysis. Default true.

  • :cpp_exception_analysis (true, false)

    Perform C++ exception handler analysis. Default true.

  • :process_imports (true, false)

    Process any imports. Default true.

  • :process_exports (true, false)

    Process any exports. Default true.

  • :function_analysis (true, false)

    Process function analysis. Default true.

  • :function_local_analysis (true, false)

    Process function local variable analysis. Default true.

  • :datatype_from_mangled_name (true, false)

    Try to generate a data type from a mangled symbol name. Default true.

  • :arch (Symbol)

    For flat models, the architecture to use, e.g. :x86, :x64, :arm or :arm64

  • :arch_mode (Symbol)

    For flat models, the architecture's mode to use. If :arch is :arm, :arch_mode may be :auto, :arm or :thumb.

  • :system_mode (Symbol)

    The system mode to use. Either :user or :kernel.

  • :base_address (Integer)

    For flat models, the base address to use.

  • :entrypoint_rva (Integer)

    For flat models, the entry point to use.

  • :plugins (Array<String>)

    An array of plugin GUID's to use during analysis.

  • :plugin_commandline (String)

    The command line to pass to the plugins.

Returns:



662
663
664
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 662

def analyze_buffer( buffer, options={} )
    return nil
end

#analyze_buffer_dialog(buffer, pseudo_file_path = 'file.bin') ⇒ Relyze::FileModel? Also known as: analyse_buffer_dialog

Display the analyze file dialog and returns the model if analysis is successful. The analyzed buffer will be displayed in the GUI.

Examples:

data  = "\x00\x90\x90\x90\xcc\xcc\xcc\x90hello world"
model = @relyze.analyze_buffer_dialog( data, "foo.bin" )
if( not model.nil? )
    print_message( "0x%X" % model.entry_point )
end

Parameters:

  • buffer (String)

    The byte buffer of the data to analyze.

  • pseudo_file_path (String) (defaults to: 'file.bin')

    A pseudo file name to associate with this buffer.

Returns:



569
570
571
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 569

def analyze_buffer_dialog( buffer, pseudo_file_path='file.bin' )
    return nil
end

#analyze_file(file_path, options = {}) ⇒ Relyze::FileModel? Also known as: analyse_file

Analyze a file and return the resulting model. No dialogs are displayed and the model is not displayed in the GUI.

Examples:

Analyze a file and add several plugins into the pipeline.

analyze_options = {
   :plugins            => [],
   :plugin_commandline => "/strip=.rsrc;.reloc"
}

analyze_options[:plugins] << @relyze.get_plugin_guid( 'PE Import Hash' )
analyze_options[:plugins] << @relyze.get_plugin_guid( 'Segment Strip' )

model = @relyze.analyze_file(
    "C:\\samples\\foo.dll",
    analyze_options
)

@relyze.library.save(
    model,
    {
        :tags        => [ 'samples', 'foo' ],
        :description => 'This is an example'
    }
)

Parameters:

  • file_path (String)

    The file to analyze.

  • options (Hash) (defaults to: {})

    The options to analyze the file with.

Options Hash (options):

  • :analyze_code (true, false)

    Whether to analyze code or just structure. Default true.

  • :multi_threaded_analysis (true, false)

    Multi thread the analysis for improved performance. Default true.

  • :static_library_analysis (true, false)

    Perform static library analysis. Default true.

  • :static_library_analysis_ignore (true, false)

    Don't perform static library analysis if we already loaded embedded symbols. Default true.

  • :jump_table_analysis (true, false)

    Perform jump table analysis. Default true.

  • :indirect_call_analysis (true, false)

    Perform indirect call analysis. Default true.

  • :propagate_function_datatypes (true, false)

    Propagate function data types. Default true.

  • :embedded_symbols (true, false)

    Load symbols if available. Default true.

  • :embedded_symbols_load_lines (true, false)

    Load symbol lines if available. Default false.

  • :precompiled_header_symbols (true, false)

    Load types from the pre compiled header symbols. Default true.

  • :seh_analysis (true, false)

    Perform Structured Exception Handler (SEH) analysis. Default true.

  • :cpp_exception_analysis (true, false)

    Perform C++ exception handler analysis. Default true.

  • :process_imports (true, false)

    Process any imports. Default true.

  • :process_exports (true, false)

    Process any exports. Default true.

  • :function_analysis (true, false)

    Process function analysis. Default true.

  • :function_local_analysis (true, false)

    Process function local variable analysis. Default true.

  • :datatype_from_mangled_name (true, false)

    Try to generate a data type from a mangled symbol name. Default true.

  • :arch (Symbol)

    For flat models, the architecture to use, e.g. :x86, :x64, :arm or :arm64

  • :arch_mode (Symbol)

    For flat models, the architecture's mode to use. If :arch is :arm, :arch_mode may be :auto, :arm or :thumb.

  • :system_mode (Symbol)

    The system mode to use. Either :user or :kernel.

  • :base_address (Integer)

    For flat models, the base address to use.

  • :entrypoint_rva (Integer)

    For flat models, the entry point to use.

  • :plugins (Array<String>)

    An array of plugin GUID's to use during analysis.

  • :plugin_commandline (String)

    The command line to pass to the plugins.

Returns:



626
627
628
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 626

def analyze_file( file_path, options={} )
    return nil
end

#analyze_file_dialog(file_path) ⇒ Relyze::FileModel? Also known as: analyse_file_dialog

Display the analyze file dialog and returns the model if analysis is successful. The analyzed file will be displayed in the GUI.

Examples:

model = @relyze.analyze_file_dialog( "C:\\samples\\foo.dll" )
if( not model.nil? )
    print_message( "0x%X" % model.entry_point )
end

Parameters:

  • file_path (String)

    The path to the file to analyze.

Returns:



550
551
552
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 550

def analyze_file_dialog( file_path )
    return nil
end

#analyze_peek_buffer(buffer) ⇒ Hash? Also known as: analyse_peek_buffer

Determine the type of model the analysis would generate without performing analysis on the buffer.

Examples:

data  = "\x00\x90\x90\x90\xcc\xcc\xcc\x90hello world"
info = @relyze.analyze_peek_buffer( data )
print_message( info ) 
# info contains this data... 
{:type=>:flat}

Parameters:

  • buffer (String)

    The buffer to peek at.

Returns:

  • (Hash, nil)

    A hash of info, including :type, :bits, :arch and :endian



695
696
697
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 695

def analyze_peek_buffer( buffer )
    return nil
end

#analyze_peek_file(file_path) ⇒ Hash? Also known as: analyse_peek_file

Determine the type of model the analysis would generate without performing analysis on the file.

Examples:

info = @relyze.analyze_peek_file( "c:\\samples\\foo.dll" )
print_message( info ) 
# info contains this data... 
{ :type=>:pe, :bits=>32, :arch=>:x86, :endian=>:little }

Parameters:

  • file_path (String)

    The file path to peek at.

Returns:

  • (Hash, nil)

    A hash of info, including :type, :bits, :arch and :endian



678
679
680
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 678

def analyze_peek_file( file_path )
    return nil
end

#archsArray<Symbol>

Get all supported architectures.

Returns:

  • (Array<Symbol>)

    returns an array of all supported architectures, eg. [ :arm, :arm64, :x86, :x64 ]



840
841
842
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 840

def archs
    return nil
end

#color_dialogInteger?

Displays a color dialog.

Returns:

  • (Integer, nil)

    the color selected or nil if user cancelled the dialog.



493
494
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 493

def color_dialog
end

#console_print(plugin, type, message) ⇒ Object

Prints a message to the console. A plugin should use print_message, print_error, print_warning or print_exception instead.



445
446
447
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 445

def console_print( plugin, type, message )
    return false
end

#diff_text(text1, text2, level = :word) {|package| ... } ⇒ Array<Hash>

A helper to diff two strings.

Examples:

@relyze.diff_text( "hello world", "hello foo world", :word ) do | result |
    print_message( "operation=#{result[:operation]}, text='#{result[:text]}'" )
end

Parameters:

  • text1 (String)
  • text2 (String)
  • level (Symbol, nil) (defaults to: :word)

    The diff level to perform, either :char, :word or :line.

  • result (Hash)

    a customizable set of options

Yields:

  • (package)

    yields a diff result.

Yield Parameters:

  • result (Hash)

    A diff result hash containing an :operation key and a :text key.

Returns:

  • (Array<Hash>)

    returns an array of diff results.



833
834
835
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 833

def diff_text( text1, text2, level=:word )
    return nil
end

#file_dialog(options = { :file => nil, :title => 'Open...', :button => 'Open', :display => 'All Files', :mask => '*.*' }) ⇒ String?

Display a file dialog to the user.

Parameters:

  • options (Hash) (defaults to: { :file => nil, :title => 'Open...', :button => 'Open', :display => 'All Files', :mask => '*.*' })

    The options for the file dialog

Options Hash (options):

  • :file (String, nil)

    The initial file path to use or nil for none.

  • :title (String)

    The dialogs title.

  • :button (String)

    The title of the button to select the file.

  • :display (String)

    The name of the file mask to use, e.g. “EXE Files”

  • :mask (String)

    The file mask to use, e.g. “*.exe”

Returns:

  • (String, nil)

    return the chosen file path or nil if none.



529
530
531
532
533
534
535
536
537
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 529

def file_dialog( options={ 
        :file    => nil,
        :title   => 'Open...',
        :button  => 'Open',
        :display => 'All Files',
        :mask    => '*.*'
    } )
    return nil
end

#get_persistent_value(plugin, name) ⇒ Object

See get_persistent_value instead.



398
399
400
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 398

def get_persistent_value( plugin, name )
    return nil
end

#get_plugin_guid(name) ⇒ String

Get the GUID of a plugin based on the plugin name.

Parameters:

  • name (String)

    The plugin name.

Returns:

  • (String)

    The GUID for the plugin.



390
391
392
393
394
395
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 390

def get_plugin_guid( name )
    result = @plugins.find do | guid, hash |
        hash[:name] == name
    end
    return (result.nil? ? nil : result[0])
end

#get_plugin_thread(thread) ⇒ Object

A helper method to manage a plugins threads. Not to be called directly.



288
289
290
291
292
293
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 288

def get_plugin_thread( thread )
    @threads_mutex.synchronize do
        return @threads[thread]
    end
    return nil
end

#graph_dialog(graph) ⇒ true, false

Display a Graph::Graph object in a new dialog.

Examples:

func = cm.function( @relyze.tab_current_function_rva )
graph = func.to_graph
graph.layout
@relyze.graph_dialog( graph )

Parameters:

Returns:

  • (true, false)


506
507
508
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 506

def graph_dialog( graph )
    return false
end

#gui?true, false

Determine if the application is currently running in GUI mode.

Returns:

  • (true, false)

    true if the application is running in GUI mode or false if not.



417
418
419
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 417

def gui?
    return false
end

#has_plugin_threads?Boolean

A helper method to manage a plugins threads. Not to be called directly.

Returns:

  • (Boolean)


303
304
305
306
307
308
309
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 303

def has_plugin_threads?
    result = nil
    @threads_mutex.synchronize do
        result = !@threads.empty?
    end
    return result
end

#input_dialog(title, message, value = '') ⇒ Object

Display an dialog box to the user and return the value entered.

Parameters:

  • title (String)

    A title to display on the dialog box.

  • message (String)

    A message to display on the dialog box.

  • value (Object) (defaults to: '')

    An initial value to display on the dialog box.

Returns:

  • (Object)

    Returns the value the user enters into the dialog box.



455
456
457
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 455

def input_dialog( title, message, value='' )
    return false
end

#kill_plugin_threadsObject

A helper method to manage a plugins threads. Not to be called directly.



322
323
324
325
326
327
328
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 322

def kill_plugin_threads    
    @threads_mutex.synchronize do
        @threads.each do | thread, plugin |
            thread.kill if thread
        end
    end
end

#list_dialog(title, message, values) ⇒ Object

Display an dialog box to the user containing several values and return the value the user selects.

Parameters:

  • title (String)

    A title to display on the dialog box.

  • message (String)

    A message to display on the dialog box.

  • values (Array<Object>)

    An array of values for the user to choose from.

Returns:

  • (Object)

    Returns the value the user selects in the dialog box.



465
466
467
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 465

def list_dialog( title, message, values )
    return false
end

#load_all_plugins(plugin_path) ⇒ Object

A helper method to manage plugins. Not to be called directly.



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 331

def load_all_plugins( plugin_path )
    return false if not ::Dir.exists?( plugin_path )
    ::Dir.foreach( plugin_path ) do | file |
        if( file == '.' or file == '..' )
            next
        end
        file = ::File.join( plugin_path, file )
        if( ::File.directory?( file ) )
            self.load_all_plugins( file )
        elsif( File.extname( file ) == '.rb' )
            begin
                self.load_plugin_file( file )
            rescue ::Exception => e
                console_print( nil, :error, "Failed to add plugin '%s'" % file )
                console_print( nil, :error, "\t%s" % e.message )
                console_print( nil, :error, "\r\n\r\n\t\t%s" % e.backtrace.join( "\r\n\t\t" ) )
            end
        end
    end
    return true
end

#load_plugin_file(plugin_file) ⇒ Object

A helper method to manage plugins. Not to be called directly.



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 354

def load_plugin_file( plugin_file )
    ::File.open( plugin_file, 'rb' ) do | f |
    
        plugin_source = f.read( f.stat.size )
        
        raise "Unable to load empty plugin." if plugin_source.empty?
        
        mod = ::Module.new

        mod.module_eval( plugin_source, plugin_file )
        
        plugin = mod.const_get( :Plugin )

        raise "Unable to locate Plugin class." if plugin.class != ::Class

        p = plugin.new
        
        if( self.add_plugin( p, plugin_file ) )
            @plugins[p.guid] = { 
                :file_path   => plugin_file,
                :name        => p.name, 
                :description => p.description, 
                :authors     => p.authors, 
                :license     => p.license, 
                :type        => p.type, 
                :version     => p.version
            }
        end
        
    end
end

#message_dialog(title, message, buttons = [ :ok, :cancel ], icon = :info) ⇒ Symbol

Display an dialog box to the user with customisable buttons.

Examples:

result = @relyze.message_dialog(
    'Confirm?',
    'Do you want to continue?',
    [ 'Do It', :stop, 1234 ],
    :question
)
if( result == 'Do It' )
    # ...
end

Parameters:

  • title (String)

    A title to display on the dialog box.

  • message (String)

    A message to display on the dialog box.

  • buttons (Array) (defaults to: [ :ok, :cancel ])

    An array of values for each button to display.

  • icon (Symbol) (defaults to: :info)

    The icon to use. Can be :none, :info, :error, :warning or :question

Returns:

  • (Symbol)

    Returns the button value that was clicked.



486
487
488
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 486

def message_dialog( title, message, buttons=[ :ok, :cancel ], icon=:info )
    return :cancel
end

#refresh_static_library_packagestrue, false

Force the packages to be refreshed from all symbol origin locations.

Returns:

  • (true, false)


796
797
798
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 796

def refresh_static_library_packages
    return false
end

#remove_plugin_thread(thread) ⇒ Object

A helper method to manage a plugins threads. Not to be called directly.



296
297
298
299
300
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 296

def remove_plugin_thread( thread )
    @threads_mutex.synchronize do
        @threads.delete( thread )
    end
end

#rgb(red, green, blue) ⇒ Integer

Converts RGB values into a color value.

Parameters:

  • red (Integer)

    The red value to user between 0 and 255.

  • green (Integer)

    The green value to user between 0 and 255.

  • blue (Integer)

    The blue value to user between 0 and 255.

Returns:



516
517
518
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 516

def rgb( red, green, blue )
    return ( ((blue & 0xFF) << 16) | ((green & 0xFF) << 8) | (red & 0xFF) )
end

#set_persistent_value(plugin, name, value) ⇒ Object

See set_persistent_value instead.



403
404
405
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 403

def set_persistent_value( plugin, name, value )
    return false
end

#static_library_packages {|package| ... } ⇒ Array<Relyze::Symbols::StaticLibraryPackage>

Gets every StaticLibraryPackage available.

Examples:

List all the available packages.

total = 0
@relyze.static_library_packages do | package |
    next if package.type == :shared
    print_message( "%s has %d signatures." % [ package.to_s, package.count ] )
    total += package.count
end
print_message( "All packages have a combined total of %d signatures." % total )

Yields:

  • (package)

    yields a static library package.

Yield Parameters:

Returns:



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

def static_library_packages
    return []
end

#tab_current_diff(model = self.active_tab) ⇒ Relyze::DiffResults::DiffModelResult?

For the tab associated with the given model, returns the current differential analysis result, if any, for every item.

Parameters:

  • model (Relyze::FileModel) (defaults to: self.active_tab)

    The model being displayed in a tab.

Returns:



755
756
757
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 755

def tab_current_diff( model=self.active_tab )
    return nil
end

#tab_current_diff_item(model = self.active_tab) ⇒ Relyze::DiffResults::DiffBaseResult?

For the tab associated with the given model, returns the current differential analysis result, containing only the currently displayed item, if any.

Parameters:

  • model (Relyze::FileModel) (defaults to: self.active_tab)

    The model being displayed in a tab.

Returns:



764
765
766
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 764

def tab_current_diff_item( model=self.active_tab )
    return nil
end

#tab_current_function_rva(model = self.active_tab) ⇒ Integer?

For the tab associated with the given model, returns the RVA of the function for the users currently selected RVA value.

Parameters:

  • model (Relyze::FileModel) (defaults to: self.active_tab)

    The model being displayed in a tab.

Returns:

  • (Integer, nil)

    The RVA of the current function, or nil if none.



747
748
749
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 747

def tab_current_function_rva( model=self.active_tab )
    return nil
end

#tab_current_model(model = self.active_tab) ⇒ Relyze::FileModel?

For the tab associated with the given model, returns the active model in that tab. Typically the return value is the same as the first parameter. This may not be the case if the user has selected the second analysis in the diff view.

Parameters:

  • model (Relyze::FileModel) (defaults to: self.active_tab)

    The model being displayed in a tab.

Returns:



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

def tab_current_model( model=self.active_tab )
    return nil
end

#tab_current_rva(model = self.active_tab) ⇒ Integer?

For the tab associated with the given model, returns the users currently selected RVA value.

Parameters:

  • model (Relyze::FileModel) (defaults to: self.active_tab)

    The model being displayed in a tab.

Returns:

  • (Integer, nil)

    The users currently selected RVA value, or nil if none.



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

def tab_current_rva( model=self.active_tab )
    return nil
end

#tab_display_graph(graph, model = self.active_tab) ⇒ true, false

Display a Graph::Graph object in the GUI.

Examples:

func = cm.function( @relyze.tab_current_function_rva )
graph = func.to_graph
graph.layout
@relyze.tab_display_graph( graph )

Parameters:

Returns:

  • (true, false)


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

def tab_display_graph( graph, model=self.active_tab )
    return false
end

#tab_goto_rva(model, rva, function_rva = nil) ⇒ true, false

For the tab associated with the given model, go to a given rva location.

Parameters:

  • model (Relyze::FileModel)

    The model being displayed in a tab.

  • rva (Integer)

    The RVA to go to.

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

    An optional function RVA to explicitly specify a function context.

Returns:

  • (true, false)


789
790
791
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 789

def tab_goto_rva( model, rva, function_rva=nil )
    return false
end

#tabs {|model| ... } ⇒ Array<Relyze::FileModel>

Gets the model for each tab in the GUI

Examples:

@relyze.tabs do | model |
    if( model.arch == :x64 )
        print_message( model )
    end
end

Yields:

  • (model)

    yields the model corresponding to each tab in the GUI.

Yield Parameters:

Returns:



713
714
715
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 713

def tabs
    return []
end

#update_guiObject

Force the application GUI to update. This is useful if your plugin has made changes that you wish to see immediately.



423
424
425
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 423

def update_gui
    return false
end

#versionString

Get the current application version in the format of major.minor.patch

Returns:

  • (String)

    The applications version string.



410
411
412
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 410

def version
    return '0.0.0'
end

#version_majorInteger

Returns The application major number.

Returns:

  • (Integer)

    The application major number.



428
429
430
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 428

def version_major
    return /(\d{1,}).(\d{1,}).(\d{1,})/.match( self.version )[1].to_i
end

#version_minorInteger

Returns The application minor number.

Returns:

  • (Integer)

    The application minor number.



433
434
435
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 433

def version_minor
    return /(\d{1,}).(\d{1,}).(\d{1,})/.match( self.version )[2].to_i
end

#version_patchInteger

Returns The application patch number.

Returns:

  • (Integer)

    The application patch number.



438
439
440
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 438

def version_patch
    return /(\d{1,}).(\d{1,}).(\d{1,})/.match( self.version )[3].to_i
end

#wait_plugin_threadsObject

A helper method to manage a plugins threads. Not to be called directly.



312
313
314
315
316
317
318
319
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 312

def wait_plugin_threads    
    @threads_mutex.synchronize do
        @threads.each do | thread, plugin |
            thread.join if thread
        end
        @threads.clear
    end
end
class='kw'>end end