Force LITTLE_ENDIAN by default
parent
3b1042b903
commit
eb8d4b6772
|
@ -4,6 +4,9 @@ require 'spec_helper'
|
||||||
require 'rex/ole'
|
require 'rex/ole'
|
||||||
|
|
||||||
describe Rex::OLE::CLSID do
|
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" }
|
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
|
describe "#to_s" do
|
||||||
it "returns printable clsid" 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')
|
expect(clsid.to_s).to eq('33221100-5544-7766-8899-aabbccddeeff')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@ require 'spec_helper'
|
||||||
require 'rex/ole'
|
require 'rex/ole'
|
||||||
|
|
||||||
describe Rex::OLE::DIFAT do
|
describe Rex::OLE::DIFAT do
|
||||||
|
before(:each) do
|
||||||
|
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
|
||||||
|
end
|
||||||
|
|
||||||
let(:storage) do
|
let(:storage) do
|
||||||
Rex::OLE::Storage.new
|
Rex::OLE::Storage.new
|
||||||
|
|
|
@ -4,6 +4,9 @@ require 'spec_helper'
|
||||||
require 'rex/ole'
|
require 'rex/ole'
|
||||||
|
|
||||||
describe Rex::OLE::DirEntry do
|
describe Rex::OLE::DirEntry do
|
||||||
|
before(:each) do
|
||||||
|
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
|
||||||
|
end
|
||||||
|
|
||||||
let(:storage) do
|
let(:storage) do
|
||||||
Rex::OLE::Storage.new
|
Rex::OLE::Storage.new
|
||||||
|
|
|
@ -4,6 +4,9 @@ require 'spec_helper'
|
||||||
require 'rex/ole'
|
require 'rex/ole'
|
||||||
|
|
||||||
describe Rex::OLE::Header do
|
describe Rex::OLE::Header do
|
||||||
|
before(:each) do
|
||||||
|
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
|
||||||
|
end
|
||||||
|
|
||||||
subject(:header) do
|
subject(:header) do
|
||||||
described_class.new
|
described_class.new
|
||||||
|
@ -240,7 +243,7 @@ describe Rex::OLE::Header do
|
||||||
hdr << 'A' * 16 # @_clid
|
hdr << 'A' * 16 # @_clid
|
||||||
hdr << 'BB' # @_uMinorVersion
|
hdr << 'BB' # @_uMinorVersion
|
||||||
hdr << 'CC' # @_uMajorVersion
|
hdr << 'CC' # @_uMajorVersion
|
||||||
hdr << 'DD' # @_uByteOrder
|
hdr << "\xfe\xff" # @_uByteOrder
|
||||||
hdr << 'EE' # @_uSectorShift
|
hdr << 'EE' # @_uSectorShift
|
||||||
hdr << 'FF' # @_uMiniSectorShift
|
hdr << 'FF' # @_uMiniSectorShift
|
||||||
hdr << '123456' # padding
|
hdr << '123456' # padding
|
||||||
|
@ -275,7 +278,7 @@ describe Rex::OLE::Header do
|
||||||
|
|
||||||
it "sets byte order from input" do
|
it "sets byte order from input" do
|
||||||
header.read(correct_fd)
|
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
|
end
|
||||||
|
|
||||||
it "sets the size of sectors from input" do
|
it "sets the size of sectors from input" do
|
||||||
|
|
|
@ -4,6 +4,9 @@ require 'spec_helper'
|
||||||
require 'rex/ole'
|
require 'rex/ole'
|
||||||
|
|
||||||
describe Rex::OLE::MiniFAT do
|
describe Rex::OLE::MiniFAT do
|
||||||
|
before(:each) do
|
||||||
|
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
|
||||||
|
end
|
||||||
|
|
||||||
let(:storage) do
|
let(:storage) do
|
||||||
Rex::OLE::Storage.new
|
Rex::OLE::Storage.new
|
||||||
|
|
|
@ -4,6 +4,9 @@ require 'spec_helper'
|
||||||
require 'rex/ole'
|
require 'rex/ole'
|
||||||
|
|
||||||
describe Rex::OLE::Util do
|
describe Rex::OLE::Util do
|
||||||
|
before(:each) do
|
||||||
|
Rex::OLE::Util.set_endian(Rex::OLE::LITTLE_ENDIAN)
|
||||||
|
end
|
||||||
|
|
||||||
describe ".Hexify32array" do
|
describe ".Hexify32array" do
|
||||||
subject(:hex_array) { described_class.Hexify32array(arr) }
|
subject(:hex_array) { described_class.Hexify32array(arr) }
|
||||||
|
|
Loading…
Reference in New Issue