Class: Ronin::Support::Binary::CTypes::OS::Windows

Inherits:
Ronin::Support::Binary::CTypes::OS show all
Defined in:
lib/ronin/support/binary/ctypes/os/windows.rb

Overview

Contains additional types available on Windows.

Since:

  • 1.0.0

Instance Attribute Summary

Attributes inherited from Ronin::Support::Binary::CTypes::OS

#typedefs, #types

Instance Method Summary collapse

Methods inherited from Ronin::Support::Binary::CTypes::OS

#[], #typedef

Constructor Details

#initialize(types) ⇒ Windows

Initializes the Windows types object.

Parameters:

  • types (#[])

    The base types module.

Since:

  • 1.0.0



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/ronin/support/binary/ctypes/os/windows.rb', line 41

def initialize(types)
  super(types)

  if types::ADDRESS_SIZE == 8
    # NOTE: `long` and `unsigne long` are actually 4 bytes on
    # 64bit Windows systems.
    #
    # https://www.intel.com/content/www/us/en/developer/articles/technical/size-of-long-integer-type-on-different-architecture-and-os.html
    typedef types::INT32, :long
    typedef types::UINT32, :ulong
  end

  typedef :uint, :_dev_t
  typedef :uint, :dev_t
  typedef :int, :errno_t
  typedef :ushort, :_ino_t
  typedef :ushort, :ino_t
  typedef :short, :int16_t
  typedef :int, :int32_t
  typedef :long_long, :int64_t
  typedef :char, :int8_t
  typedef :short, :int_fast16_t
  typedef :int, :int_fast32_t
  typedef :long_long, :int_fast64_t
  typedef :char, :int_fast8_t
  typedef :short, :int_least16_t
  typedef :int, :int_least32_t
  typedef :long_long, :int_least64_t
  typedef :char, :int_least8_t
  typedef :long_long, :intmax_t
  typedef :ushort, :_mode_t
  typedef :ushort, :mode_t
  typedef :long, :off32_t
  typedef :long_long, :_off64_t
  typedef :long_long, :off64_t
  typedef :long, :_off_t
  typedef :long_long, :off_t
  typedef :long, :__time32_t
  typedef :long_long, :__time64_t
  typedef :ushort, :uint16_t
  typedef :ulong_long, :uint64_t
  typedef :uchar, :uint8_t
  typedef :ushort, :uint_fast16_t
  typedef :uint, :uint_fast32_t
  typedef :ulong_long, :uint_fast64_t
  typedef :uchar, :uint_fast8_t
  typedef :ushort, :uint_least16_t
  typedef :ulong_long, :uint_least64_t
  typedef :uchar, :uint_least8_t
  typedef :ulong_long, :uintmax_t
  typedef :uint, :useconds_t
  typedef :ushort, :wchar_t
  typedef :ushort, :wctype_t
  typedef :ushort, :wint_t

  if types::ADDRESS_SIZE == 8
    typedef :long_long, :intptr_t
    typedef :long_long, :_pid_t
    typedef :long_long, :pid_t
    typedef :long_long, :ptrdiff_t
    typedef :ulong_long, :rsize_t
    typedef :ulong_long, :_sigset_t
    typedef :ulong_long, :size_t
    typedef :long_long, :ssize_t
    typedef :long_long, :time_t
    typedef :ulong_long, :uintptr_t
  else
    typedef :int, :intptr_t
    typedef :int, :_pid_t
    typedef :int, :pid_t
    typedef :int, :ptrdiff_t
    typedef :uint, :rsize_t
    typedef :ulong, :_sigset_t
    typedef :uint, :size_t
    typedef :int, :ssize_t
    typedef :long, :time_t
    typedef :uint, :uintptr_t
  end
end