rallhook 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/ext/rallhook_base/extconf.rb +19 -1
- data/ext/rallhook_base/hook.c +1 -1
- data/ext/rallhook_base/rb_call_fake.c +2 -2
- metadata +4 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -5,7 +5,25 @@ CONFIG['CC'] = 'gcc'
|
|
5
5
|
ruby_version = Config::CONFIG["ruby_version"]
|
6
6
|
ruby_version = ruby_version.split(".")[0..1].join(".")
|
7
7
|
|
8
|
-
|
8
|
+
def distorm
|
9
|
+
|
10
|
+
distorm_names = {
|
11
|
+
"/usr/lib/libdistorm3.so" => "distorm3",
|
12
|
+
"/usr/local/lib/libdistorm3.so" => "distorm3",
|
13
|
+
"/usr/lib/libdistorm64.so" => "distorm64",
|
14
|
+
"/usr/local/lib/libdistorm64.so" => "distorm64"
|
15
|
+
}
|
16
|
+
|
17
|
+
distorm_names.each do |k,v|
|
18
|
+
if File.exists? k then
|
19
|
+
return v
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
raise "Distorm library not found in the system"
|
24
|
+
end
|
25
|
+
|
26
|
+
$LIBS = $LIBS + " -l#{distorm()}"
|
9
27
|
|
10
28
|
if ruby_version == "1.8"
|
11
29
|
$CFLAGS = $CFLAGS + " -DRUBY1_8"
|
data/ext/rallhook_base/hook.c
CHANGED
@@ -67,7 +67,7 @@ void unprotect(void* ptr) {
|
|
67
67
|
rb_bug("mprotect failed: %s", strerror(errno));
|
68
68
|
}
|
69
69
|
#elif __i386__
|
70
|
-
unsigned int mask =
|
70
|
+
unsigned int mask = 0xFFFFF000;
|
71
71
|
int ret = mprotect( (void*) ( ( (unsigned int)ptr ) & mask ), 0x1000, PROT_READ | PROT_WRITE | PROT_EXEC);
|
72
72
|
|
73
73
|
if (ret == -1) {
|
@@ -82,7 +82,7 @@ VALUE rb_call_copy_i(
|
|
82
82
|
if (is_fastcall == 1) {
|
83
83
|
|
84
84
|
int array[7] = { (int)klass, (int)recv, mid, argc, (int)argv, scope, (int)self };
|
85
|
-
rb_call_write_eax(array);
|
85
|
+
rb_call_write_eax((int)array);
|
86
86
|
|
87
87
|
__asm__("push %ebp\n"); // save all registers
|
88
88
|
__asm__("push %esi\n");
|
@@ -109,7 +109,7 @@ VALUE rb_call_copy_i(
|
|
109
109
|
|
110
110
|
} else if ( is_fastcall == 2) {
|
111
111
|
int array[7] = { (int)klass, (int)recv, mid, argc, (int)argv, scope, (int)self };
|
112
|
-
rb_call_write_eax(array);
|
112
|
+
rb_call_write_eax((int)array);
|
113
113
|
|
114
114
|
__asm__("push %ebp\n"); // save all registers
|
115
115
|
__asm__("push %esi\n");
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rallhook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 3
|
10
|
+
version: 0.7.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dario Seminara
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-07-23 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|