flat assembler
Message board for the users of flat assembler.

Index > Windows > Wake On Lan in 1.5k

Author
Thread Post new topic Reply to topic
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 18 Apr 2009, 07:11
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.
Code:
;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.
Post 18 Apr 2009, 07:11
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 18 Apr 2009, 10:16
Thanks for program. So you have a MAC address assigned to Dell (00-0D-56, Dell PCBA Test).
Post 18 Apr 2009, 10:16
View user's profile Send private message Visit poster's website Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 19 Apr 2009, 04:35
yep, but i'm not worried about posting my mac address. but if anyone finds this info/program usefull, let me know
Post 19 Apr 2009, 04:35
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 20 Apr 2009, 07:12
Less stress:
Code:
MAC equ db 0x00, 0x0D, 0x56, 0x06, 0x99, 0x32
  magicpacket db 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
              times 16 MAC
    
Post 20 Apr 2009, 07:12
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 20 Apr 2009, 21:48
dude, that's awesome. thanx for the optimization
Post 20 Apr 2009, 21:48
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.