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.



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

def initialize(entry)
	@entry = entry
end

Instance Method Details

#packObject



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

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