CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/spec/lib/metasploit/framework/compiler/windows_spec.rb
Views: 1904
1
require 'spec_helper'
2
require 'metasploit/framework/compiler/windows'
3
4
RSpec.describe Metasploit::Framework::Compiler::Windows do
5
describe '#self.compile_c' do
6
let(:c_template) {
7
%Q|#include <Windows.h>
8
9
int main(void) {
10
MessageBox(NULL, "Hello World", "Test", MB_OK);
11
return 0;
12
}
13
|
14
}
15
16
it 'returns an EXE binary' do
17
bin = Metasploit::Framework::Compiler::Windows.compile_c(c_template)
18
magic = bin[0, 2]
19
expect(magic).to eq('MZ')
20
end
21
end
22
end
23