Add rspec for outputdebugstring and correct a few things
parent
03c3e08167
commit
5c86b836c4
|
@ -10,7 +10,7 @@ module Metasploit
|
|||
class Malloc < Base
|
||||
def initialize
|
||||
super
|
||||
@dep = ['stdlib.h']
|
||||
@dep = ['malloc']
|
||||
end
|
||||
|
||||
def stub
|
||||
|
|
|
@ -6,7 +6,7 @@ RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::Int
|
|||
described_class.new
|
||||
end
|
||||
|
||||
describe '#if_stub' do
|
||||
describe '#stub' do
|
||||
it 'is a string' do
|
||||
expect(subject.send(:stub).class).to be(String)
|
||||
end
|
||||
|
|
|
@ -19,8 +19,8 @@ RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::Mal
|
|||
expect(subject.send(:stub)).to match(/void stub()/)
|
||||
end
|
||||
|
||||
it 'depends on stdlib.h' do
|
||||
expect(subject.dep).to eq(['stdlib.h'])
|
||||
it 'depends on malloc' do
|
||||
expect(subject.dep).to eq(['malloc'])
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
require 'metasploit/framework/obfuscation/crandomizer/code_factory'
|
||||
|
||||
RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::OutputDebugString do
|
||||
|
||||
subject(:int_assignments) do
|
||||
described_class.new
|
||||
end
|
||||
|
||||
describe '#outputdebugstring_1' do
|
||||
it 'is a string' do
|
||||
expect(subject.send(:outputdebugstring_1).class).to be(String)
|
||||
end
|
||||
|
||||
it 'has an OutputDebugString' do
|
||||
expect(subject.send(:outputdebugstring_1)).to match(/OutputDebugString\(.+\)/)
|
||||
end
|
||||
|
||||
it 'has a stub() function' do
|
||||
expect(subject.send(:outputdebugstring_1)).to match(/void stub()/)
|
||||
end
|
||||
|
||||
it 'depends on stdlib.h' do
|
||||
expect(subject.dep).to eq(['OutputDebugString'])
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue