librex 0.0.42 → 0.0.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/README.markdown +1 -1
  2. data/lib/rex/compat.rb +10 -0
  3. data/lib/rex/post/meterpreter/channels/pools/file.rb +1 -1
  4. data/lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb +20 -18
  5. data/lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb +11 -22
  6. data/lib/rex/post/meterpreter/extensions/stdapi/fs/file_stat.rb +2 -1
  7. data/lib/rex/post/meterpreter/extensions/stdapi/railgun.rb.ts.rb +4 -0
  8. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/api_constants.rb +27 -0
  9. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/api_constants.rb.ut.rb +7 -0
  10. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_advapi32.rb +498 -242
  11. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_iphlpapi.rb +18 -18
  12. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_kernel32.rb +695 -694
  13. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_netapi32.rb +6 -5
  14. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_ntdll.rb +24 -24
  15. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_shell32.rb +5 -4
  16. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_user32.rb +551 -551
  17. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_ws2_32.rb +93 -93
  18. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll.rb +56 -42
  19. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll.rb.ut.rb +4 -4
  20. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_helper.rb.ut.rb +5 -5
  21. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_wrapper.rb +26 -0
  22. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_wrapper.rb.ut.rb +63 -0
  23. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/multicall.rb +4 -4
  24. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/railgun.rb +151 -96
  25. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/railgun.rb.ut.rb +80 -5
  26. data/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb +3 -3
  27. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb +11 -11
  28. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry.rb +3 -3
  29. data/lib/rex/post/meterpreter/packet.rb +12 -11
  30. data/lib/rex/proto/dhcp/server.rb +36 -42
  31. data/lib/rex/socket/range_walker.rb +1 -1
  32. data/lib/rex/text.rb +18 -1
  33. data/lib/rex/ui/text/table.rb +1 -1
  34. metadata +5 -3
@@ -8,11 +8,10 @@ module Def
8
8
 
9
9
  class Def_ws2_32
10
10
 
11
- def self.add_imports(railgun)
12
-
13
- railgun.add_dll('ws2_32')
11
+ def self.create_dll(dll_path = 'ws2_32')
12
+ dll = DLL.new(dll_path, ApiConstants.manager)
14
13
 
15
- railgun.add_function( 'ws2_32', 'WSAAccept', 'DWORD',[
14
+ dll.add_function('WSAAccept', 'DWORD',[
16
15
  ["DWORD","s","in"],
17
16
  ["PBLOB","addr","inout"],
18
17
  ["PDWORD","addrlen","inout"],
@@ -20,7 +19,7 @@ class Def_ws2_32
20
19
  ["PDWORD","dwCallbackData","in"],
21
20
  ])
22
21
 
23
- railgun.add_function( 'ws2_32', 'WSAAddressToStringA', 'DWORD',[
22
+ dll.add_function('WSAAddressToStringA', 'DWORD',[
24
23
  ["PBLOB","lpsaAddress","in"],
25
24
  ["DWORD","dwAddressLength","in"],
26
25
  ["PBLOB","lpProtocolInfo","in"],
@@ -28,7 +27,7 @@ class Def_ws2_32
28
27
  ["PDWORD","lpdwAddressStringLength","inout"],
29
28
  ])
30
29
 
31
- railgun.add_function( 'ws2_32', 'WSAAddressToStringW', 'DWORD',[
30
+ dll.add_function('WSAAddressToStringW', 'DWORD',[
32
31
  ["PBLOB","lpsaAddress","in"],
33
32
  ["DWORD","dwAddressLength","in"],
34
33
  ["PBLOB","lpProtocolInfo","in"],
@@ -36,7 +35,7 @@ class Def_ws2_32
36
35
  ["PDWORD","lpdwAddressStringLength","inout"],
37
36
  ])
38
37
 
39
- railgun.add_function( 'ws2_32', 'WSAAsyncGetHostByAddr', 'DWORD',[
38
+ dll.add_function('WSAAsyncGetHostByAddr', 'DWORD',[
40
39
  ["DWORD","hWnd","in"],
41
40
  ["DWORD","wMsg","in"],
42
41
  ["PCHAR","addr","in"],
@@ -46,7 +45,7 @@ class Def_ws2_32
46
45
  ["DWORD","buflen","in"],
47
46
  ])
48
47
 
49
- railgun.add_function( 'ws2_32', 'WSAAsyncGetHostByName', 'DWORD',[
48
+ dll.add_function('WSAAsyncGetHostByName', 'DWORD',[
50
49
  ["DWORD","hWnd","in"],
51
50
  ["DWORD","wMsg","in"],
52
51
  ["PCHAR","name","in"],
@@ -54,7 +53,7 @@ class Def_ws2_32
54
53
  ["DWORD","buflen","in"],
55
54
  ])
56
55
 
57
- railgun.add_function( 'ws2_32', 'WSAAsyncGetProtoByName', 'DWORD',[
56
+ dll.add_function('WSAAsyncGetProtoByName', 'DWORD',[
58
57
  ["DWORD","hWnd","in"],
59
58
  ["DWORD","wMsg","in"],
60
59
  ["PCHAR","name","in"],
@@ -62,7 +61,7 @@ class Def_ws2_32
62
61
  ["DWORD","buflen","in"],
63
62
  ])
64
63
 
65
- railgun.add_function( 'ws2_32', 'WSAAsyncGetProtoByNumber', 'DWORD',[
64
+ dll.add_function('WSAAsyncGetProtoByNumber', 'DWORD',[
66
65
  ["DWORD","hWnd","in"],
67
66
  ["DWORD","wMsg","in"],
68
67
  ["DWORD","number","in"],
@@ -70,7 +69,7 @@ class Def_ws2_32
70
69
  ["DWORD","buflen","in"],
71
70
  ])
72
71
 
73
- railgun.add_function( 'ws2_32', 'WSAAsyncGetServByName', 'DWORD',[
72
+ dll.add_function('WSAAsyncGetServByName', 'DWORD',[
74
73
  ["DWORD","hWnd","in"],
75
74
  ["DWORD","wMsg","in"],
76
75
  ["PCHAR","name","in"],
@@ -79,7 +78,7 @@ class Def_ws2_32
79
78
  ["DWORD","buflen","in"],
80
79
  ])
81
80
 
82
- railgun.add_function( 'ws2_32', 'WSAAsyncGetServByPort', 'DWORD',[
81
+ dll.add_function('WSAAsyncGetServByPort', 'DWORD',[
83
82
  ["DWORD","hWnd","in"],
84
83
  ["DWORD","wMsg","in"],
85
84
  ["DWORD","port","in"],
@@ -88,28 +87,28 @@ class Def_ws2_32
88
87
  ["DWORD","buflen","in"],
89
88
  ])
90
89
 
91
- railgun.add_function( 'ws2_32', 'WSAAsyncSelect', 'DWORD',[
90
+ dll.add_function('WSAAsyncSelect', 'DWORD',[
92
91
  ["DWORD","s","in"],
93
92
  ["DWORD","hWnd","in"],
94
93
  ["DWORD","wMsg","in"],
95
94
  ["DWORD","lEvent","in"],
96
95
  ])
97
96
 
98
- railgun.add_function( 'ws2_32', 'WSACancelAsyncRequest', 'DWORD',[
97
+ dll.add_function('WSACancelAsyncRequest', 'DWORD',[
99
98
  ["DWORD","hAsyncTaskHandle","in"],
100
99
  ])
101
100
 
102
- railgun.add_function( 'ws2_32', 'WSACancelBlockingCall', 'DWORD',[
101
+ dll.add_function('WSACancelBlockingCall', 'DWORD',[
103
102
  ])
104
103
 
105
- railgun.add_function( 'ws2_32', 'WSACleanup', 'DWORD',[
104
+ dll.add_function('WSACleanup', 'DWORD',[
106
105
  ])
107
106
 
108
- railgun.add_function( 'ws2_32', 'WSACloseEvent', 'BOOL',[
107
+ dll.add_function('WSACloseEvent', 'BOOL',[
109
108
  ["DWORD","hEvent","in"],
110
109
  ])
111
110
 
112
- railgun.add_function( 'ws2_32', 'WSAConnect', 'DWORD',[
111
+ dll.add_function('WSAConnect', 'DWORD',[
113
112
  ["DWORD","s","in"],
114
113
  ["PBLOB","name","in"],
115
114
  ["DWORD","namelen","in"],
@@ -119,59 +118,59 @@ class Def_ws2_32
119
118
  ["PBLOB","lpGQOS","in"],
120
119
  ])
121
120
 
122
- railgun.add_function( 'ws2_32', 'WSACreateEvent', 'DWORD',[
121
+ dll.add_function('WSACreateEvent', 'DWORD',[
123
122
  ])
124
123
 
125
- railgun.add_function( 'ws2_32', 'WSADuplicateSocketA', 'DWORD',[
124
+ dll.add_function('WSADuplicateSocketA', 'DWORD',[
126
125
  ["DWORD","s","in"],
127
126
  ["DWORD","dwProcessId","in"],
128
127
  ["PBLOB","lpProtocolInfo","inout"],
129
128
  ])
130
129
 
131
- railgun.add_function( 'ws2_32', 'WSADuplicateSocketW', 'DWORD',[
130
+ dll.add_function('WSADuplicateSocketW', 'DWORD',[
132
131
  ["DWORD","s","in"],
133
132
  ["DWORD","dwProcessId","in"],
134
133
  ["PBLOB","lpProtocolInfo","inout"],
135
134
  ])
136
135
 
137
- railgun.add_function( 'ws2_32', 'WSAEnumNameSpaceProvidersA', 'DWORD',[
136
+ dll.add_function('WSAEnumNameSpaceProvidersA', 'DWORD',[
138
137
  ["PDWORD","lpdwBufferLength","inout"],
139
138
  ["PBLOB","lpnspBuffer","inout"],
140
139
  ])
141
140
 
142
- railgun.add_function( 'ws2_32', 'WSAEnumNameSpaceProvidersW', 'DWORD',[
141
+ dll.add_function('WSAEnumNameSpaceProvidersW', 'DWORD',[
143
142
  ["PDWORD","lpdwBufferLength","inout"],
144
143
  ["PBLOB","lpnspBuffer","inout"],
145
144
  ])
146
145
 
147
- railgun.add_function( 'ws2_32', 'WSAEnumNetworkEvents', 'DWORD',[
146
+ dll.add_function('WSAEnumNetworkEvents', 'DWORD',[
148
147
  ["DWORD","s","in"],
149
148
  ["DWORD","hEventObject","in"],
150
149
  ["PBLOB","lpNetworkEvents","inout"],
151
150
  ])
152
151
 
153
- railgun.add_function( 'ws2_32', 'WSAEnumProtocolsA', 'DWORD',[
152
+ dll.add_function('WSAEnumProtocolsA', 'DWORD',[
154
153
  ["PDWORD","lpiProtocols","in"],
155
154
  ["PBLOB","lpProtocolBuffer","inout"],
156
155
  ["PDWORD","lpdwBufferLength","inout"],
157
156
  ])
158
157
 
159
- railgun.add_function( 'ws2_32', 'WSAEnumProtocolsW', 'DWORD',[
158
+ dll.add_function('WSAEnumProtocolsW', 'DWORD',[
160
159
  ["PDWORD","lpiProtocols","in"],
161
160
  ["PBLOB","lpProtocolBuffer","inout"],
162
161
  ["PDWORD","lpdwBufferLength","inout"],
163
162
  ])
164
163
 
165
- railgun.add_function( 'ws2_32', 'WSAEventSelect', 'DWORD',[
164
+ dll.add_function('WSAEventSelect', 'DWORD',[
166
165
  ["DWORD","s","in"],
167
166
  ["DWORD","hEventObject","in"],
168
167
  ["DWORD","lNetworkEvents","in"],
169
168
  ])
170
169
 
171
- railgun.add_function( 'ws2_32', 'WSAGetLastError', 'DWORD',[
170
+ dll.add_function('WSAGetLastError', 'DWORD',[
172
171
  ])
173
172
 
174
- railgun.add_function( 'ws2_32', 'WSAGetOverlappedResult', 'BOOL',[
173
+ dll.add_function('WSAGetOverlappedResult', 'BOOL',[
175
174
  ["DWORD","s","in"],
176
175
  ["PBLOB","lpOverlapped","in"],
177
176
  ["PDWORD","lpcbTransfer","inout"],
@@ -179,59 +178,59 @@ class Def_ws2_32
179
178
  ["PDWORD","lpdwFlags","inout"],
180
179
  ])
181
180
 
182
- railgun.add_function( 'ws2_32', 'WSAGetQOSByName', 'BOOL',[
181
+ dll.add_function('WSAGetQOSByName', 'BOOL',[
183
182
  ["DWORD","s","in"],
184
183
  ["PBLOB","lpQOSName","in"],
185
184
  ["PBLOB","lpQOS","inout"],
186
185
  ])
187
186
 
188
- railgun.add_function( 'ws2_32', 'WSAGetServiceClassInfoA', 'DWORD',[
187
+ dll.add_function('WSAGetServiceClassInfoA', 'DWORD',[
189
188
  ["PBLOB","lpProviderId","in"],
190
189
  ["PBLOB","lpServiceClassId","in"],
191
190
  ["PDWORD","lpdwBufSize","inout"],
192
191
  ["PBLOB","lpServiceClassInfo","inout"],
193
192
  ])
194
193
 
195
- railgun.add_function( 'ws2_32', 'WSAGetServiceClassInfoW', 'DWORD',[
194
+ dll.add_function('WSAGetServiceClassInfoW', 'DWORD',[
196
195
  ["PBLOB","lpProviderId","in"],
197
196
  ["PBLOB","lpServiceClassId","in"],
198
197
  ["PDWORD","lpdwBufSize","inout"],
199
198
  ["PBLOB","lpServiceClassInfo","inout"],
200
199
  ])
201
200
 
202
- railgun.add_function( 'ws2_32', 'WSAGetServiceClassNameByClassIdA', 'DWORD',[
201
+ dll.add_function('WSAGetServiceClassNameByClassIdA', 'DWORD',[
203
202
  ["PBLOB","lpServiceClassId","in"],
204
203
  ["PCHAR","lpszServiceClassName","inout"],
205
204
  ["PDWORD","lpdwBufferLength","inout"],
206
205
  ])
207
206
 
208
- railgun.add_function( 'ws2_32', 'WSAGetServiceClassNameByClassIdW', 'DWORD',[
207
+ dll.add_function('WSAGetServiceClassNameByClassIdW', 'DWORD',[
209
208
  ["PBLOB","lpServiceClassId","in"],
210
209
  ["PWCHAR","lpszServiceClassName","inout"],
211
210
  ["PDWORD","lpdwBufferLength","inout"],
212
211
  ])
213
212
 
214
- railgun.add_function( 'ws2_32', 'WSAHtonl', 'DWORD',[
213
+ dll.add_function('WSAHtonl', 'DWORD',[
215
214
  ["DWORD","s","in"],
216
215
  ["DWORD","hostlong","in"],
217
216
  ["PDWORD","lpnetlong","inout"],
218
217
  ])
219
218
 
220
- railgun.add_function( 'ws2_32', 'WSAHtons', 'DWORD',[
219
+ dll.add_function('WSAHtons', 'DWORD',[
221
220
  ["DWORD","s","in"],
222
221
  ["WORD","hostshort","in"],
223
222
  ["PBLOB","lpnetshort","inout"],
224
223
  ])
225
224
 
226
- railgun.add_function( 'ws2_32', 'WSAInstallServiceClassA', 'DWORD',[
225
+ dll.add_function('WSAInstallServiceClassA', 'DWORD',[
227
226
  ["PBLOB","lpServiceClassInfo","in"],
228
227
  ])
229
228
 
230
- railgun.add_function( 'ws2_32', 'WSAInstallServiceClassW', 'DWORD',[
229
+ dll.add_function('WSAInstallServiceClassW', 'DWORD',[
231
230
  ["PBLOB","lpServiceClassInfo","in"],
232
231
  ])
233
232
 
234
- railgun.add_function( 'ws2_32', 'WSAIoctl', 'DWORD',[
233
+ dll.add_function('WSAIoctl', 'DWORD',[
235
234
  ["DWORD","s","in"],
236
235
  ["DWORD","dwIoControlCode","in"],
237
236
  ["PBLOB","lpvInBuffer","in"],
@@ -243,10 +242,10 @@ class Def_ws2_32
243
242
  ["PBLOB","lpCompletionRoutine","in"],
244
243
  ])
245
244
 
246
- railgun.add_function( 'ws2_32', 'WSAIsBlocking', 'BOOL',[
245
+ dll.add_function('WSAIsBlocking', 'BOOL',[
247
246
  ])
248
247
 
249
- railgun.add_function( 'ws2_32', 'WSAJoinLeaf', 'DWORD',[
248
+ dll.add_function('WSAJoinLeaf', 'DWORD',[
250
249
  ["DWORD","s","in"],
251
250
  ["PBLOB","name","in"],
252
251
  ["DWORD","namelen","in"],
@@ -257,37 +256,37 @@ class Def_ws2_32
257
256
  ["DWORD","dwFlags","in"],
258
257
  ])
259
258
 
260
- railgun.add_function( 'ws2_32', 'WSALookupServiceBeginA', 'DWORD',[
259
+ dll.add_function('WSALookupServiceBeginA', 'DWORD',[
261
260
  ["PBLOB","lpqsRestrictions","in"],
262
261
  ["DWORD","dwControlFlags","in"],
263
262
  ["PDWORD","lphLookup","inout"],
264
263
  ])
265
264
 
266
- railgun.add_function( 'ws2_32', 'WSALookupServiceBeginW', 'DWORD',[
265
+ dll.add_function('WSALookupServiceBeginW', 'DWORD',[
267
266
  ["PBLOB","lpqsRestrictions","in"],
268
267
  ["DWORD","dwControlFlags","in"],
269
268
  ["PDWORD","lphLookup","inout"],
270
269
  ])
271
270
 
272
- railgun.add_function( 'ws2_32', 'WSALookupServiceEnd', 'DWORD',[
271
+ dll.add_function('WSALookupServiceEnd', 'DWORD',[
273
272
  ["DWORD","hLookup","in"],
274
273
  ])
275
274
 
276
- railgun.add_function( 'ws2_32', 'WSALookupServiceNextA', 'DWORD',[
275
+ dll.add_function('WSALookupServiceNextA', 'DWORD',[
277
276
  ["DWORD","hLookup","in"],
278
277
  ["DWORD","dwControlFlags","in"],
279
278
  ["PDWORD","lpdwBufferLength","inout"],
280
279
  ["PBLOB","lpqsResults","inout"],
281
280
  ])
282
281
 
283
- railgun.add_function( 'ws2_32', 'WSALookupServiceNextW', 'DWORD',[
282
+ dll.add_function('WSALookupServiceNextW', 'DWORD',[
284
283
  ["DWORD","hLookup","in"],
285
284
  ["DWORD","dwControlFlags","in"],
286
285
  ["PDWORD","lpdwBufferLength","inout"],
287
286
  ["PBLOB","lpqsResults","inout"],
288
287
  ])
289
288
 
290
- railgun.add_function( 'ws2_32', 'WSANSPIoctl', 'DWORD',[
289
+ dll.add_function('WSANSPIoctl', 'DWORD',[
291
290
  ["DWORD","hLookup","in"],
292
291
  ["DWORD","dwControlCode","in"],
293
292
  ["PBLOB","lpvInBuffer","in"],
@@ -298,25 +297,25 @@ class Def_ws2_32
298
297
  ["PBLOB","lpCompletion","in"],
299
298
  ])
300
299
 
301
- railgun.add_function( 'ws2_32', 'WSANtohl', 'DWORD',[
300
+ dll.add_function('WSANtohl', 'DWORD',[
302
301
  ["DWORD","s","in"],
303
302
  ["DWORD","netlong","in"],
304
303
  ["PDWORD","lphostlong","inout"],
305
304
  ])
306
305
 
307
- railgun.add_function( 'ws2_32', 'WSANtohs', 'DWORD',[
306
+ dll.add_function('WSANtohs', 'DWORD',[
308
307
  ["DWORD","s","in"],
309
308
  ["WORD","netshort","in"],
310
309
  ["PBLOB","lphostshort","inout"],
311
310
  ])
312
311
 
313
- railgun.add_function( 'ws2_32', 'WSAProviderConfigChange', 'DWORD',[
312
+ dll.add_function('WSAProviderConfigChange', 'DWORD',[
314
313
  ["PDWORD","lpNotificationHandle","inout"],
315
314
  ["PBLOB","lpOverlapped","in"],
316
315
  ["PBLOB","lpCompletionRoutine","in"],
317
316
  ])
318
317
 
319
- railgun.add_function( 'ws2_32', 'WSARecv', 'DWORD',[
318
+ dll.add_function('WSARecv', 'DWORD',[
320
319
  ["DWORD","s","in"],
321
320
  ["PBLOB","lpBuffers","inout"],
322
321
  ["DWORD","dwBufferCount","in"],
@@ -326,12 +325,12 @@ class Def_ws2_32
326
325
  ["PBLOB","lpCompletionRoutine","in"],
327
326
  ])
328
327
 
329
- railgun.add_function( 'ws2_32', 'WSARecvDisconnect', 'DWORD',[
328
+ dll.add_function('WSARecvDisconnect', 'DWORD',[
330
329
  ["DWORD","s","in"],
331
330
  ["PBLOB","lpInboundDisconnectData","inout"],
332
331
  ])
333
332
 
334
- railgun.add_function( 'ws2_32', 'WSARecvFrom', 'DWORD',[
333
+ dll.add_function('WSARecvFrom', 'DWORD',[
335
334
  ["DWORD","s","in"],
336
335
  ["PBLOB","lpBuffers","inout"],
337
336
  ["DWORD","dwBufferCount","in"],
@@ -343,15 +342,15 @@ class Def_ws2_32
343
342
  ["PBLOB","lpCompletionRoutine","in"],
344
343
  ])
345
344
 
346
- railgun.add_function( 'ws2_32', 'WSARemoveServiceClass', 'DWORD',[
345
+ dll.add_function('WSARemoveServiceClass', 'DWORD',[
347
346
  ["PBLOB","lpServiceClassId","in"],
348
347
  ])
349
348
 
350
- railgun.add_function( 'ws2_32', 'WSAResetEvent', 'BOOL',[
349
+ dll.add_function('WSAResetEvent', 'BOOL',[
351
350
  ["DWORD","hEvent","in"],
352
351
  ])
353
352
 
354
- railgun.add_function( 'ws2_32', 'WSASend', 'DWORD',[
353
+ dll.add_function('WSASend', 'DWORD',[
355
354
  ["DWORD","s","in"],
356
355
  ["PBLOB","lpBuffers","in"],
357
356
  ["DWORD","dwBufferCount","in"],
@@ -361,12 +360,12 @@ class Def_ws2_32
361
360
  ["PBLOB","lpCompletionRoutine","in"],
362
361
  ])
363
362
 
364
- railgun.add_function( 'ws2_32', 'WSASendDisconnect', 'DWORD',[
363
+ dll.add_function('WSASendDisconnect', 'DWORD',[
365
364
  ["DWORD","s","in"],
366
365
  ["PBLOB","lpOutboundDisconnectData","in"],
367
366
  ])
368
367
 
369
- railgun.add_function( 'ws2_32', 'WSASendTo', 'DWORD',[
368
+ dll.add_function('WSASendTo', 'DWORD',[
370
369
  ["DWORD","s","in"],
371
370
  ["PBLOB","lpBuffers","in"],
372
371
  ["DWORD","dwBufferCount","in"],
@@ -378,27 +377,27 @@ class Def_ws2_32
378
377
  ["PBLOB","lpCompletionRoutine","in"],
379
378
  ])
380
379
 
381
- railgun.add_function( 'ws2_32', 'WSASetEvent', 'BOOL',[
380
+ dll.add_function('WSASetEvent', 'BOOL',[
382
381
  ["DWORD","hEvent","in"],
383
382
  ])
384
383
 
385
- railgun.add_function( 'ws2_32', 'WSASetLastError', 'VOID',[
384
+ dll.add_function('WSASetLastError', 'VOID',[
386
385
  ["DWORD","iError","in"],
387
386
  ])
388
387
 
389
- railgun.add_function( 'ws2_32', 'WSASetServiceA', 'DWORD',[
388
+ dll.add_function('WSASetServiceA', 'DWORD',[
390
389
  ["PBLOB","lpqsRegInfo","in"],
391
390
  ["PBLOB","essoperation","in"],
392
391
  ["DWORD","dwControlFlags","in"],
393
392
  ])
394
393
 
395
- railgun.add_function( 'ws2_32', 'WSASetServiceW', 'DWORD',[
394
+ dll.add_function('WSASetServiceW', 'DWORD',[
396
395
  ["PBLOB","lpqsRegInfo","in"],
397
396
  ["PBLOB","essoperation","in"],
398
397
  ["DWORD","dwControlFlags","in"],
399
398
  ])
400
399
 
401
- railgun.add_function( 'ws2_32', 'WSASocketA', 'DWORD',[
400
+ dll.add_function('WSASocketA', 'DWORD',[
402
401
  ["DWORD","af","in"],
403
402
  ["DWORD","type","in"],
404
403
  ["DWORD","protocol","in"],
@@ -407,7 +406,7 @@ class Def_ws2_32
407
406
  ["DWORD","dwFlags","in"],
408
407
  ])
409
408
 
410
- railgun.add_function( 'ws2_32', 'WSASocketW', 'DWORD',[
409
+ dll.add_function('WSASocketW', 'DWORD',[
411
410
  ["DWORD","af","in"],
412
411
  ["DWORD","type","in"],
413
412
  ["DWORD","protocol","in"],
@@ -416,12 +415,12 @@ class Def_ws2_32
416
415
  ["DWORD","dwFlags","in"],
417
416
  ])
418
417
 
419
- railgun.add_function( 'ws2_32', 'WSAStartup', 'DWORD',[
418
+ dll.add_function('WSAStartup', 'DWORD',[
420
419
  ["WORD","wVersionRequested","in"],
421
420
  ["PBLOB","lpWSAData","inout"],
422
421
  ])
423
422
 
424
- railgun.add_function( 'ws2_32', 'WSAStringToAddressA', 'DWORD',[
423
+ dll.add_function('WSAStringToAddressA', 'DWORD',[
425
424
  ["PCHAR","AddressString","in"],
426
425
  ["DWORD","AddressFamily","in"],
427
426
  ["PBLOB","lpProtocolInfo","in"],
@@ -429,7 +428,7 @@ class Def_ws2_32
429
428
  ["PDWORD","lpAddressLength","inout"],
430
429
  ])
431
430
 
432
- railgun.add_function( 'ws2_32', 'WSAStringToAddressW', 'DWORD',[
431
+ dll.add_function('WSAStringToAddressW', 'DWORD',[
433
432
  ["PWCHAR","AddressString","in"],
434
433
  ["DWORD","AddressFamily","in"],
435
434
  ["PBLOB","lpProtocolInfo","in"],
@@ -437,10 +436,10 @@ class Def_ws2_32
437
436
  ["PDWORD","lpAddressLength","inout"],
438
437
  ])
439
438
 
440
- railgun.add_function( 'ws2_32', 'WSAUnhookBlockingHook', 'DWORD',[
439
+ dll.add_function('WSAUnhookBlockingHook', 'DWORD',[
441
440
  ])
442
441
 
443
- railgun.add_function( 'ws2_32', 'WSAWaitForMultipleEvents', 'DWORD',[
442
+ dll.add_function('WSAWaitForMultipleEvents', 'DWORD',[
444
443
  ["DWORD","cEvents","in"],
445
444
  ["PDWORD","lphEvents","in"],
446
445
  ["BOOL","fWaitAll","in"],
@@ -448,51 +447,51 @@ class Def_ws2_32
448
447
  ["BOOL","fAlertable","in"],
449
448
  ])
450
449
 
451
- railgun.add_function( 'ws2_32', '__WSAFDIsSet', 'DWORD',[
450
+ dll.add_function('__WSAFDIsSet', 'DWORD',[
452
451
  ["DWORD","param0","in"],
453
452
  ["PBLOB","param1","inout"],
454
453
  ])
455
454
 
456
- railgun.add_function( 'ws2_32', 'accept', 'DWORD',[
455
+ dll.add_function('accept', 'DWORD',[
457
456
  ["DWORD","s","in"],
458
457
  ["PBLOB","addr","inout"],
459
458
  ["PDWORD","addrlen","inout"],
460
459
  ])
461
460
 
462
- railgun.add_function( 'ws2_32', 'bind', 'DWORD',[
461
+ dll.add_function('bind', 'DWORD',[
463
462
  ["DWORD","s","in"],
464
463
  ["PBLOB","name","in"],
465
464
  ["DWORD","namelen","in"],
466
465
  ])
467
466
 
468
- railgun.add_function( 'ws2_32', 'closesocket', 'DWORD',[
467
+ dll.add_function('closesocket', 'DWORD',[
469
468
  ["DWORD","s","in"],
470
469
  ])
471
470
 
472
- railgun.add_function( 'ws2_32', 'connect', 'DWORD',[
471
+ dll.add_function('connect', 'DWORD',[
473
472
  ["DWORD","s","in"],
474
473
  ["PBLOB","name","in"],
475
474
  ["DWORD","namelen","in"],
476
475
  ])
477
476
 
478
- railgun.add_function( 'ws2_32', 'gethostname', 'DWORD',[
477
+ dll.add_function('gethostname', 'DWORD',[
479
478
  ["PCHAR","name","inout"],
480
479
  ["DWORD","namelen","in"],
481
480
  ])
482
481
 
483
- railgun.add_function( 'ws2_32', 'getpeername', 'DWORD',[
482
+ dll.add_function('getpeername', 'DWORD',[
484
483
  ["DWORD","s","in"],
485
484
  ["PBLOB","name","inout"],
486
485
  ["PDWORD","namelen","inout"],
487
486
  ])
488
487
 
489
- railgun.add_function( 'ws2_32', 'getsockname', 'DWORD',[
488
+ dll.add_function('getsockname', 'DWORD',[
490
489
  ["DWORD","s","in"],
491
490
  ["PBLOB","name","inout"],
492
491
  ["PDWORD","namelen","inout"],
493
492
  ])
494
493
 
495
- railgun.add_function( 'ws2_32', 'getsockopt', 'DWORD',[
494
+ dll.add_function('getsockopt', 'DWORD',[
496
495
  ["DWORD","s","in"],
497
496
  ["DWORD","level","in"],
498
497
  ["DWORD","optname","in"],
@@ -500,45 +499,45 @@ class Def_ws2_32
500
499
  ["PDWORD","optlen","inout"],
501
500
  ])
502
501
 
503
- railgun.add_function( 'ws2_32', 'htonl', 'DWORD',[
502
+ dll.add_function('htonl', 'DWORD',[
504
503
  ["DWORD","hostlong","in"],
505
504
  ])
506
505
 
507
- railgun.add_function( 'ws2_32', 'htons', 'WORD',[
506
+ dll.add_function('htons', 'WORD',[
508
507
  ["WORD","hostshort","in"],
509
508
  ])
510
509
 
511
- railgun.add_function( 'ws2_32', 'inet_addr', 'DWORD',[
510
+ dll.add_function('inet_addr', 'DWORD',[
512
511
  ["PCHAR","cp","in"],
513
512
  ])
514
513
 
515
- railgun.add_function( 'ws2_32', 'ioctlsocket', 'DWORD',[
514
+ dll.add_function('ioctlsocket', 'DWORD',[
516
515
  ["DWORD","s","in"],
517
516
  ["DWORD","cmd","in"],
518
517
  ["PDWORD","argp","inout"],
519
518
  ])
520
519
 
521
- railgun.add_function( 'ws2_32', 'listen', 'DWORD',[
520
+ dll.add_function('listen', 'DWORD',[
522
521
  ["DWORD","s","in"],
523
522
  ["DWORD","backlog","in"],
524
523
  ])
525
524
 
526
- railgun.add_function( 'ws2_32', 'ntohl', 'DWORD',[
525
+ dll.add_function('ntohl', 'DWORD',[
527
526
  ["DWORD","netlong","in"],
528
527
  ])
529
528
 
530
- railgun.add_function( 'ws2_32', 'ntohs', 'WORD',[
529
+ dll.add_function('ntohs', 'WORD',[
531
530
  ["WORD","netshort","in"],
532
531
  ])
533
532
 
534
- railgun.add_function( 'ws2_32', 'recv', 'DWORD',[
533
+ dll.add_function('recv', 'DWORD',[
535
534
  ["DWORD","s","in"],
536
535
  ["PCHAR","buf","inout"],
537
536
  ["DWORD","len","in"],
538
537
  ["DWORD","flags","in"],
539
538
  ])
540
539
 
541
- railgun.add_function( 'ws2_32', 'recvfrom', 'DWORD',[
540
+ dll.add_function('recvfrom', 'DWORD',[
542
541
  ["DWORD","s","in"],
543
542
  ["PCHAR","buf","inout"],
544
543
  ["DWORD","len","in"],
@@ -547,7 +546,7 @@ class Def_ws2_32
547
546
  ["PDWORD","fromlen","inout"],
548
547
  ])
549
548
 
550
- railgun.add_function( 'ws2_32', 'select', 'DWORD',[
549
+ dll.add_function('select', 'DWORD',[
551
550
  ["DWORD","nfds","in"],
552
551
  ["PBLOB","readfds","inout"],
553
552
  ["PBLOB","writefds","inout"],
@@ -555,14 +554,14 @@ class Def_ws2_32
555
554
  ["PDWORD","timeout","in"],
556
555
  ])
557
556
 
558
- railgun.add_function( 'ws2_32', 'send', 'DWORD',[
557
+ dll.add_function('send', 'DWORD',[
559
558
  ["DWORD","s","in"],
560
559
  ["PCHAR","buf","in"],
561
560
  ["DWORD","len","in"],
562
561
  ["DWORD","flags","in"],
563
562
  ])
564
563
 
565
- railgun.add_function( 'ws2_32', 'sendto', 'DWORD',[
564
+ dll.add_function('sendto', 'DWORD',[
566
565
  ["DWORD","s","in"],
567
566
  ["PCHAR","buf","in"],
568
567
  ["DWORD","len","in"],
@@ -571,7 +570,7 @@ class Def_ws2_32
571
570
  ["DWORD","tolen","in"],
572
571
  ])
573
572
 
574
- railgun.add_function( 'ws2_32', 'setsockopt', 'DWORD',[
573
+ dll.add_function('setsockopt', 'DWORD',[
575
574
  ["DWORD","s","in"],
576
575
  ["DWORD","level","in"],
577
576
  ["DWORD","optname","in"],
@@ -579,17 +578,18 @@ class Def_ws2_32
579
578
  ["DWORD","optlen","in"],
580
579
  ])
581
580
 
582
- railgun.add_function( 'ws2_32', 'shutdown', 'DWORD',[
581
+ dll.add_function('shutdown', 'DWORD',[
583
582
  ["DWORD","s","in"],
584
583
  ["DWORD","how","in"],
585
584
  ])
586
585
 
587
- railgun.add_function( 'ws2_32', 'socket', 'DWORD',[
586
+ dll.add_function('socket', 'DWORD',[
588
587
  ["DWORD","af","in"],
589
588
  ["DWORD","type","in"],
590
589
  ["DWORD","protocol","in"],
591
590
  ])
592
591
 
592
+ return dll
593
593
  end
594
594
 
595
595
  end