Skip to content

Commit dbe4f3f

Browse files
committed
Adjust single pack statement, fix up some quotes
* Moved over to using single quotes for strings that don't need escaping or interpolation. * Changed one pack spec to be "more correct". Thankfully, we were only packing 0 so the endianness isn't a problem, however it should be correct, hence the fix.
1 parent 20ad2a8 commit dbe4f3f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/rex/payloads/meterpreter/config.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def to_str(item, size)
3939
end
4040

4141
def to_wchar_t(item, size)
42-
to_ascii(item, size).unpack("C*").pack("v*")
42+
to_ascii(item, size).unpack('C*').pack('v*')
4343
end
4444

4545
def to_ascii(item, size)
@@ -57,7 +57,7 @@ def session_block(opts)
5757
uuid # the UUID
5858
]
5959

60-
session_data.pack("VVVA*")
60+
session_data.pack('VVVA*')
6161
end
6262

6363
def transport_block(opts)
@@ -117,7 +117,7 @@ def extension_block(ext_name, file_extension)
117117
ext, o = load_rdi_dll(MetasploitPayloads.meterpreter_path("ext_server_#{ext_name}",
118118
file_extension))
119119

120-
extension_data = [ ext.length, ext ].pack("VA*")
120+
extension_data = [ ext.length, ext ].pack('VA*')
121121
end
122122

123123
def config_block
@@ -143,9 +143,9 @@ def config_block
143143

144144
# terminate the extensions with a 0 size
145145
if is_x86?
146-
config << [0].pack("V")
146+
config << [0].pack('V')
147147
else
148-
config << [0].pack("Q")
148+
config << [0].pack('Q<')
149149
end
150150

151151
# and we're done

0 commit comments

Comments
 (0)