Module: Metasploit::Framework::Compiler::Utils
- Defined in:
- lib/metasploit/framework/compiler/utils.rb
Class Method Summary collapse
-
.normalize_code(code, headers) ⇒ String
Returns the normalized C code (with headers).
Class Method Details
.normalize_code(code, headers) ⇒ String
Returns the normalized C code (with headers).
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/metasploit/framework/compiler/utils.rb', line 11 def self.normalize_code(code, headers) code = code.lines.map { |line| if line =~ /^\s*#include <([[:print:]]+)>$/ h = headers.include("#{$1}") %Q|#{h}\n| else line end }.join code end |