This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this code will work only when compiled as 64-bit code, and on Windows 10 | |
// older Windows version might require different structure definitions | |
#define NOMINMAX | |
#define INITGUID | |
#include <windows.h> | |
#include <evntrace.h> | |
#include <evntcons.h> | |
#pragma comment (lib, "shell32.lib") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Send-UdpDatagram | |
{ | |
Param ([string] $EndPoint, | |
[int] $Port, | |
[string] $Message) | |
$IP = [System.Net.Dns]::GetHostAddresses($EndPoint) | |
$Address = [System.Net.IPAddress]::Parse($IP) | |
$EndPoints = New-Object System.Net.IPEndPoint($Address, $Port) | |
$Socket = New-Object System.Net.Sockets.UDPClient |