Module: Ronin::Code::ASM::OS

Defined in:
lib/ronin/code/asm/os.rb,
lib/ronin/code/asm/os/os.rb,
lib/ronin/code/asm/os/linux.rb,
lib/ronin/code/asm/os/freebsd.rb

Defined Under Namespace

Modules: FreeBSD, Linux

Constant Summary collapse

NAMES =

The mapping of OS names to modules.

{
  linux:   Linux,
  freebsd: FreeBSD
}
SYSCALLS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Collection of all known syscalls, grouped by OS and Arch.

Returns:

  • (Hash{Symbol => Hash{Symbol => Hash{Symbol => Integer}}})

    Syscall names and numbers, organized by OS then Arch.

Hash.new do |hash,os|
  hash[os] = Hash.new do |subhash,arch|
    subhash[arch] = YAML.load_file(
      File.join(Config::DATA_DIR,'os',os.to_s.downcase,arch.to_s,'syscalls.yml')
    )
  end
end

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Linux, FreeBSD

Fetches the OS module with the given name.

Parameters:

  • name (Symbol)

    The OS name (ex: :linux).

Returns:

Raises:

  • (ArgumentError)

    The OS name was unknown.

Since:

  • 1.0.0



49
50
51
52
53
# File 'lib/ronin/code/asm/os.rb', line 49

def self.[](name)
  NAMES.fetch(name) do
    raise(ArgumentError,"unknown OS name: #{name.inspect}")
  end
end