From f7a9518944c7e65eab8089fc9dc56858f5fdde58 Mon Sep 17 00:00:00 2001 From: chao-mu Date: Sun, 8 Jan 2012 17:18:34 -0500 Subject: [PATCH] In railgun mixin, "error_lookup" has been renamed "lookup_error" and now accepts a filtering regular expression. ::BUILTIN_DLLS instead of .builtin_dlls --- lib/msf/core/post/windows/railgun.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/msf/core/post/windows/railgun.rb b/lib/msf/core/post/windows/railgun.rb index 5a54ddda73..43ceaa8ad1 100644 --- a/lib/msf/core/post/windows/railgun.rb +++ b/lib/msf/core/post/windows/railgun.rb @@ -6,7 +6,7 @@ module Windows module Railgun # Go through each dll and add a corresponding convenience method of the same name - Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::Railgun.builtin_dlls.each do |api| + Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::Railgun::BUILTIN_DLLS.each do |api| # We will be interpolating within an eval. We exercise due paranoia. unless api.to_s =~ /^\w+$/ print_error 'Something is seriously wrong with Railgun.BUILTIN_DLLS list' @@ -27,14 +27,16 @@ module Railgun # Return an array of windows constants names matching +winconst+ # def select_const_names(winconst, filter_regex=nil) - return railgun.constant_manager.select_const_names(winconst, filter_regex) + railgun.constant_manager.select_const_names(winconst, filter_regex) end # # Returns an array of windows error code names for a given windows error code matching +err_code+ # - def error_lookup (err_code) - return select_const_names(err_code, /^ERROR_/) + def lookup_error (err_code, filter_regex=nil) + select_const_names(err_code, /^ERROR_/).select do |name| + name =~ filter_regex + end end def memread(address, length)