forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

displaying and checking psp's mac address

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
cyanide



Joined: 26 Sep 2005
Posts: 7
Location: India

PostPosted: Thu Dec 15, 2005 4:51 am    Post subject: displaying and checking psp's mac address Reply with quote

ok, using a sample i found in the latest toolchain, i managed to get the mac address displayed on my psp...

what i wanted to know is how to check that mac address against a specified one...

i know its possible, its just that my programming skills arent very much 1337...

can someone write a sample code for me or tell me where i can find it ?

thanks for your time,
cyanide
Back to top
View user's profile Send private message
Stellar



Joined: 12 Dec 2005
Posts: 48

PostPosted: Thu Dec 15, 2005 5:43 am    Post subject: Reply with quote

post your code and it would be easier to modify.

but basically, just just need to accept input and string compare it to the pspmac. whats the point of doing that btw?
Back to top
View user's profile Send private message
Dr. Vegetable



Joined: 14 Nov 2005
Posts: 171
Location: Boston, Massachusetts

PostPosted: Thu Dec 15, 2005 6:33 am    Post subject: Reply with quote

By the way, you can easily view the MAC address using the firmware. At the main menu level, scroll to the far left, then down to System Settings and hit enter. Scroll down to System Information and hit enter again. The unit will display the MAC address, firmware version, and user nickname. This works on both 1.50 and 2.00, presumably other versions as well.

I haven't verified that the firmware reports the same MAC address that is laser-engraved into the RF shield on the WiFi module, but it's probably a safe assumption.

EDIT:
I'm kinda surprised that you have managed to retrieve the MAC address and display it on the screen without also being able to figure out how to compare it against another one. It makes me curious why you want to do this... If you provide a bit more information about what you are doing, you are more likely to get a helpful answer. (Unlike my original response, above, which completely missed your point.)
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
cyanide



Joined: 26 Sep 2005
Posts: 7
Location: India

PostPosted: Thu Dec 15, 2005 3:23 pm    Post subject: Reply with quote

lol, i know how to check the mac address directly...
its just that im making an application and right now, i wanted to release betas which were locked to a particular mac address, so that even if they got leaked, they wouldnt be useful to anyone...

heres the code i used to retrieve my mac address:

Code:
char sVal[7];
   int retVal;
   memset(sVal, 0, 7);
       retVal = sceWlanGetEtherAddr(sVal);
       if (retVal == 0)       
          printf("MAC Address: %02X:%02X:%02X:%02X:%02X:%02X\n", sVal[0], sVal[1], sVal[2], sVal[3], sVal[4], sVal[5]);
       else
          printf("Error getting Wlan Ethernet Address (0x%08X)\n", retVal);


the problem is that i dont know how to compare them with another specified one...call it noobishness if you will...
can someone write a sample code to compare it with one of my own ?
thanks
Back to top
View user's profile Send private message
Dr. Vegetable



Joined: 14 Nov 2005
Posts: 171
Location: Boston, Massachusetts

PostPosted: Thu Dec 15, 2005 6:23 pm    Post subject: Reply with quote

If you have the MAC address in the first six bytes of sVal, then you simply need to compare that against the six bytes of the particualr address:

Code:

   char sVal[7];
   int retVal;

   memset(sVal, 0, 7);
   retVal = sceWlanGetEtherAddr(sVal);
   if (retVal == 0) 
   {     
      printf("MAC Address: %02X:%02X:%02X:%02X:%02X:%02X\n", sVal[0], sVal[1], sVal[2], sVal[3], sVal[4], sVal[5]);

      // Compare against a specific address:
      char myMac[6] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB};  // <-- Your MAC here
      int n = 0;
      while ((n<6) && (sVal[n] == myMac[n]))
         n++;

      if (n == 6)
         printf("MAC Address is valid, access granted.\n");
      else
         printf("Unauthorized MAC Address!!!\n");
   }
   else
      printf("Error getting Wlan Ethernet Address (0x%08X)\n", retVal);


This is completely uncompiled & untested. Hope this helps. Looking forward to seing the final release!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
cyanide



Joined: 26 Sep 2005
Posts: 7
Location: India

PostPosted: Thu Dec 15, 2005 9:11 pm    Post subject: Reply with quote

thanks, ill try it out later and tell you...

edit:
it works !!! it works !!!

thanks man...

i owe you one...
Back to top
View user's profile Send private message
seventoes



Joined: 02 Oct 2005
Posts: 79

PostPosted: Sat Dec 17, 2005 2:22 pm    Post subject: Reply with quote

Hmmm... thats a great idea for betas! Im gunna use that idea! thanks! :D
Back to top
View user's profile Send private message
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Sat Dec 17, 2005 3:05 pm    Post subject: Reply with quote

Not exactly hard to crack though :)
_________________
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
Back to top
View user's profile Send private message
seventoes



Joined: 02 Oct 2005
Posts: 79

PostPosted: Sat Dec 17, 2005 3:43 pm    Post subject: Reply with quote

Why, is there a way to spoof MAC addresses?? I didnt think there was??
Back to top
View user's profile Send private message
HaQue



Joined: 25 Nov 2005
Posts: 91
Location: Adelaide, Australia

PostPosted: Sat Dec 17, 2005 4:02 pm    Post subject: Reply with quote

but there is a way to edit the hard coded MAC address that would be in your compiled App!
_________________
www.smartwave-wireless.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cyanide



Joined: 26 Sep 2005
Posts: 7
Location: India

PostPosted: Sat Dec 17, 2005 4:37 pm    Post subject: Reply with quote

not if its encrypted ;)
Back to top
View user's profile Send private message
HaQue



Joined: 25 Nov 2005
Posts: 91
Location: Adelaide, Australia

PostPosted: Sat Dec 17, 2005 4:46 pm    Post subject: Reply with quote

EVEN if it is encrypted...

remember, your encryption routine is ALSO hard coded into your app. It would just make it more fun, and hence more of a target.

do you really need to go to all that trouble? Why not make it Open Source, then when you have trouble with simple things others can help you.

And if you cant trust your beta testers, you shouldnt be giving it to them!
_________________
www.smartwave-wireless.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cyanide



Joined: 26 Sep 2005
Posts: 7
Location: India

PostPosted: Sat Dec 17, 2005 4:56 pm    Post subject: Reply with quote

im only concerned about the beta version...
i will be giving out the source with the final version...

there are a few homebrew scene bitches...
i dont want them stealing my code...
Back to top
View user's profile Send private message
Dr. Vegetable



Joined: 14 Nov 2005
Posts: 171
Location: Boston, Massachusetts

PostPosted: Sat Dec 17, 2005 9:28 pm    Post subject: Reply with quote

I think this could be a relatively secure way of preventing unauthorized access to your beta versions, if you use proper encryption techniques. But even a mega-corporation like Sony has trouble doing this, apparently.

Your success will depend on three factors:
1. How well you encrypt
2. Whether your program falls into the wrong hands
3. Whether it is "interesting enough" for someone to expend the effort of cracking it.

Judging from the nature of your original question, I would advise you to do some studying before you assume that you have written secure software, though. :)

But if you plan to eventually release it, I wouldn't worry too much about all of this anyway. Either don't release it to anyone you can't trust, or announce what you are doing on a forum so that there is a historical public record that it is your project.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
seventoes



Joined: 02 Oct 2005
Posts: 79

PostPosted: Sun Dec 18, 2005 2:10 am    Post subject: Reply with quote

HaQue wrote:
EVEN if it is encrypted...

remember, your encryption routine is ALSO hard coded into your app. It would just make it more fun, and hence more of a target.


Then just add up different parts of the address at different locations in the app. it would be alot harder to find it if you, say, put the first 2 chars into the variable at the beginning of he code, then 50 lines later put the next 2, then 20 lines later put the next 2, ect.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group