Fix missing dll_data var in parse_pe

Also clean up YARD.
This commit is contained in:
William Vu 2017-03-27 01:17:23 -05:00
parent 11b251b928
commit d47e59b04e
1 changed files with 11 additions and 7 deletions

View File

@ -13,7 +13,7 @@ module Msf::ReflectiveDLLLoader
# Load a reflectively-injectable DLL from disk and find the offset
# to the ReflectiveLoader function inside the DLL.
#
# @param dll_path Path to the DLL to load.
# @param [String] dll_path Path to the DLL to load.
#
# @return [Array] Tuple of DLL contents and offset to the
# +ReflectiveLoader+ function within the DLL.
@ -23,18 +23,26 @@ module Msf::ReflectiveDLLLoader
offset = parse_pe(dll)
unless offset
raise "Cannot find the ReflectiveLoader entry point in #{dll_path}"
end
return dll, offset
end
# Load a reflectively-injectable DLL from an string and find the offset
# Load a reflectively-injectable DLL from a string and find the offset
# to the ReflectiveLoader function inside the DLL.
#
# @param [Integer] dll_data the DLL to load.
# @param [String] dll_data the DLL data to load.
#
# @return [Integer] offset to the +ReflectiveLoader+ function within the DLL.
def load_rdi_dll_from_data(dll_data)
offset = parse_pe(dll_data)
unless offset
raise 'Cannot find the ReflectiveLoader entry point in DLL data'
end
offset
end
@ -51,10 +59,6 @@ module Msf::ReflectiveDLLLoader
end
end
unless offset
raise "Cannot find the ReflectiveLoader entry point in #{dll_path}"
end
offset
end
end