Class: Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::DLLFunction

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb

Overview

represents one function, e.g. MessageBoxW

Defined Under Namespace

Classes: UnitTest

Constant Summary collapse

@@allowed_datatypes =
{
	"VOID"   => ["return"],
	"BOOL"   => ["in", "return"],
	"DWORD"  => ["in", "return"],
	"WORD"   => ["in", "return"],
	"BYTE"   => ["in", "return"],
	"LPVOID" => ["in", "return"], # sf: for specifying a memory address (e.g. VirtualAlloc/HeapAlloc/...) where we dont want ot back it up with actuall mem ala PBLOB
	"HANDLE" => ["in", "return"],
	"PDWORD" => ["in", "out", "inout"], # todo: support for functions that return pointers to strings
	"PWCHAR" => ["in", "out", "inout"],
	"PCHAR"  => ["in", "out", "inout"],
	"PBLOB"  => ["in", "out", "inout"],
}.freeze
@@directions =
["in", "out", "inout", "return"].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(return_type, params, windows_name) ⇒ DLLFunction

Returns a new instance of DLLFunction.



55
56
57
58
59
60
61
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb', line 55

def initialize(return_type, params, windows_name)
	check_return_type(return_type) # we do error checking as early as possible so the library is easier to use
	check_params(params)
	@return_type = return_type
	@params = params
	@windows_name = windows_name
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



53
54
55
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb', line 53

def params
  @params
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



53
54
55
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb', line 53

def return_type
  @return_type
end

#windows_nameObject (readonly)

Returns the value of attribute windows_name.



53
54
55
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb', line 53

def windows_name
  @windows_name
end