Update naming and license
This commit is contained in:
parent
2a7d0ddfd1
commit
82c8138de0
|
@ -1,3 +1,8 @@
|
|||
//
|
||||
// License:
|
||||
// https://github.com/rapid7/metasploit-framework/blob/master/LICENSE
|
||||
//
|
||||
|
||||
#define MAX_PATH 260
|
||||
#define MEM_COMMIT 0x00001000
|
||||
#define MEM_RESERVE 0x00002000
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
//
|
||||
// License:
|
||||
// https://github.com/rapid7/metasploit-framework/blob/master/LICENSE
|
||||
//
|
||||
|
||||
#define NULL ((void *)0)
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
|
|
@ -15,7 +15,7 @@ module Metasploit
|
|||
# @param type [Symbol] PE type, either :exe or :dll
|
||||
# @raise [NotImplementedError] If the type is not supported.
|
||||
# @return [String] The compiled code.
|
||||
def self.compile(c_template, type=:exe)
|
||||
def self.compile_c(c_template, type=:exe)
|
||||
headers = Compiler::Headers::Win32.new
|
||||
source_code = Compiler::Utils.normalize_code(c_template, headers)
|
||||
|
||||
|
@ -38,7 +38,7 @@ module Metasploit
|
|||
# @param c_template [String] The C source code to compile.
|
||||
# @param type [Symbol] PE type, either :exe or :dll
|
||||
# @return [Integer] The number of bytes written.
|
||||
def self.compile_as(out_file, c_template, type=:exe)
|
||||
def self.compile_c_to_file(out_file, c_template, type=:exe)
|
||||
pe = self.compile(c_template, type)
|
||||
File.write(out_file, pe)
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
|||
require 'metasploit/framework/compiler/win32'
|
||||
|
||||
RSpec.describe Metasploit::Framework::Compiler::Win32 do
|
||||
describe '#self.compile' do
|
||||
describe '#self.compile_c' do
|
||||
let(:c_template) {
|
||||
%Q|#include <Windows.h>
|
||||
|
||||
|
@ -14,7 +14,7 @@ RSpec.describe Metasploit::Framework::Compiler::Win32 do
|
|||
}
|
||||
|
||||
it 'returns an EXE binary' do
|
||||
bin = Metasploit::Framework::Compiler::Win32.compile(c_template)
|
||||
bin = Metasploit::Framework::Compiler::Win32.compile_c(c_template)
|
||||
magic = bin[0, 2]
|
||||
expect(magic).to eq('MZ')
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue