Skip to content

Commit 985245e

Browse files
committed
Document method
Fix rapid7#4366 (support dynamic_base templates)
1 parent b8e58d0 commit 985245e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/msf/util/exe.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ def self.to_executable(framework, arch, plat, code = '', opts = {})
147147
nil
148148
end
149149

150+
# Clears the DYNAMIC_BASE flag for a Windows executable
151+
# @param exe [String] The raw executable to be modified by the method
152+
# @param pe [Rex::PeParsey::Pe] Use Rex::PeParsey::Pe.new_from_file
153+
# @return [String] the modified executable
150154
def self.clear_dynamic_base(exe, pe)
151155
c_bits = ("%32d" %pe.hdr.opt.DllCharacteristics.to_s(2)).split('').map { |e| e.to_i }.reverse
152156
c_bits[6] = 0 # DYNAMIC_BASE

0 commit comments

Comments
 (0)