Represents a DLL, e.g. kernel32.dll
Define a function for this DLL.
Every function argument is described by a tuple (type,name,direction)
Example:
add_function("MessageBoxW", # name "DWORD", # return value [ # params ["DWORD","hWnd","in"], ["PWCHAR","lpText","in"], ["PWCHAR","lpCaption","in"], ["DWORD","uType","in"], ])
Use windows_name when the actual windows name is different from the ruby variable. You might need to do this for example when the actual func name is myFunc@4 or when you want to create an alternative version of an existing function.
When the new function is called it will return a list containing the return value and all inout params. See call_function.
# File lib/rex/post/meterpreter/extensions/stdapi/railgun/dll.rb, line 109 def add_function(name, return_type, params, windows_name=nil) if windows_name == nil windows_name = name end @functions[name] = DLLFunction.new(return_type, params, windows_name) end
Perform a function call in this DLL on the remote system.
Returns a Hash containing the return value, the result of GetLastError(), and any inout parameters.
Raises an exception if func_symbol is not a known function in this DLL, i.e., it hasn't been defined in a Def.
# File lib/rex/post/meterpreter/extensions/stdapi/railgun/dll.rb, line 74 def call_function(func_symbol, args, client) func_name = func_symbol.to_s unless known_function_names.include? func_name raise "DLL-function #{func_name} not found. Known functions: #{PP.pp(known_function_names, '')}" end function = get_function(func_name) return process_function_call(function, args, client) end
Generated with the Darkfish Rdoc Generator 2.