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.



86
87
88
# File 'lib/rex/zip/blocks.rb', line 86

def initialize(entry)
	@entry = entry
end

Instance Method Details

#packObject



90
91
92
93
94
95
96
97
98
99
100
# File 'lib/rex/zip/blocks.rb', line 90

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