Skip to content

Commit 4fecae0

Browse files
committed
Q (native) to Q< (le)
1 parent b95a5eb commit 4fecae0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/rex/post/meterpreter/extensions/stdapi/railgun/dll.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def process_function_call(function, args, client)
120120
raise "#{function.params.length} arguments expected. #{args.length} arguments provided." unless args.length == function.params.length
121121

122122
if( client.platform =~ /x64/i )
123-
native = 'Q'
123+
native = 'Q<'
124124
else
125125
native = 'V'
126126
end
@@ -153,12 +153,12 @@ def process_function_call(function, args, client)
153153
buffer_size = args[param_idx]
154154
if param_desc[0] == "PDWORD"
155155
# bump up the size for an x64 pointer
156-
if( native == 'Q' and buffer_size == 4 )
156+
if( native == 'Q<' and buffer_size == 4 )
157157
args[param_idx] = 8
158158
buffer_size = args[param_idx]
159159
end
160160

161-
if( native == 'Q' )
161+
if( native == 'Q<' )
162162
raise "Please pass 8 for 'out' PDWORDS, since they require a buffer of size 8" unless buffer_size == 8
163163
elsif( native == 'V' )
164164
raise "Please pass 4 for 'out' PDWORDS, since they require a buffer of size 4" unless buffer_size == 4
@@ -288,7 +288,7 @@ def process_function_call(function, args, client)
288288
#process return value
289289
case function.return_type
290290
when "LPVOID", "HANDLE"
291-
if( native == 'Q' )
291+
if( native == 'Q<' )
292292
return_hash["return"] = rec_return_value
293293
else
294294
return_hash["return"] = rec_return_value % 4294967296

lib/rex/post/meterpreter/extensions/stdapi/railgun/multicall.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def initialize( client, parent, win_consts )
5050
@win_consts = win_consts
5151

5252
if( @client.platform =~ /x64/i )
53-
@native = 'Q'
53+
@native = 'Q<'
5454
else
5555
@native = 'V'
5656
end
@@ -102,12 +102,12 @@ def call(functions)
102102
raise "error in param #{param_desc[1]}: Out-only buffers must be described by a number indicating their size in bytes " unless args[param_idx].class == Fixnum
103103
buffer_size = args[param_idx]
104104
# bump up the size for an x64 pointer
105-
if( @native == 'Q' and buffer_size == 4 )
105+
if( @native == 'Q<' and buffer_size == 4 )
106106
args[param_idx] = 8
107107
buffer_size = args[param_idx]
108108
end
109109

110-
if( @native == 'Q' )
110+
if( @native == 'Q<' )
111111
raise "Please pass 8 for 'out' PDWORDS, since they require a buffer of size 8" unless buffer_size == 8
112112
elsif( @native == 'V' )
113113
raise "Please pass 4 for 'out' PDWORDS, since they require a buffer of size 4" unless buffer_size == 4
@@ -242,7 +242,7 @@ def call(functions)
242242
#process return value
243243
case function.return_type
244244
when "LPVOID", "HANDLE"
245-
if( @native == 'Q' )
245+
if( @native == 'Q<' )
246246
return_hash["return"] = rec_return_value
247247
else
248248
return_hash["return"] = rec_return_value % 4294967296

0 commit comments

Comments
 (0)