Module: Buby::Implants::MessageEditor
- Defined in:
- lib/buby/implants/message_editor.rb
Overview
This interface is used to provide extensions with an instance of Burp’s HTTP message editor, for the extension to use in its own UI. Extensions should call Buby#createMessageEditor to obtain an instance of this interface.
Class Method Summary collapse
-
.implant(editor) ⇒ Object
Install ourselves into the current
IMessageEditor
java class.
Instance Method Summary collapse
-
#getMessage ⇒ String
This method is used to retrieve the currently displayed message, which may have been modified by the user.
-
#getSelectedData ⇒ String?
This method returns the data that is currently selected by the user.
-
#setMessage(message, isRequest = true) ⇒ void
This method is used to display an HTTP message in the editor.
Class Method Details
.implant(editor) ⇒ Object
Install ourselves into the current IMessageEditor
java class
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/buby/implants/message_editor.rb', line 47 def self.implant(editor) unless editor.implanted? || editor.nil? pp [:implanting, editor, editor.class] if $DEBUG editor.class.class_exec(editor) do |editor| a_methods = %w{ setMessage getMessage getSelectedData } a_methods.each do |meth| alias_method "__"+meth.to_s, meth end include Buby::Implants::MessageEditor a_methods.each do |meth| java_class.ruby_names_for_java_method(meth).each do |ruby_meth| define_method ruby_meth, Buby::Implants::MessageEditor.instance_method(meth) end end include Buby::Implants::Proxy end end editor end |
Instance Method Details
#getMessage ⇒ String
This method is used to retrieve the currently displayed message, which may have been modified by the user.
30 31 32 |
# File 'lib/buby/implants/message_editor.rb', line 30 def getMessage String.from_java_bytes __getMessage end |
#getSelectedData ⇒ String?
This method returns the data that is currently selected by the user.
39 40 41 42 |
# File 'lib/buby/implants/message_editor.rb', line 39 def getSelectedData ret = __getSelectedData ret ? String.from_java_bytes(ret) : ret end |
#setMessage(message, isRequest = true) ⇒ void
This method returns an undefined value.
This method is used to display an HTTP message in the editor.
16 17 18 19 20 21 22 23 |
# File 'lib/buby/implants/message_editor.rb', line 16 def setMessage(, isRequest = true) if .kind_of? Java::Burp::IHttpRequestResponse = isRequest ? .request : .response end = .to_java_bytes if .respond_to? :to_java_bytes = .to_java :byte if .kind_of? Array __setMessage(, isRequest) end |