Permalink
Browse files

add verbosity flag, disable stack traces w/o it

git-svn-id: file:///home/svn/framework3/trunk@10409 4d416f70-5f16-0410-b530-b9f4589650da
  • Loading branch information...
1 parent 9f02523 commit e3e57d4d615a45bf6c409ac3b69653da8e44085b @jduck jduck committed Sep 21, 2010
Showing with 12 additions and 1 deletion.
  1. +12 −1 msfencode
View
@@ -25,6 +25,7 @@ supported_formats = Msf::Simple::Buffer.transform_formats + Msf::Util::EXE.to_ex
$args = Rex::Parser::Arguments.new(
"-h" => [ false, "Help banner" ],
"-l" => [ false, "List available encoders" ],
+ "-v" => [ false, "Increase verbosity" ],
# input/output
"-i" => [ true, "Encode the contents of the supplied file path" ],
"-m" => [ true, "Specifies an additional module search path" ],
@@ -108,6 +109,7 @@ def write_encoded(buf)
end
# Defaults
+verbose = 0
cmd = "encode"
arch = nil
badchars = ''
@@ -172,6 +174,10 @@ $args.parse(ARGV) { |opt, idx, val|
when "-h"
usage
+
+ when "-v"
+ verbose += 1
+
else
if (val =~ /=/)
options += ((options.length > 0) ? delim : "") + "#{val}"
@@ -266,7 +272,12 @@ case cmd
exit
rescue => e
- $stderr.puts(OutError + "#{enc.refname} failed: #{e} #{e.backtrace}")
+ $stderr.puts(OutError + "#{enc.refname} failed: #{e}")
+ if verbose > 0
+ e.backtrace.each { |el|
+ $stderr.puts(OutError + el.to_s)
+ }
+ end
end
}

0 comments on commit e3e57d4

Please sign in to comment.