Class: Rex::Zip::LocalFileHdr

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/zip/blocks.rb

Overview

This structure records the compression data and flags about a Zip entry to a file.

Constant Summary collapse

SIGNATURE =
0x4034b50

Instance Method Summary collapse

Constructor Details

#initialize(entry) ⇒ LocalFileHdr

Returns a new instance of LocalFileHdr.



83
84
85
# File 'lib/rex/zip/blocks.rb', line 83

def initialize(entry)
  @entry = entry
end

Instance Method Details

#packObject



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/rex/zip/blocks.rb', line 87

def pack
  path = @entry.relative_path

  ret = [ SIGNATURE, ZIP_VERSION ].pack('Vv')
  ret << @entry.flags.pack
  ret << @entry.info.pack
  ret << [ path.length, @entry.xtra.length ].pack('vv')
  ret << path
  ret << @entry.xtra
  ret
end