Class: Rex::Zip::CompFlags
- Inherits:
-
Object
- Object
- Rex::Zip::CompFlags
- Defined in:
- lib/rex/zip/blocks.rb
Overview
This structure holds the following data pertaining to a Zip entry.
general purpose bit flag compression method modification time modification date
Instance Attribute Summary collapse
-
#compmeth ⇒ Object
Returns the value of attribute compmeth.
Instance Method Summary collapse
-
#initialize(gpbf, compmeth, timestamp) ⇒ CompFlags
constructor
A new instance of CompFlags.
- #pack ⇒ Object
Constructor Details
#initialize(gpbf, compmeth, timestamp) ⇒ CompFlags
Returns a new instance of CompFlags.
39 40 41 42 43 44 |
# File 'lib/rex/zip/blocks.rb', line 39 def initialize(gpbf, compmeth, ) @gpbf = gpbf @compmeth = compmeth @mod_time = ((.hour << 11) | (.min << 5) | (.sec)) @mod_date = (((.year - 1980) << 9) | (.mon << 5) | (.day)) end |
Instance Attribute Details
#compmeth ⇒ Object
Returns the value of attribute compmeth.
37 38 39 |
# File 'lib/rex/zip/blocks.rb', line 37 def compmeth @compmeth end |
Instance Method Details
#pack ⇒ Object
46 47 48 |
# File 'lib/rex/zip/blocks.rb', line 46 def pack [ @gpbf, @compmeth, @mod_time, @mod_date ].pack('vvvv') end |