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.
- data/README.rdoc +9 -9
- data/VERSION +1 -1
- data/examples/hittracerx.rb +36 -15
- data/lib/ragweed/debugger32.rb +71 -53
- data/lib/ragweed/debuggerosx.rb +48 -25
- data/lib/ragweed/debuggertux.rb +71 -57
- data/lib/ragweed/rasm/isa.rb +1 -1
- data/lib/ragweed/rasm.rb +0 -5
- data/lib/ragweed/utils.rb +7 -3
- data/lib/ragweed/wrap32/hooks.rb +9 -9
- data/lib/ragweed/wrap32/process.rb +24 -28
- data/lib/ragweed/wrap32/wrap32.rb +7 -3
- data/lib/ragweed/wrap32.rb +0 -3
- data/lib/ragweed/wraposx/constants.rb +11 -5
- data/lib/ragweed/wraposx/kernelerrorx.rb +2 -3
- data/lib/ragweed/wraposx/region_info.rb +4 -4
- data/lib/ragweed/wraposx/thread_context.rb +8 -0
- data/lib/ragweed/wraposx/thread_info.rb +11 -3
- data/lib/ragweed/wraposx/wraposx.rb +3 -2
- data/lib/ragweed/wraptux/constants.rb +81 -80
- data/lib/ragweed/wraptux/process.rb +4 -4
- data/lib/ragweed/wraptux/threads.rb +3 -2
- data/lib/ragweed/wraptux.rb +0 -4
- data/ragweed.gemspec +2 -2
- metadata +2 -2
@@ -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
|
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, :
|
50
|
-
attach_function :vm_write, [:vm_map_t, :vm_address_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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
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)
|
data/lib/ragweed/wraptux.rb
CHANGED
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.
|
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-
|
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.
|
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-
|
15
|
+
date: 2011-07-26 00:00:00 -05:00
|
16
16
|
default_executable:
|
17
17
|
dependencies: []
|
18
18
|
|