metasploit-framework/spec/lib/rex/encoder/alpha2/generic_spec.rb

43 lines
1012 B
Ruby
Raw Normal View History

# -*- coding:binary -*-
require 'spec_helper'
require 'rex/encoder/alpha2/generic'
describe Rex::Encoder::Alpha2::Generic do
2014-09-15 20:46:53 +00:00
it_behaves_like 'Rex::Encoder::Alpha2::Generic'
describe ".default_accepted_chars" do
2014-10-13 15:41:12 +00:00
subject(:accepted_chars) { described_class.default_accepted_chars }
it { is_expected.to eq(('a' .. 'z').to_a + ('B' .. 'Z').to_a + ('0' .. '9').to_a) }
end
describe ".gen_decoder_prefix" do
2014-10-13 15:41:12 +00:00
subject(:decoder_prefix) { described_class.gen_decoder_prefix(reg, offset) }
let(:reg) { 'ECX' }
let(:offset) { 0 }
it { is_expected.to eq('') }
end
describe ".gen_decoder" do
2014-10-13 15:41:12 +00:00
subject(:decoder) { described_class.gen_decoder(reg, offset) }
let(:reg) { 'ECX' }
let(:offset) { 0 }
it { is_expected.to eq('') }
end
describe ".gen_second" do
2014-10-13 15:41:12 +00:00
subject(:second) { described_class.gen_second(block, base) }
let(:block) { 0xaf }
let(:base) { 0xfa }
it "returns block ^ base" do
2014-10-13 15:41:12 +00:00
expect(second ^ base).to eq(block)
end
end
end