We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 879db5c commit 9a81cc7Copy full SHA for 9a81cc7
lib/rex/post/meterpreter/extensions/stdapi/railgun/library_helper.rb
@@ -53,14 +53,14 @@ def asciiz_to_str(asciiz)
53
54
# converts ruby string to zero-terminated WCHAR string
55
def str_to_uni_z(str)
56
- enc = str.unpack("C*").pack("v*")
+ enc = str.encode('UTF-16LE').force_encoding('binary')
57
enc += "\x00\x00"
58
return enc
59
end
60
61
# converts 0-terminated UTF16 to ruby string
62
def uniz_to_str(uniz)
63
- uniz.unpack("v*").pack("C*").unpack("A*")[0]
+ uniz.force_encoding('UTF-16LE').encode('UTF-8')
64
65
66
# parses a number param and returns the value
0 commit comments