ragweed 0.2.3-java → 0.2.4-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  module Ragweed; end
2
+
2
3
  module Ragweed::Wraposx::ThreadInfo
3
4
  # info interfaces
4
5
  BASIC_INFO = 3 #basic information
@@ -9,8 +10,8 @@ module Ragweed::Wraposx::ThreadInfo
9
10
  SCHED_RR_INFO = 11
10
11
  # SCHED_FIFO_INFO = 12
11
12
 
13
+ # Thread run states
12
14
  module State
13
- #Thread run states
14
15
  RUNNING = 1 #/* thread is running normally */
15
16
  STOPPED = 2 #/* thread is stopped */
16
17
  WAITING = 3 #/* thread is waiting normally */
@@ -31,8 +32,9 @@ module Ragweed::Wraposx::ThreadInfo
31
32
  # };
32
33
  class Basic < FFI::Struct
33
34
  include Ragweed::FFIStructInclude
35
+
36
+ # Thread flags (flags field).
34
37
  module Flags
35
- #Thread flags (flags field).
36
38
  SWAPPED = 0x1 #/* thread is swapped out */
37
39
  IDLE = 0x2 #/* thread is an idle thread */
38
40
  end
@@ -140,9 +142,15 @@ EOM
140
142
  end
141
143
 
142
144
  module Ragweed::Wraposx
145
+ module Libc
146
+ extend FFI::Library
147
+ ffi_lib FFI::Library::LIBC
148
+ attach_function :thread_info, [:thread_act_t, :thread_flavor_t, :pointer, :pointer], :kern_return_t
149
+ end
150
+
143
151
  class << self
144
152
 
145
- # Returns the packed string representation of the thread_info_t struct for later parsing.
153
+ # Returns the thread_info_t struct.
146
154
  #
147
155
  # kern_return_t thread_info
148
156
  # (thread_act_t target_thread,
@@ -23,6 +23,7 @@ module Ragweed::Wraposx
23
23
  typedef :int, :policy_t
24
24
  typedef :int, :boolean_t
25
25
  typedef :int, :thread_state_flavor_t
26
+ typedef :int, :thread_flavor_t
26
27
  case FFI::Platform::LONG_SIZE
27
28
  when 64
28
29
  # ifdef __LP64__
@@ -46,8 +47,8 @@ module Ragweed::Wraposx
46
47
  attach_function :task_for_pid, [:mach_port_name_t, :int, :pointer], :kern_return_t
47
48
  attach_function :task_threads, [:task_t, :pointer, :pointer], :kern_return_t
48
49
  attach_function :kill, [:pid_t, :int], :int
49
- attach_function :vm_read_overwrite, [:vm_map_t, :vm_address_t, :vm_size_t, :vm_address_t, :pointer], :kern_return_t
50
- attach_function :vm_write, [:vm_map_t, :vm_address_t, :vm_offset_t, :mach_msg_type_number_t], :kern_return_t
50
+ attach_function :vm_read_overwrite, [:vm_map_t, :vm_address_t, :vm_size_t, :pointer, :pointer], :kern_return_t
51
+ attach_function :vm_write, [:vm_map_t, :vm_address_t, :pointer, :mach_msg_type_number_t], :kern_return_t
51
52
  attach_function :vm_protect, [:vm_map_t, :vm_address_t, :vm_size_t, :boolean_t, :vm_prot_t], :kern_return_t
52
53
  attach_function :vm_allocate, [:vm_map_t, :pointer, :vm_size_t, :int], :kern_return_t
53
54
  attach_function :vm_deallocate, [:vm_map_t, :vm_address_t, :vm_size_t], :kern_return_t
@@ -3,99 +3,100 @@ module Ragweed; end
3
3
  module Ragweed::Wraptux;end
4
4
 
5
5
  module Ragweed::Wraptux::Ptrace
6
- TRACE_ME = 0
7
- PEEK_TEXT = 1
8
- PEEK_DATA = 2
9
- PEEK_USER = 3
10
- POKE_TEXT = 4
11
- POKE_DATA = 5
12
- POKE_USER = 6
13
- CONTINUE = 7
14
- KILL = 8
15
- STEP = 9
16
- GETREGS = 12
17
- SETREGS = 13
18
- ATTACH = 16
19
- DETACH = 17
20
- SYSCALL = 24
21
- SETOPTIONS = 0x4200
22
- GETEVENTMSG = 0x4201
23
- GETSIGINFO = 0x4202
24
- SETSIGINFO = 0x4203
6
+ TRACE_ME = 0
7
+ PEEK_TEXT = 1
8
+ PEEK_DATA = 2
9
+ PEEK_USER = 3
10
+ POKE_TEXT = 4
11
+ POKE_DATA = 5
12
+ POKE_USER = 6
13
+ CONTINUE = 7
14
+ KILL = 8
15
+ STEP = 9
16
+ GETREGS = 12
17
+ SETREGS = 13
18
+ ATTACH = 16
19
+ DETACH = 17
20
+ SYSCALL = 24
21
+ SETOPTIONS = 0x4200
22
+ GETEVENTMSG = 0x4201
23
+ GETSIGINFO = 0x4202
24
+ SETSIGINFO = 0x4203
25
25
  end
26
26
 
27
27
  module Ragweed::Wraptux::Ptrace::SetOptions
28
- TRACESYSGOOD = 0x00000001
29
- TRACEFORK = 0x00000002
30
- TRACEVFORK = 0x00000004
31
- TRACECLONE = 0x00000008
32
- TRACEEXEC = 0x00000010
33
- TRACEVFORKDONE = 0x00000020
34
- TRACEEXIT = 0x00000040
35
- MASK = 0x0000007f
28
+ TRACESYSGOOD = 0x00000001
29
+ TRACEFORK = 0x00000002
30
+ TRACEVFORK = 0x00000004
31
+ TRACECLONE = 0x00000008
32
+ TRACEEXEC = 0x00000010
33
+ TRACEVFORKDONE = 0x00000020
34
+ TRACEEXIT = 0x00000040
35
+ MASK = 0x0000007f
36
36
  end
37
37
 
38
38
  module Ragweed::Wraptux::Ptrace::EventCodes
39
- FORK = 1
40
- VFORK = 2
41
- CLONE = 3
42
- EXEC = 4
43
- VFORK_DONE = 5
44
- EXIT = 6
39
+ FORK = 1
40
+ VFORK = 2
41
+ CLONE = 3
42
+ EXEC = 4
43
+ VFORK_DONE = 5
44
+ EXIT = 6
45
45
  end
46
46
 
47
+ # @deprecated Use ::Signal
47
48
  module Ragweed::Wraptux::Signal
48
- SIGHUP = 1
49
- SIGINT = 2
50
- SIGQUIT = 3
51
- SIGILL = 4
52
- SIGTRAP = 5
53
- SIGABRT = 6
54
- SIGIOT = 6
55
- SIGBUS = 7
56
- SIGFPE = 8
57
- SIGKILL = 9
58
- SIGUSR1 = 10
59
- SIGSEGV = 11
60
- SIGUSR2 = 12
61
- SIGPIPE = 13
62
- SIGALRM = 14
63
- SIGTERM = 15
64
- SIGSTKFLT = 16
65
- SIGCHLD = 17
66
- SIGCONT = 18
67
- SIGSTOP = 19
68
- SIGTSTP = 20
69
- SIGTTIN = 21
70
- SIGTTOU = 22
71
- SIGURG = 23
72
- SIGXCPU = 24
73
- SIGXFSZ = 25
74
- SIGVTALRM = 26
75
- SIGPROF = 27
76
- SIGWINCH = 28
77
- SIGIO = 29
78
- SIGPOLL = SIGIO
79
- #SIGLOST = 29
80
- SIGPWR = 30
81
- SIGSYS = 31
82
- SIGUNUSED = 31
49
+ SIGHUP = 1
50
+ SIGINT = 2
51
+ SIGQUIT = 3
52
+ SIGILL = 4
53
+ SIGTRAP = 5
54
+ SIGABRT = 6
55
+ SIGIOT = 6
56
+ SIGBUS = 7
57
+ SIGFPE = 8
58
+ SIGKILL = 9
59
+ SIGUSR1 = 10
60
+ SIGSEGV = 11
61
+ SIGUSR2 = 12
62
+ SIGPIPE = 13
63
+ SIGALRM = 14
64
+ SIGTERM = 15
65
+ SIGSTKFLT = 16
66
+ SIGCHLD = 17
67
+ SIGCONT = 18
68
+ SIGSTOP = 19
69
+ SIGTSTP = 20
70
+ SIGTTIN = 21
71
+ SIGTTOU = 22
72
+ SIGURG = 23
73
+ SIGXCPU = 24
74
+ SIGXFSZ = 25
75
+ SIGVTALRM = 26
76
+ SIGPROF = 27
77
+ SIGWINCH = 28
78
+ SIGIO = 29
79
+ SIGPOLL = SIGIO
80
+ #SIGLOST = 29
81
+ SIGPWR = 30
82
+ SIGSYS = 31
83
+ SIGUNUSED = 31
83
84
  end
84
85
 
85
86
  module Ragweed::Wraptux::Wait
86
- NOHANG = 1
87
- UNTRACED = 2
88
- EXITED = 4
89
- STOPPED = 8
90
- CONTINUED = 10
91
- NOWWAIT = 20
87
+ NOHANG = 1
88
+ UNTRACED = 2
89
+ EXITED = 4
90
+ STOPPED = 8
91
+ CONTINUED = 10
92
+ NOWWAIT = 20
92
93
  end
93
94
 
94
95
  module Ragweed::Wraptux::PagePermissions
95
- PROT_NONE = 0x0
96
- PROT_READ = 0x1
97
- PROT_WRITE = 0x2
98
- PROT_EXEC = 0x4
99
- PROT_GROWSDOWN = 0x01000000
100
- PROT_GROWSUP = 0x02000000
96
+ PROT_NONE = 0x0
97
+ PROT_READ = 0x1
98
+ PROT_WRITE = 0x2
99
+ PROT_EXEC = 0x4
100
+ PROT_GROWSDOWN = 0x01000000
101
+ PROT_GROWSUP = 0x02000000
101
102
  end
@@ -5,7 +5,7 @@ class Ragweed::Process
5
5
 
6
6
  def initialize(pid); @pid = pid; end
7
7
 
8
- ## Read/write ranges of data or fixnums to/from the process by address.
8
+ # Read/write ranges of data or fixnums to/from the process by address.
9
9
  def read(off, sz=4096)
10
10
  a = []
11
11
  max = off+sz
@@ -17,9 +17,9 @@ class Ragweed::Process
17
17
  a.pack('L*')
18
18
  end
19
19
 
20
- ## ptrace sucks, writing 8 or 16 bytes will probably
21
- ## result in failure unless you PTRACE_POKE first and
22
- ## get the rest of the original value at the address
20
+ # ptrace sucks, writing 8 or 16 bytes will probably
21
+ # result in failure unless you PTRACE_POKE first and
22
+ # get the rest of the original value at the address
23
23
  def write(off, data)
24
24
  while off < data.size
25
25
  Ragweed::Wraptux::ptrace(Ragweed::Wraptux::Ptrace::POKE_TEXT, @pid, off, data[off,4].unpack('L').first)
@@ -1,7 +1,8 @@
1
- ## New 'ThreadInfo' sub module
2
- ## so Wraptux matches the API
3
1
  module Ragweed; end
4
2
  module Ragweed::Wraptux; end
5
3
 
4
+ # New 'ThreadInfo' sub module
5
+ # so Wraptux matches the API
6
+ # @todo Implement
6
7
  module Ragweed::Wraptux::ThreadInfo
7
8
  end
@@ -1,7 +1,3 @@
1
- # Dir[File.expand_path("#{File.dirname(__FILE__)}/wraptux/*.rb")].each do |file|
2
- # require file
3
- # end
4
-
5
1
  module Ragweed; end
6
2
  module Ragweed::Wraptux
7
3
  # :stopdoc:
data/ragweed.gemspec CHANGED
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ragweed}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
  s.platform = %q{java}
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["tduehr", "struct", "tqbf"]
13
- s.date = %q{2011-06-09}
13
+ s.date = %q{2011-07-26}
14
14
  s.description = %q{General debugging tool written in Ruby for OSX/Win32/Linux}
15
15
  s.email = %q{td@matasano.com}
16
16
  s.extra_rdoc_files = [
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ragweed
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.3
5
+ version: 0.2.4
6
6
  platform: java
7
7
  authors:
8
8
  - tduehr
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-06-09 00:00:00 -05:00
15
+ date: 2011-07-26 00:00:00 -05:00
16
16
  default_executable:
17
17
  dependencies: []
18
18