Skip to content

Commit 46e6f93

Browse files
committed
Revert "Add central directory zip spoofing"
This reverts commit d0700e8.
1 parent d0700e8 commit 46e6f93

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

lib/rex/zip/archive.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,11 @@ def save_to(fname)
8080
f.close
8181
end
8282

83+
84+
#
8385
# Compress this archive and return the resulting zip file as a String.
8486
#
85-
# @param spoof [Hash{String => String}] The entries whose name need to be spoofed in the Central
86-
# Directory.
87-
# @return [String] The resulting zip file
88-
def pack(spoof={})
87+
def pack
8988
ret = ''
9089

9190
# save the offests
@@ -105,7 +104,7 @@ def pack(spoof={})
105104
idx = 0
106105
@entries.each { |ent|
107106
cfd = CentralDir.new(ent, offsets[idx])
108-
ret << cfd.pack(spoof)
107+
ret << cfd.pack
109108
idx += 1
110109
}
111110

lib/rex/zip/blocks.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,8 @@ def initialize(entry, offset)
115115
@hdr_offset = offset
116116
end
117117

118-
# Creates the central directory information about the particular Zip Entry.
119-
#
120-
# @param spoof [Hash{String => String}] The entries whose name need to be spoofed in the Central
121-
# Directory.
122-
# @return [String] The resulting zip file
123-
def pack(spoof={})
118+
def pack
124119
path = @entry.relative_path
125-
if spoof.key?(path)
126-
path = spoof[path]
127-
end
128120

129121
ret = [ SIGNATURE, ZIP_VERSION ].pack('Vv')
130122
ret << [ ZIP_VERSION ].pack('v')

0 commit comments

Comments
 (0)