Module: Ragweed

Included in:
Debugger32, Debuggerosx, Process
Defined in:
lib/ragweed/wraposx.rb,
lib/ragweed.rb,
lib/ragweed/rasm.rb,
lib/ragweed/wrap32.rb,
lib/ragweed/wraptux.rb,
lib/ragweed/rasm/isa.rb,
lib/ragweed/debuggerosx.rb,
lib/ragweed/debuggertux.rb,
lib/ragweed/rasm/bblock.rb,
lib/ragweed/wrap32/winx.rb,
lib/ragweed/wrap32/device.rb,
lib/ragweed/wrap32/wrap32.rb,
lib/ragweed/wraposx/structs.rb,
lib/ragweed/wraposx/wraposx.rb,
lib/ragweed/wraptux/threads.rb,
lib/ragweed/wraposx/constants.rb,
lib/ragweed/wraptux/constants.rb,
lib/ragweed/wraposx/region_info.rb,
lib/ragweed/wraposx/thread_info.rb,
lib/ragweed/wraposx/kernelerrorx.rb,
lib/ragweed/wraposx/thread_context.rb

Overview

127 ((x == x86_THREAD_STATE32) || \ 128 (x == x86_FLOAT_STATE32) || \ 129 (x == x86_EXCEPTION_STATE32) || \ 130 (x == x86_DEBUG_STATE32) || \ 131 (x == x86_THREAD_STATE64) || \ 132 (x == x86_FLOAT_STATE64) || \ 133 (x == x86_EXCEPTION_STATE64) || \ 134 (x == x86_DEBUG_STATE64) || \ 135 (x == x86_THREAD_STATE) || \ 136 (x == x86_FLOAT_STATE) || \ 137 (x == x86_EXCEPTION_STATE) || \ 138 (x == x86_DEBUG_STATE) || \

Defined Under Namespace

Modules: Blocks, FFIStructInclude, Rasm, Wrap32, Wraposx, Wraptux Classes: Arena, Debugger32, Debuggerosx, Debuggertux, Detour, Device, Event, Process, Ptr, Sbuf, Trampoline

Constant Summary collapse

VERSION =

:stopdoc:

File.read(File.join(File.dirname(__FILE__),"..","VERSION")).strip
LIBPATH =
::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR

Class Method Summary collapse

Class Method Details

.libpath(*args) ⇒ Object

Returns the library path for the module. If any arguments are given, they will be joined to the end of the libray path using File.join.



21
22
23
# File 'lib/ragweed.rb', line 21

def self.libpath( *args )
  args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
end

.path(*args) ⇒ Object

Returns the lpath for the module. If any arguments are given, they will be joined to the end of the path using File.join.



29
30
31
# File 'lib/ragweed.rb', line 29

def self.path( *args )
  args.empty? ? PATH : ::File.join(PATH, args.flatten)
end

.require_all_libs_relative_to(fname, dir = nil) ⇒ Object

Utility method used to require all files ending in .rb that lie in the directory below this file that has the same name as the filename passed in. Optionally, a specific directory name can be passed in such that the filename does not have to be equivalent to the directory.



38
39
40
41
42
43
44
45
# File 'lib/ragweed.rb', line 38

def self.require_all_libs_relative_to( fname, dir = nil )
  dir ||= ::File.basename(fname, '.*')
  search_me = ::File.expand_path(
      ::File.join(::File.dirname(fname), dir, '**', '*.rb'))
  # Don't want to load wrapper or debugger here.
  Dir.glob(search_me).sort.reject{|rb| rb =~ /(wrap|debugger|rasm[^\.])/}.each {|rb| require rb}
  # require File.dirname(File.basename(__FILE__)) + "/#{x}"d
end

.require_os_libs_relative_to(fname, dir = nil) ⇒ Object



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
# File 'lib/ragweed.rb', line 47

def self.require_os_libs_relative_to( fname, dir= nil )
  dir ||= ::File.basename(fname, '.*')
  pkgs = ""
  dbg = ""

  case
  when ::FFI::Platform.windows?
    pkgs = '32'
  when ::FFI::Platform.mac?
    pkgs = 'osx'
  # coming soon
  # when ::FFI::Platform.bsd?
  #   pkgs = "bsd"
  when ::FFI::Platform.unix? && ! ::FFI::Platform.bsd?
    # FFI doesn't specifically detect linux so... we punt
    pkgs = 'tux'
  else
    warn "Platform not supported no wrapper libraries loaded."
  end
  
  if not pkgs.empty?
    search_me = File.expand_path(File.join(File.dirname(fname), dir, "*#{pkgs}.rb"))
    Dir.glob(search_me).sort.reverse.each {|rb| require rb}
  end
end

.versionObject

Returns the version string for the library.



13
14
15
# File 'lib/ragweed.rb', line 13

def self.version
  VERSION
end