From 9391e11202a39848bea320c2127ee8484571ab07 Mon Sep 17 00:00:00 2001 From: upsidedwn Date: Sat, 27 Jan 2024 00:01:03 +0800 Subject: [PATCH] Fix typo in alloc_and_write_wstring calling non-existent method `str_to_uniz_a` does not exist, updated to `str_to_uni_z`. Looking at cross-references, only two modules use this method to convert from ruby strings to null-terminated WCHARs. Updated the comments to clarify usage of this method and fixed the typo. --- lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb b/lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb index c04da82a4234..fb29a1ea8774 100644 --- a/lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb +++ b/lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb @@ -401,13 +401,12 @@ def read_wstring(pointer, length = nil) # # Write Unicode strings to memory. # - # Given a Unicode string, returns a pointer to a null terminated WCHARs array. - # InitializeUnicodeStr(&uStr, sL"string"); + # Given a string, returns a pointer to a null terminated WCHARs array. # def alloc_and_write_wstring(value) return nil if value.nil? - alloc_and_write_data(str_to_uniz_a(value)) + alloc_and_write_data(str_to_uni_z(value)) end alias free_wstring free_data