File tree Expand file tree Collapse file tree 6 files changed +20
-3
lines changed Expand file tree Collapse file tree 6 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 4
4
require 'rex/ole'
5
5
6
6
describe Rex ::OLE ::CLSID do
7
+ before ( :each ) do
8
+ Rex ::OLE ::Util . set_endian ( Rex ::OLE ::LITTLE_ENDIAN )
9
+ end
7
10
8
11
let ( :sample_clsid ) { "\x00 \x11 \x22 \x33 \x44 \x55 \x66 \x77 \x88 \x99 \xaa \xbb \xcc \xdd \xee \xff " }
9
12
35
38
36
39
describe "#to_s" do
37
40
it "returns printable clsid" do
38
- Rex ::OLE ::Util . set_endian ( Rex ::OLE ::LITTLE_ENDIAN )
39
41
expect ( clsid . to_s ) . to eq ( '33221100-5544-7766-8899-aabbccddeeff' )
40
42
end
41
43
Original file line number Diff line number Diff line change 4
4
require 'rex/ole'
5
5
6
6
describe Rex ::OLE ::DIFAT do
7
+ before ( :each ) do
8
+ Rex ::OLE ::Util . set_endian ( Rex ::OLE ::LITTLE_ENDIAN )
9
+ end
7
10
8
11
let ( :storage ) do
9
12
Rex ::OLE ::Storage . new
Original file line number Diff line number Diff line change 4
4
require 'rex/ole'
5
5
6
6
describe Rex ::OLE ::DirEntry do
7
+ before ( :each ) do
8
+ Rex ::OLE ::Util . set_endian ( Rex ::OLE ::LITTLE_ENDIAN )
9
+ end
7
10
8
11
let ( :storage ) do
9
12
Rex ::OLE ::Storage . new
Original file line number Diff line number Diff line change 4
4
require 'rex/ole'
5
5
6
6
describe Rex ::OLE ::Header do
7
+ before ( :each ) do
8
+ Rex ::OLE ::Util . set_endian ( Rex ::OLE ::LITTLE_ENDIAN )
9
+ end
7
10
8
11
subject ( :header ) do
9
12
described_class . new
240
243
hdr << 'A' * 16 # @_clid
241
244
hdr << 'BB' # @_uMinorVersion
242
245
hdr << 'CC' # @_uMajorVersion
243
- hdr << 'DD' # @_uByteOrder
246
+ hdr << " \xfe \xff " # @_uByteOrder
244
247
hdr << 'EE' # @_uSectorShift
245
248
hdr << 'FF' # @_uMiniSectorShift
246
249
hdr << '123456' # padding
275
278
276
279
it "sets byte order from input" do
277
280
header . read ( correct_fd )
278
- expect ( header . instance_variable_get ( :@_uByteOrder ) ) . to eq ( 0x4444 )
281
+ expect ( header . instance_variable_get ( :@_uByteOrder ) ) . to eq ( Rex :: OLE :: LITTLE_ENDIAN )
279
282
end
280
283
281
284
it "sets the size of sectors from input" do
Original file line number Diff line number Diff line change 4
4
require 'rex/ole'
5
5
6
6
describe Rex ::OLE ::MiniFAT do
7
+ before ( :each ) do
8
+ Rex ::OLE ::Util . set_endian ( Rex ::OLE ::LITTLE_ENDIAN )
9
+ end
7
10
8
11
let ( :storage ) do
9
12
Rex ::OLE ::Storage . new
Original file line number Diff line number Diff line change 4
4
require 'rex/ole'
5
5
6
6
describe Rex ::OLE ::Util do
7
+ before ( :each ) do
8
+ Rex ::OLE ::Util . set_endian ( Rex ::OLE ::LITTLE_ENDIAN )
9
+ end
7
10
8
11
describe ".Hexify32array" do
9
12
subject ( :hex_array ) { described_class . Hexify32array ( arr ) }
You can’t perform that action at this time.
0 commit comments