asmdemon
Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
|
I needed a way to wakeup a computer on my network. Poured over many sources and wrote this program(mainly most examples are very bloated). Still working on ability to import from command line, or write a GUI for it. Even still, here it is for your use and enjoyment. Simply replace the 16 entries of mac address with the computer you wish to wake up. Tell me what you think.
;WOL v.1 by ASMDEMON
format PE GUI 4.0
entry start
include 'win32a.inc'
section '.text' code readable writeable executable
start:
invoke WSAStartup,0101h,wsadata
invoke socket, AF_INET, SOCK_DGRAM,17 ;IPPROTO_UDP = 17
mov [sock], eax
mov [saddr.sin_family], AF_INET
mov [saddr.sin_port], 0x0900
mov [saddr.sin_addr], 0xFFFFFFFF
invoke setsockopt, [sock], 0xFFFF, 0x0020 ;set for broadcast
invoke sendto,[sock],magicpacket,102,0,saddr,sizeof.sockaddr_in
invoke closesocket,[sock]
invoke WSACleanup
invoke ExitProcess,0
;section '.data' data readable writeable ;removing this saves 512b of size
magicpacket db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\ ;required 16 entries of
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\ ;MAC you wish to wake up
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32,\
0x00, 0x0D, 0x56, 0x06, 0x99, 0x32
sock dd ?
saddr sockaddr_in
wsadata WSADATA
section '.idata' import data readable writeable
library kernel,'KERNEL32.DLL',\
winsock,'WSOCK32.DLL'
import kernel,\
ExitProcess,'ExitProcess'
import winsock,\
setsockopt, 'setsockopt',\
WSAStartup,'WSAStartup',\
WSACleanup,'WSACleanup',\
socket,'socket',\
sendto,'sendto',\
closesocket,'closesocket'
_________________ It is better to be on the right side of the devil than in his path.
|