Skip to content

Commit 6da216f

Browse files
committed
More options
1 parent af8f645 commit 6da216f

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tools/egghunter.rb

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,38 @@ def self.parse(args)
3030
options[:badchars] = v
3131
end
3232

33-
opt.on('-e', '--egg <String>', "Egg") do |v|
33+
opt.on('-e', '--egg <String>', "The egg (Please give 4 bytes)") do |v|
3434
options[:eggtag] = v
3535
end
3636

3737
opt.on('-p', '--platform <String>', "(Optional) Platform") do |v|
3838
options[:platform] = v
3939
end
4040

41+
opt.on('--startreg <String>', "(Optional) The starting register") do |v|
42+
options[:startreg] = v
43+
end
44+
45+
opt.on('--forward', "(Optional) To search forward") do |v|
46+
options[:startreg] = true
47+
end
48+
49+
opt.on('--depreg <String>', "(Optional) The DEP register") do |v|
50+
options[:depreg] = v
51+
end
52+
53+
opt.on('--depdest <String>', "(Optional) The DEP destination") do |v|
54+
options[:depdest] = v
55+
end
56+
57+
opt.on('--depsize <Fixnum>', "(Optional) The DEP size") do |v|
58+
options[:depsize] = v
59+
end
60+
61+
opt.on('--depmethod <String>', "(Optional) The DEP method to use (virtualprotect/virtualalloc/copy/copy_size)") do |v|
62+
options[:depmethod] = v
63+
end
64+
4165
opt.on('-a', '--arch <String>', "(Optional) Architecture") do |v|
4266
options[:arch] = v
4367
end
@@ -62,6 +86,8 @@ def self.parse(args)
6286
raise OptionParser::InvalidOption, "#{options[:format]} is not a valid format"
6387
elsif options[:eggtag].blank?
6488
raise OptionParser::MissingArgument, '-e is required'
89+
elsif options[:depsize] && options[:depsize] =~ /^\d+$/
90+
raise OptionParser::InvalidOption, "--depsize must be a Fixnum"
6591
end
6692

6793
options

0 commit comments

Comments
 (0)