print message when skipping because of bad magic number

git-svn-id: file:///home/svn/framework3/trunk@6154 4d416f70-5f16-0410-b530-b9f4589650da
unstable
kris 2009-01-15 03:09:29 +00:00
parent d53ac9648c
commit 4927e7121b
1 changed files with 4 additions and 1 deletions

View File

@ -86,7 +86,10 @@ ARGV.each do |file|
begin
elf = Rex::ElfParsey::Elf.new_from_file(file, true)
rescue Rex::ElfParsey::ElfHeaderError
next if $!.message == 'Invalid magic number'
if $!.message == 'Invalid magic number'
$stderr.puts("Skipping #{file}: #{$!}")
next
end
raise $!
rescue Errno::ENOENT
$stderr.puts("File does not exist: #{file}")