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

43 lines
960 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
subject { 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
subject { described_class.gen_decoder_prefix(reg, offset) }
let(:reg) { 'ECX' }
let(:offset) { 0 }
it { is_expected.to eq('') }
end
describe ".gen_decoder" do
subject { described_class.gen_decoder(reg, offset) }
let(:reg) { 'ECX' }
let(:offset) { 0 }
it { is_expected.to eq('') }
end
describe ".gen_second" do
subject { described_class.gen_second(block, base) }
let(:block) { 0xaf }
let(:base) { 0xfa }
it "returns block ^ base" do
expect(subject ^ base).to eq(block)
end
end
end