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

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

Class Method Summary collapse

Class Method Details

.create_library(constant_manager, library_path = 'libobjc.dylib') ⇒ 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
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rex/post/meterpreter/extensions/stdapi/railgun/def/osx/def_libobjc.rb', line 12

def self.create_library(constant_manager, library_path = 'libobjc.dylib')
  lib = Library.new(library_path, constant_manager)

  # https://developer.apple.com/documentation/objectivec/1418952-objc_getclass?language=objc
  lib.add_function(
    'objc_getClass',
    'LPVOID',
    [
      ['PCHAR', 'name', 'in']
    ],
    nil,
    'cdecl'
  )

  # https://developer.apple.com/documentation/objectivec/1456712-objc_msgsend?language=objc
  lib.add_function(
    'objc_msgSend',
    'LPVOID',
    [
      ['LPVOID', 'self', 'in'],
      ['LPVOID', 'op', 'in']
    ],
    nil,
    'cdecl'
  )

  # https://developer.apple.com/documentation/objectivec/1418557-sel_registername?language=objc
  lib.add_function(
    'sel_registerName',
    'LPVOID',
    [
      ['PCHAR', 'str', 'in']
    ],
    nil,
    'cdecl'
  )

  return lib
end