Force LITTLE_ENDIAN by default

bug/bundler_fix
jvazquez-r7 2014-11-04 10:39:42 -06:00
parent 3b1042b903
commit eb8d4b6772
6 changed files with 20 additions and 3 deletions

View File

@ -4,6 +4,9 @@ require 'spec_helper'
require 'rex/ole'
describe Rex::OLE::CLSID do
before(:each) do
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
end
let(:sample_clsid) { "\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff" }
@ -35,7 +38,6 @@ describe Rex::OLE::CLSID do
describe "#to_s" do
it "returns printable clsid" do
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
expect(clsid.to_s).to eq('33221100-5544-7766-8899-aabbccddeeff')
end

View File

@ -4,6 +4,9 @@ require 'spec_helper'
require 'rex/ole'
describe Rex::OLE::DIFAT do
before(:each) do
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
end
let(:storage) do
Rex::OLE::Storage.new

View File

@ -4,6 +4,9 @@ require 'spec_helper'
require 'rex/ole'
describe Rex::OLE::DirEntry do
before(:each) do
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
end
let(:storage) do
Rex::OLE::Storage.new

View File

@ -4,6 +4,9 @@ require 'spec_helper'
require 'rex/ole'
describe Rex::OLE::Header do
before(:each) do
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
end
subject(:header) do
described_class.new
@ -240,7 +243,7 @@ describe Rex::OLE::Header do
hdr << 'A' * 16 # @_clid
hdr << 'BB' # @_uMinorVersion
hdr << 'CC' # @_uMajorVersion
hdr << 'DD' # @_uByteOrder
hdr << "\xfe\xff" # @_uByteOrder
hdr << 'EE' # @_uSectorShift
hdr << 'FF' # @_uMiniSectorShift
hdr << '123456' # padding
@ -275,7 +278,7 @@ describe Rex::OLE::Header do
it "sets byte order from input" do
header.read(correct_fd)
expect(header.instance_variable_get(:@_uByteOrder)).to eq(0x4444)
expect(header.instance_variable_get(:@_uByteOrder)).to eq(Rex::OLE::LITTLE_ENDIAN)
end
it "sets the size of sectors from input" do

View File

@ -4,6 +4,9 @@ require 'spec_helper'
require 'rex/ole'
describe Rex::OLE::MiniFAT do
before(:each) do
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
end
let(:storage) do
Rex::OLE::Storage.new

View File

@ -4,6 +4,9 @@ require 'spec_helper'
require 'rex/ole'
describe Rex::OLE::Util do
before(:each) do
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
end
describe ".Hexify32array" do
subject(:hex_array) { described_class.Hexify32array(arr) }