Encapsulates the generation of the Alexander Sotirov's HeapLib javascript stub
The source file to load the javascript from
The list of symbols found in the file. This is used to dynamically replace contents.
Loads the raw javascript from the source file and strips out comments
# File lib/rex/exploitation/heaplib.rb, line 75 def load_js(custom_js, opts = {}) # Grab the complete javascript File.open(JavascriptFile) do |f| @js = f.read end # Decode the text @js = Rex::Text.decode_base64(@js) # Append the real code @js += "\n" + custom_js if opts[:newobfu] # Obfuscate the javascript using the new lexer method @js = JSObfu.new(@js) return @js.obfuscate elsif opts[:noobfu] # Do not obfuscate, let the exploit do the work (useful to avoid double obfuscation) return @js end # Default to the old method # Obfuscate the javascript using the old method @js = ObfuscateJS.obfuscate(@js, 'Symbols' => SymbolNames) end
Generated with the Darkfish Rdoc Generator 2.