rex-ole 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rex/ole/directory.rb +4 -6
- data/lib/rex/ole/storage.rb +10 -10
- data/lib/rex/ole/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beb7b3024bd0d9479efc9e3f31d7ef8d89a9e3a7
|
4
|
+
data.tar.gz: 0d69d7cd4fd7058379a490c7db52e077efd3710f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351da48d0716cb5537a5787bdd2958e03d40715c5836d71459e1c881e0725ae05c2a9094ba8a91eeafd0a2167007ffbd00267793122fa8839a8c6a4517ee5155
|
7
|
+
data.tar.gz: f56ccb022ecf49cfcb0a3550dc46e908f1e51c76e4903da0b60d853d7277e1b4c0168314fa3f726813cad9a381542a6e2d6959789449f68f167b974ca1ee0cf3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rex/ole/directory.rb
CHANGED
@@ -51,20 +51,20 @@ class Directory < DirEntry
|
|
51
51
|
# link item to siblings and/or parent
|
52
52
|
if (parent._sidChild == DIR_NOSTREAM)
|
53
53
|
parent._sidChild = child.sid
|
54
|
-
|
54
|
+
# Linking 'child' as THE child of 'parent', sid is child.sid...
|
55
55
|
else
|
56
56
|
sib = nil
|
57
57
|
parent.each { |el|
|
58
58
|
if (el._sidLeftSib == DIR_NOSTREAM)
|
59
59
|
sib = el
|
60
60
|
el._sidLeftSib = child.sid
|
61
|
-
|
61
|
+
# Linking 'child' as the LEFT sibling of 'sib', sid is child.sid...
|
62
62
|
break
|
63
63
|
end
|
64
64
|
if (el._sidRightSib == DIR_NOSTREAM)
|
65
65
|
sib = el
|
66
66
|
el._sidRightSib = child.sid
|
67
|
-
|
67
|
+
# Linking 'child' as the RIGHT sibling of 'sib', sid is child.sid...
|
68
68
|
break
|
69
69
|
end
|
70
70
|
}
|
@@ -152,7 +152,6 @@ class Directory < DirEntry
|
|
152
152
|
# recursively add entries to their proper parents :)
|
153
153
|
def populate_children(entries, parent, sid)
|
154
154
|
node = entries[sid]
|
155
|
-
dlog("populate_children(entries, \"#{parent.name}\", #{sid}) - node: #{node.name}", 'rex', LEV_3)
|
156
155
|
parent << node
|
157
156
|
if (node.type == STGTY_STORAGE) and (node._sidChild != DIR_NOSTREAM)
|
158
157
|
populate_children(entries, node, node._sidChild)
|
@@ -178,7 +177,6 @@ class Directory < DirEntry
|
|
178
177
|
# flatten the directory again
|
179
178
|
entries = []
|
180
179
|
flatten_tree(entries, self)
|
181
|
-
dlog("flattened tree has #{entries.length} entries...", 'rex', LEV_3)
|
182
180
|
|
183
181
|
# count directory sectors
|
184
182
|
ds_count = entries.length / 4
|
@@ -198,7 +196,7 @@ class Directory < DirEntry
|
|
198
196
|
next if (de.type == STGTY_ROOT)
|
199
197
|
|
200
198
|
dir = de.pack
|
201
|
-
|
199
|
+
# Writing dir entry de...
|
202
200
|
sbuf << dir
|
203
201
|
|
204
202
|
if (sbuf.length == @stg.header.sector_size)
|
data/lib/rex/ole/storage.rb
CHANGED
@@ -126,7 +126,7 @@ class Storage
|
|
126
126
|
stm = Stream.new self
|
127
127
|
stm.name = name
|
128
128
|
parent_stg ||= @directory
|
129
|
-
|
129
|
+
# Adding stream 'name' to storage parent_stg...
|
130
130
|
@directory.link_item(parent_stg, stm)
|
131
131
|
@modified = true
|
132
132
|
stm
|
@@ -150,7 +150,7 @@ class Storage
|
|
150
150
|
stg = SubStorage.new self
|
151
151
|
stg.name = name
|
152
152
|
parent_stg ||= @directory
|
153
|
-
|
153
|
+
# Adding storage 'name' to storage parent_stg...
|
154
154
|
@directory.link_item(parent_stg, stg)
|
155
155
|
stg
|
156
156
|
end
|
@@ -209,7 +209,7 @@ class Storage
|
|
209
209
|
end
|
210
210
|
|
211
211
|
def write_sector_raw(sect, sbuf)
|
212
|
-
|
212
|
+
# Writing sector 'sect'...
|
213
213
|
@fd.seek((sect + 1) * @header.sector_size, ::IO::SEEK_SET)
|
214
214
|
@fd.write(sbuf)
|
215
215
|
end
|
@@ -236,7 +236,7 @@ class Storage
|
|
236
236
|
end
|
237
237
|
|
238
238
|
def write_mini_sector_raw(sect, sbuf)
|
239
|
-
|
239
|
+
# Writing mini sector 'sect'...
|
240
240
|
@ministream << sbuf
|
241
241
|
end
|
242
242
|
|
@@ -257,7 +257,7 @@ class Storage
|
|
257
257
|
end
|
258
258
|
|
259
259
|
def write_stream(stm)
|
260
|
-
|
260
|
+
# Writing 'stm.name' to regular stream...
|
261
261
|
stm_start = nil
|
262
262
|
prev_sect = nil
|
263
263
|
stm.seek(0)
|
@@ -270,7 +270,7 @@ class Storage
|
|
270
270
|
end
|
271
271
|
|
272
272
|
def write_mini_stream(stm)
|
273
|
-
|
273
|
+
# Writing 'stm.name' to mini stream...
|
274
274
|
prev_sect = nil
|
275
275
|
stm.seek(0)
|
276
276
|
while (sbuf = stm.read(@header.mini_sector_size))
|
@@ -306,7 +306,7 @@ class Storage
|
|
306
306
|
block = left if (block > left)
|
307
307
|
|
308
308
|
# read it.
|
309
|
-
|
309
|
+
# Reading 'block' number of bytes...
|
310
310
|
buf = read_sector(sect, block)
|
311
311
|
ret << buf
|
312
312
|
left -= buf.length
|
@@ -335,7 +335,7 @@ class Storage
|
|
335
335
|
block = left if (block > left)
|
336
336
|
|
337
337
|
# read it.
|
338
|
-
|
338
|
+
# Reading 'block' number of bytes...
|
339
339
|
buf = read_mini_sector(sect, block)
|
340
340
|
ret << buf
|
341
341
|
left -= buf.length
|
@@ -373,9 +373,9 @@ class Storage
|
|
373
373
|
|
374
374
|
|
375
375
|
def read_mini_sector(sect, len)
|
376
|
-
|
376
|
+
# Reading mini sector 'sect'...
|
377
377
|
off = (@header.mini_sector_size * sect)
|
378
|
-
|
378
|
+
# Reading from offset 'off' of ministream...
|
379
379
|
@ministream.seek(off)
|
380
380
|
data = @ministream.read(len)
|
381
381
|
data
|
data/lib/rex/ole/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rex-ole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pearce Barry
|
@@ -85,7 +85,7 @@ cert_chain:
|
|
85
85
|
2SpuQH+SWteq3NXkAmFEEqvLJQ4sbptZt8OP8ghL3pVAvZNFmww/YVszSkShSzcg
|
86
86
|
QdihYCSEL2drS2cFd50jBeq71sxUtxbv82DUa2b+
|
87
87
|
-----END CERTIFICATE-----
|
88
|
-
date: 2016-07-
|
88
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
89
89
|
dependencies:
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
91
|
name: bundler
|
metadata.gz.sig
CHANGED
Binary file
|