w32evol_ruby 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. data/README.rdoc +2 -2
  2. data/lib/w32evol.rb +14 -6
  3. metadata +3 -3
@@ -1,4 +1,4 @@
1
- = w32evol_wrapper -- w32evol obfuscation engine wrapped in Ruby
1
+ = w32evol_ruby -- w32evol obfuscation engine wrapped in Ruby
2
2
 
3
3
  == Table of Contents
4
4
  1. Introduction
@@ -8,7 +8,7 @@
8
8
  5. Development
9
9
 
10
10
  == 1. Introduction
11
- <b>Does not contain a virus</b>
11
+ <b>This is not a virus nor does it contain a virus.</b>
12
12
 
13
13
  This is a Ruby wrapper for the obfuscation engine
14
14
  {w32evol}[https://bitbucket.org/martinvelez/w32evol].
@@ -1,7 +1,7 @@
1
1
  require 'tempfile'
2
2
 
3
3
  # This class wraps the w32evol obfuscation engine.
4
- # {w32evol}[https://github.com/martinvelez/w32evol]
4
+ # {w32evol}[https://bitbucket.org/martinvelez/w32evol]
5
5
  class W32Evol
6
6
 
7
7
  # By default the engine is distributed in the ext folder of this gem.
@@ -18,11 +18,12 @@ class W32Evol
18
18
  # Default options:
19
19
  #
20
20
  # By default the engine is distributed with this gem in the "ext" folder
21
- # :command => File.join(ENGINE_ROOT,"ext","bin","w32evol.exe")
21
+ # :engine => File.join(ENGINE_ROOT,"ext","bin","w32evol.exe")
22
22
  #
23
23
  def initialize(options = {})
24
24
  @name = self.class.to_s.downcase
25
25
  @options = default_options.merge(options)
26
+ @command = generate_command
26
27
  @command_options = generate_command_options
27
28
  end
28
29
 
@@ -65,7 +66,7 @@ class W32Evol
65
66
  {
66
67
  # By default the engine is in the ext folder of this gem
67
68
  # This assumes that the wine command in in your PATH
68
- :command => File.join(ENGINE_ROOT,"ext","#{@name}.exe")
69
+ :engine => File.join(ENGINE_ROOT,"ext","#{@name}.exe")
69
70
  }
70
71
  end
71
72
 
@@ -96,9 +97,7 @@ class W32Evol
96
97
  # This engine does not output to stderr, it only returns an exit code if it
97
98
  # fails.
98
99
  output, errors, exitstatus = "", "", 0
99
- cmd = "#{@options[:command]} #{infile} #{outfile}"
100
- cmd.insert(0, "wine ") if (PLATFORM == 'windows' and RUBY_PLATFORM =~ /linux/)
101
- system(cmd)
100
+ system("#{@command} #{infile} #{outfile}")
102
101
  exitstatus = $?.exitstatus
103
102
  if exitstatus == 0 # if engine success
104
103
  f = File.new(outfile)
@@ -108,5 +107,14 @@ class W32Evol
108
107
  return output, errors, exitstatus
109
108
  end
110
109
 
110
+ def generate_command
111
+ if PLATFORM == 'windows'
112
+ return "wine #{@options[:engine]}" if RUBY_PLATFORM =~ /linux/
113
+ elsif PLATFORM == 'java'
114
+ return "java -jar #{@options[:engine]}"
115
+ end
116
+ return @options[:engine]
117
+ end
118
+
111
119
  end
112
120
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Martin Velez
@@ -34,7 +34,7 @@ files:
34
34
  - test/test_w32evol.rb
35
35
  - README.rdoc
36
36
  has_rdoc: true
37
- homepage: http://bitbucket.org/martinvelez/w32evol
37
+ homepage: http://bitbucket.org/martinvelez/w32evol_ruby
38
38
  licenses: []
39
39
 
40
40
  post_install_message: