mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-12 11:52:01 +01:00
Fixes #683. This triggers when running on ruby 1.9 and is probably one of many like this and one of the reasons this interface is not maintained. However, since you wen to the effort of reporting it, the least we can do is fix it ;)
git-svn-id: file:///home/svn/framework3/trunk@7838 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
1029ecd7f8
commit
a1f71fa994
@ -8,11 +8,11 @@ module Gtk2
|
||||
# TODO: Add a pixmap for platform
|
||||
#
|
||||
class MyModuleView
|
||||
|
||||
|
||||
module TagHref
|
||||
attr_accessor :href
|
||||
end
|
||||
|
||||
|
||||
def initialize(buffer)
|
||||
@buffer = buffer
|
||||
end
|
||||
@ -23,22 +23,22 @@ module Gtk2
|
||||
|
||||
help_intro = %Q{
|
||||
This interface can be used in either wizard-mode or console-mode. To start the
|
||||
wizard, browse to a module in the list above, and double-click its name. To
|
||||
wizard, browse to a module in the list above, and double-click its name. To
|
||||
view the source code of a module, right-click its name and select the View Code
|
||||
option. If you prefer to work in a msfconsole interface instead, select the
|
||||
option. If you prefer to work in a msfconsole interface instead, select the
|
||||
Console option from the Window menu (or just press Control+O). Have fun!
|
||||
}
|
||||
|
||||
@buffer.insert_with_tags(start, "\nWelcome to the Metasploit Framework GUI!\n\n", "black_center")
|
||||
@buffer.insert_with_tags(start, help_intro.gsub(/\s+/, " ").strip, "black_wrap")
|
||||
@buffer.insert_with_tags(start, "\nWelcome to the Metasploit Framework GUI!\n\n", "black_center")
|
||||
@buffer.insert_with_tags(start, help_intro.gsub(/\s+/, " ").strip, "black_wrap")
|
||||
end
|
||||
|
||||
def insert_module(obj)
|
||||
@buffer.delete(*@buffer.bounds)
|
||||
start = @buffer.get_iter_at_offset(0)
|
||||
|
||||
|
||||
credit = [ *obj.author ].map {|a| "#{a.name} (#{a.email})" }.join(" and ")
|
||||
|
||||
|
||||
# The description goes first
|
||||
desc = ""
|
||||
obj.description.each_line do |line|
|
||||
@ -51,15 +51,15 @@ module Gtk2
|
||||
end
|
||||
end
|
||||
desc.strip!
|
||||
|
||||
if(desc.length > 0 and not (desc[-1] >= 0x21 and desc[-1] <= 0x2e) )
|
||||
|
||||
if(desc.length > 0 and not (desc[-1,1].unpack("C")[0] >= 0x21 and desc[-1,1].unpack("C")[0] <= 0x2e) )
|
||||
desc << "."
|
||||
end
|
||||
|
||||
|
||||
@buffer.insert_with_tags(start, "Module: ", "_")
|
||||
@buffer.insert_with_tags(start, "#{obj.fullname}\n\n", "black_wrap")
|
||||
|
||||
@buffer.insert_with_tags(start,
|
||||
|
||||
@buffer.insert_with_tags(start,
|
||||
desc + " This #{obj.type} module was written by #{credit}\n\n",
|
||||
"black_wrap"
|
||||
)
|
||||
@ -75,16 +75,17 @@ module Gtk2
|
||||
'left_margin' => 25
|
||||
})
|
||||
tag.extend(TagHref)
|
||||
tag.href = ref.to_s
|
||||
tag.href = ref.to_s
|
||||
@buffer.insert_with_tags(start, ref.to_s + "\n", tag)
|
||||
end
|
||||
|
||||
|
||||
@buffer.insert_with_tags(start, "\n")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user