[ C Code and Tool ] Wake On LAN
Heres a simple Wake-on-LAN application for use in system administration.
As the name implies it causes a correctly set-up computer to boot up remotely when instructed to do so.
This happens when the application sends a repetition of six 0xFF followed by 16 repetitions of the Targets MAC ADDRESS, represented here as AA:BB:CC:DD:EE:FF, and as is displayed in the final created packet below. The highlighted section of six 0xFF’s is known as the Magic Packet.
This packet is sent over UDP to the broadcast address of 255.255.255.255.
To quote wikipedia: “Wake-on-LAN support is implemented on the motherboard of a computer and the network interface (firmware), and is consequently not dependent on the operating system running on the hardware.”.
The code makes use of the winsock sendto function which enables a packet to be sent to a port/host which is not connected.