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 CHANGED
@@ -1,3 +1,5 @@
1
+ 0.7.3 Fixed issue 10 (Compile Error in i486 Arch (-ldistorm64 not found) )
2
+
1
3
  0.7.2 Fixed issue 9 by ruby-wrapping properly the rallhook thread info including the garbage collector mark function of
2
4
  the ruby wrapper
3
5
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
6
6
 
7
7
  spec = Gem::Specification.new do |s|
8
8
  s.name = 'rallhook'
9
- s.version = '0.7.2'
9
+ s.version = '0.7.3'
10
10
  s.author = 'Dario Seminara'
11
11
  s.email = 'robertodarioseminara@gmail.com'
12
12
  s.platform = Gem::Platform::RUBY
@@ -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
- $LIBS = $LIBS + " -ldistorm64"
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"
@@ -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 = 0xFFFFFFFFFFFF000;
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: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 2
10
- version: 0.7.2
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-06-25 00:00:00 -03:00
18
+ date: 2010-07-23 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency