Hacking Wake PC via Wii via WOL

WiiCrazy

Be water my friend!
Member
Joined
May 8, 2008
Messages
2,395
Trophies
0
Location
Istanbul
Website
www.tepetaklak.com
XP
387
Country
tueidj said:
LibOGC (or rather, IOS) definitely has some quirks when it comes to UDP and broadcast mode... I did some quick changes to that source code and it seems to work for me, if anyone with a compiler wants to try it out here is the source: http://pastie.org/936868
Obviously change the IP and MAC strings to match the machine you're trying to wake.

Hmm, I'll give it a try... I had tried different socket types but never tried supressing the error from setsockopt. I guess finally @Op has a solution
smile.gif
 

Tristar

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
323
Trophies
0
XP
98
Country
tueidj said:
LibOGC (or rather, IOS) definitely has some quirks when it comes to UDP and broadcast mode... I did some quick changes to that source code and it seems to work for me, if anyone with a compiler wants to try it out here is the source: http://pastie.org/936868
Obviously change the IP and MAC strings to match the machine you're trying to wake.

Doesn't work for me
frown.gif


What OS is on the machine you are managing to wake ?
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
Windows XP, wired connection (duh), in the device properties for my network card the wakeup capabilities are set to MagicPacket+PatternMatch.

Edit: Also under power management, ticked "Allow this device to bring the computer out of standby."
 

Tristar

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
323
Trophies
0
XP
98
Country
tueidj said:
Windows XP, wired connection (duh), in the device properties for my network card the wakeup capabilities are set to MagicPacket+PatternMatch.

Edit: Also under power management, ticked "Allow this device to bring the computer out of standby."


The only difference is then, that I'm using Windows 7
I'll give it a go with XP ...
smile.gif


/EDIT: Yup - works with XP thanks
wink.gif


Hmm, It's a little too eager with XP. The server wakes if any other PC is on, regardless of whether I send a magic packet or not
frown.gif


I'll have to see if I can't get it working with Win7. Getting closer though
smile.gif


It seems that what is waking the PC is just the fact that something is being broadcast to all network cards (and that particular one isn't so fussy about what it wakes to). If you set the card to wake only to a magic packet it will not wake. If you set it to wake to pattern match (or anything including pattern match) it does wake, but not to any particular MAC address - any MAC address will do, it still wakes. Also if any other PC is turned on in the Network it prevents the server from sleeping (even if it is not trying to connect to it).
frown.gif


Good news though for those with just 1 PC and a Wii - That'll do nicely
wink.gif
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
Sounds like the contents of the packet that the wii sends isn't quite what it should be (doesn't match the definition of a "magic packet"). I just followed the original source code, so I'm afraid I can't help much. But at least broadcast mode is working.
 

Tristar

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
323
Trophies
0
XP
98
Country
tueidj said:
Sounds like the contents of the packet that the wii sends isn't quite what it should be (doesn't match the definition of a "magic packet"). I just followed the original source code, so I'm afraid I can't help much. But at least broadcast mode is working.

It can't be that far off, and will suit the many that don't have a house full of PCs on the network
yay.gif
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
It might just be that the packet should be sent to the broadcast address (INADDR_BROADCAST) rather than the ip of the target. Make sense since the latter would require an ARP lookup which is a bit difficult when the target is off and unable to respond.
 

Tristar

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
323
Trophies
0
XP
98
Country
tueidj said:
It might just be that the packet should be sent to the broadcast address (INADDR_BROADCAST) rather than the ip of the target. Make sense since the latter would require an ARP lookup which is a bit difficult when the target is off and unable to respond.
Not really up on wii programming, so no idea how to substitute that info.

Sounds logical though - I don't believe that the magic packet requires IP address at all. I think some use the IP address initially to get to the MAC address, but it is not used when sending magic packet (for the reason you mention - when the machine is 'off' it doesn't have an IP address)

Don't quote me on any of that - just ramblings of the limited info I have picked up from here and there
biggrin.gif
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
Instead of
Code:
host2addr(IP,&sin.sin_addr,&sin.sin_family);
it would be something like
Code:
sin.sin_addr.s_addr = htonl(INADDR_BROADCAST);
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
I guess they could, if pastie.org wasn't down and the code was accessible. But somehow the app would need to know the MAC address of the machine to wake.
 

Tristar

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
323
Trophies
0
XP
98
Country
XFlak said:
so is this code only useful if included in an app that has SMB support? Is this something that WiiMC or MPlayer_CE could incorporate?
SMB share or an FTP server on your LAN (even WiiXplorer would benefit).
Now this code exists, it is would not only be useful with these apps - but an essential requirement.
Knowing that you are going to connect to a remote PC on your lan why wouldn't you send a magic packet to wake it ?
If the machine does not support WOL or is already awake - no harm done.

I have already posted the suggestion on the WiiMC forum here (The thread has been removed for some reason)

Since I did, the only reply has been my own, in which I stated that the working code already exists and put a link to this thread

In an application that this would enhance, you would normally have a means to add the address of the SMB share or FTP server settings so an extra field to add the MAC address for the machine should be no problem. If no MAC address is stated - don't send the magic packet.

It might encourage those developing the likes of WiiMC to include this code, if a few more added their support for this feature to be added
wink.gif
 

Tristar

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
323
Trophies
0
XP
98
Country
tueidj said:
They would probably be even more likely to accept it if a patch was submitted. Developers love it when people make their lives easier.

Once I can coax DevkitPro into compiling the WiiMC source (so I can test it), I'll see if I can make a patch for it - This definitely should be included
yaywii.gif


That's gonna take some time I see - WiiMC is a w@nker to compile
mad.gif
 

Screemer

Well-Known Member
Member
Joined
Sep 21, 2008
Messages
1,248
Trophies
0
Website
Visit site
XP
143
Country
Gambia, The
finally! after over a year of lifting my lazy ass of the couch to turn on my pc, everytime i wanted to watch a movie, that torture is over and i can keep my ass seated
biggrin.gif
looking forward for an integration in wiimc.
 

Tristar

Well-Known Member
Member
Joined
Sep 14, 2009
Messages
323
Trophies
0
XP
98
Country
OK so I've got my forwarder waking the server before starting WiiMC
smile.gif


Finally got WiiMC compiled - but, as I've already stated, I know bugger all about Wii programming sooo...

If someone else gets this thing integrated into WiMC for heaven's sake let me know and save me some grief
laugh.gif


If not, I'll report back if and when I can figure it out
wink.gif
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BakerMan @ BakerMan: ... that's rough buddy