mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-24 18:16:24 +01:00
commit
4ba1d16acc
@ -459,11 +459,15 @@ static void set_value(Remote *remote, Packet *packet, HKEY hkey)
|
|||||||
} else {
|
} else {
|
||||||
// Now let's rock this shit!
|
// Now let's rock this shit!
|
||||||
void *buf;
|
void *buf;
|
||||||
size_t len = valueData.header.length;
|
size_t len;
|
||||||
if (valueType == REG_SZ) {
|
switch (valueType) {
|
||||||
|
case REG_SZ:
|
||||||
|
case REG_EXPAND_SZ:
|
||||||
buf = utf8_to_wchar(valueData.buffer);
|
buf = utf8_to_wchar(valueData.buffer);
|
||||||
len = (wcslen(buf) + 1) * sizeof(wchar_t);
|
len = (wcslen(buf) + 1) * sizeof(wchar_t);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
|
len = valueData.header.length;
|
||||||
buf = valueData.buffer;
|
buf = valueData.buffer;
|
||||||
}
|
}
|
||||||
result = RegSetValueExW(hkey, valueName, 0, valueType, buf, (DWORD)len);
|
result = RegSetValueExW(hkey, valueName, 0, valueType, buf, (DWORD)len);
|
||||||
@ -561,6 +565,7 @@ static void query_value(Remote *remote, Packet *packet, HKEY hkey)
|
|||||||
|
|
||||||
switch (valueType) {
|
switch (valueType) {
|
||||||
case REG_SZ:
|
case REG_SZ:
|
||||||
|
case REG_EXPAND_SZ:
|
||||||
tmp = wchar_to_utf8((wchar_t *)valueData);
|
tmp = wchar_to_utf8((wchar_t *)valueData);
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
packet_add_tlv_string(response, TLV_TYPE_VALUE_DATA, tmp);
|
packet_add_tlv_string(response, TLV_TYPE_VALUE_DATA, tmp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user