displaying and checking psp's mac address

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
cyanide
Posts: 7
Joined: Mon Sep 26, 2005 1:19 pm
Location: India

displaying and checking psp's mac address

Post by cyanide »

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
User avatar
Stellar
Posts: 48
Joined: Mon Dec 12, 2005 9:13 am

Post by Stellar »

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?
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

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.)
cyanide
Posts: 7
Joined: Mon Sep 26, 2005 1:19 pm
Location: India

Post by cyanide »

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: Select all

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
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

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: Select all

   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&#91;6&#93; = &#123;0x01, 0x23, 0x45, 0x67, 0x89, 0xAB&#125;;  // <-- Your MAC here
      int n = 0;
      while &#40;&#40;n<6&#41; && &#40;sVal&#91;n&#93; == myMac&#91;n&#93;&#41;&#41;
         n++;

      if &#40;n == 6&#41;
         printf&#40;"MAC Address is valid, access granted.\n"&#41;;
      else
         printf&#40;"Unauthorized MAC Address!!!\n"&#41;;
   &#125;
   else 
      printf&#40;"Error getting Wlan Ethernet Address &#40;0x%08X&#41;\n", retVal&#41;; 
This is completely uncompiled & untested. Hope this helps. Looking forward to seing the final release!
cyanide
Posts: 7
Joined: Mon Sep 26, 2005 1:19 pm
Location: India

Post by cyanide »

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

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

thanks man...

i owe you one...
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

Hmmm... thats a great idea for betas! Im gunna use that idea! thanks! :D
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

Not exactly hard to crack though :)
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

Why, is there a way to spoof MAC addresses?? I didnt think there was??
HaQue
Posts: 91
Joined: Fri Nov 25, 2005 8:52 am
Location: Adelaide, Australia
Contact:

Post by HaQue »

but there is a way to edit the hard coded MAC address that would be in your compiled App!
cyanide
Posts: 7
Joined: Mon Sep 26, 2005 1:19 pm
Location: India

Post by cyanide »

not if its encrypted ;)
HaQue
Posts: 91
Joined: Fri Nov 25, 2005 8:52 am
Location: Adelaide, Australia
Contact:

Post by HaQue »

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!
cyanide
Posts: 7
Joined: Mon Sep 26, 2005 1:19 pm
Location: India

Post by cyanide »

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...
Dr. Vegetable
Posts: 171
Joined: Mon Nov 14, 2005 1:32 am
Location: Boston, Massachusetts
Contact:

Post by Dr. Vegetable »

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.
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

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.
Post Reply