1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-05 14:57:30 +01:00

Railgun DWORD handling

This commit is contained in:
Meatballs 2014-12-23 10:44:29 +00:00
parent d4707b8e07
commit 02864b4401

View File

@ -318,7 +318,10 @@ class DLL
buffer = rec_out_only_buffers[buffer_item.addr, buffer_item.length_in_bytes]
case buffer_item.datatype
when "PDWORD"
return_hash[param_name] = buffer.unpack(native)[0]
# PDWORD is treated as a POINTER
return_hash[param_name] = buffer.unpack(native).first
# If PDWORD is treated correctly as a DWORD
return_hash[param_name] = buffer.unpack('V').first if return_hash[param_name].nil?
when "PCHAR"
return_hash[param_name] = asciiz_to_str(buffer)
when "PWCHAR"
@ -338,7 +341,10 @@ class DLL
buffer = rec_inout_buffers[buffer_item.addr, buffer_item.length_in_bytes]
case buffer_item.datatype
when "PDWORD"
return_hash[param_name] = buffer.unpack(native)[0]
# PDWORD is treated as a POINTER
return_hash[param_name] = buffer.unpack(native).first
# If PDWORD is treated correctly as a DWORD
return_hash[param_name] = buffer.unpack('V').first if return_hash[param_name].nil?
when "PCHAR"
return_hash[param_name] = asciiz_to_str(buffer)
when "PWCHAR"