module Ronin::Support::Binary::CTypes::Native

Represents the system’s native C types.

Constants

ADDRESS_SIZE

The size of a native pointer in bytes.

@return [4, 8]

BYTE

The ‘byte` type.

DOUBLE

The ‘double` type (native-endianness).

DWORD

The “dword” type (32-bit unsigned integer).

ENDIAN

The native endian-ness.

FLOAT

The ‘float` type (native-endianness).

FLOAT32

The ‘float` type (native-endianness).

FLOAT64

The ‘double` type (native-endianness).

INT

The ‘int` type.

INT16

The ‘int16_t` type (native-endianness).

INT32

The ‘int32_t` type (native-endianness).

INT64

The ‘int64_t` type (native-endianness).

INT8

The ‘int8_t` type.

LONG

The ‘long` type.

LONG_LONG

The ‘long long` type.

MACHINE_WORD

The “machine word” type.

@return [UINT64, UINT32]

{UINT64} on 64-bit systems and {UINT32} on 32-bit systems.
POINTER

The ‘void *` type.

QWORD

The “qword” type (64-bit unsigned integer).

SHORT

The ‘short` type.

TYPES

The native types.

UINT

The ‘unsigned int` type.

UINT16

The ‘uint16_t` type (native-endianness).

UINT32

The ‘uint32_t` type (native-endianness).

UINT64

The ‘uint64_t` type (native-endianness).

UINT8

The ‘uint8_t` type.

ULONG

The ‘unsigned long` type.

ULONG_LONG

The ‘unsigned long long` type.

USHORT

The ‘unsigned short` type.

WORD

The “word” type (16-bit unsigned integer).

Public Class Methods

[](name) click to toggle source

Fetches the type from {TYPES}.

@param [Symbol] name

The type name to lookup.

@return [Type]

The type object from {TYPES}.

@raise [ArgumentError]

The type name was unknown.
# File lib/ronin/support/binary/ctypes/native.rb, line 199
def self.[](name)
  TYPES.fetch(name) do
    raise(ArgumentError,"unknown type: #{name.inspect}")
  end
end