Class: Relyze::Library::Archive

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Get or set this archives description.



25
26
27
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 25

def description
  @description
end

#nameObject

Get or set this archives name.



22
23
24
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 22

def name
  @name
end

#pathObject (readonly)

Get this archives file path.



28
29
30
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 28

def path
  @path
end

#savedObject (readonly)

Get the time stamp of when this archive was saved.



31
32
33
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 31

def saved
  @saved
end

Instance Method Details

#add_hash(name, value) ⇒ true, false

Add a hash name/value pair to this archive.

Parameters:

  • name (String)

    The hash name.

  • value (String)

    The hash value.

Returns:

  • (true, false)

    return true if the hash was added or false if it was not.



147
148
149
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 147

def add_hash( name, value )
    return false
end

#add_tag(name, color = nil) ⇒ true, false

Add a new tag to this archive.

Examples:

Adding a new tag

archive.add_tag( 'malware', @relyze.rgb( 140, 0, 0 ) )

Parameters:

  • name (String)

    The tag name

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

    The tag color.

Returns:

  • (true, false)


92
93
94
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 92

def add_tag( name, color=nil )
    return false
end

#begin_updatetrue, false

For performance you can wrap multiple updates to an Archive with begin_update and end_update.

Examples:

Updating an archive entries in the library


@relyze.library.archives do | archive |
    if( archive.tag?( 'PE' ) )
        archive.begin_update
        archive.description += " This is a PE file."
        archive.add_tag( 'Foo' )
        archive.end_update
    end
end

Returns:

  • (true, false)


48
49
50
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 48

def begin_update
    return false
end

#deletetrue, false

Delete this archive from the library as well as its archive file.

Returns:

  • (true, false)

    return true if the archive was deleted or false if it was not.



162
163
164
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 162

def delete
    return false
end

#encrypted?true, false

Returns true if this archive is encrypted or false if it is not.

Returns:

  • (true, false)

    returns true if this archive is encrypted or false if it is not.



62
63
64
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 62

def encrypted?
    return false
end

#end_updatetrue, false

Every call to begin_update must be met with a call to end_update in order for the modification to the archive to be written to the library.

Returns:

  • (true, false)


56
57
58
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 56

def end_update
    return false
end

#get_hash(name) ⇒ String

Given a hash name, return the corresponding value.

Parameters:

  • name (String)

    The hash name.

Returns:

  • (String)

    Return the hash value.



135
136
137
138
139
140
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 135

def get_hash( name )
    self.hashes do | hash_name, hash_value |
        return hash_value if name == hash_name
    end
    return nil
end

#hash?(name) ⇒ true, false

Determine if this archive contains a hash value for a specific hash name.

Examples:

if( archive.hash?( 'File SHA1' )
    print_message( "%s" % [ archive.name ] )
end

Parameters:

  • name (String)

    The hash name

Returns:

  • (true, false)

    return true if a hash value with this name exists or false if it does not.



124
125
126
127
128
129
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 124

def hash?( name )
    self.hashes do | hash_name, hash_value |
        return true if name == hash_name
    end
    return false
end

#hashes {|hash_name, hash_value| ... } ⇒ Array<Array<String>>

Get every hash name and value associated with this archive.

Examples:

List the SHA1 File hash for every archive in the library

@relyze.library.archives do | archive |
    archive.hashes do | hash_name, hash_value |
        if( hash_name == 'File SHA1' )
            print_message( "%s - %s" % [ archive.name, hash_value ] )
        end
    end
end

Yields:

  • (hash_name, hash_value)

    yields the hash name and value to the block.

Yield Parameters:

  • hash_name (String)

    The hash name.

  • hash_value (String)

    The hash value.

Returns:

  • (Array<Array<String>>)

    returns an array of hash name and value pairs, each pair is held in an array.



111
112
113
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 111

def hashes
    return nil
end

#remove_hash(name) ⇒ true, false

Remove a hash name/value pair from this archive.

Parameters:

  • name (String)

    The hash name.

Returns:

  • (true, false)

    return true if the hash was removed or false if it was not.



155
156
157
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 155

def remove_hash( name )
    return false
end

#tag?(name) ⇒ true, false

Check if this archive has this tag name set.

Parameters:

  • name (String)

    The tag name to check for.

Returns:

  • (true, false)

    return true if this archive contains this tag name, or false if it does not.



77
78
79
80
81
82
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 77

def tag?( name )
    self.tags do | tag_name |
        return true if name == tag_name
    end
    return false
end

#tagsArray<String>

Get a list of tags for this Relyze::Library::Archive

Returns:



69
70
71
# File 'C:/Program Files/Relyze/lib/relyze/core/application.rb', line 69

def tags
    return nil
end
="Yay! A Ruby Documentation Tool" target="_parent">yard 0.9.20 (ruby-2.6.5).