Class: Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::Def::Def_windows_version

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

Class Method Summary collapse

Class Method Details

.create_library(constant_manager, library_path = 'version') ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/def/windows/def_version.rb', line 12

def self.create_library(constant_manager, library_path = 'version')
  dll = Library.new(library_path, constant_manager)

  dll.add_function('GetFileVersionInfoA', 'BOOL',[
    ["PCHAR","lptstrFilename","in"],
    ["DWORD","dwHandle","in"],
    ["DWORD","dwLen","in"],
    # Ignore lpData out as we will pass in our
    # own memory address and use memread
    ["LPVOID","lpData","in"],
  ])

  dll.add_function('GetFileVersionInfoSizeA', 'DWORD',[
    ["PCHAR","lptstrFilename","in"],
    ["PDWORD","lpdwHandle","out"]
  ])

  dll.add_function('VerQueryValueA', 'BOOL',[
    ["LPVOID","pBlock","in"],
    ["PCHAR","lpSubBlock","in"],
    ["PULONG_PTR","lplpBuffer","out"],
    ["PDWORD","puLen","out"]
  ])

  return dll
end