Basilisk II PSP Port (Mac Emulator)

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

Moderators: cheriff, TyRaNiD

Post Reply
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Yeah, about the only reference I could find to raw sockets on the PSP was a thread where someone WANTED to write a packet sniffer and needed raw sockets, but he didn't get an answer on his question about raw sockets on the PSP, so the thread just quit without a resolution.

My own more recent thread about raw sockets on the PSP went unanswered as well, so I don't think anyone knows anything. It's not an area anyone has really looked into yet. Probably the only folks to look into it did some simple tests like mine, and when they turned out negative, assumed Sony doesn't support raw sockets.
Moneyslap03
Posts: 14
Joined: Sun May 11, 2008 11:06 pm

Post by Moneyslap03 »

is there a way to convert or make a call from raw socketing to the sce access point sniffer
ViTi95
Posts: 3
Joined: Fri Jul 18, 2008 6:21 pm
Location: Getafe (Madrid)

Post by ViTi95 »

a little question. does tv output work for the latest test version of basiliskII?? mine doesn't :S and on earlier versions it worked :S

p.d.: nice job J.F.!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ViTi95 wrote:a little question. does tv output work for the latest test version of basiliskII?? mine doesn't :S and on earlier versions it worked :S

p.d.: nice job J.F.!
Yes, TV out works fine. Sounds like you deleted the dvemgr.prx or something.

Also, if you use FUSA on your PSP, turn it off when trying to use programs that make use of the TV directly.
nickdudego3
Posts: 2
Joined: Mon Nov 10, 2008 7:06 am

jigsaw

Post by nickdudego3 »

hi i wanted to know where i can download or obtain the files for the programs like jigsaw puzzle and what file type and where i would install it
hihi
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Woah, big bump.

Download
My PSP's Firmware:
5.00 M33-6 w/ LEDA 0.2

My PSP's Motherboard:
TA-088

My PSP's Model:
PSP-2001 (Slim)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Read the guide for B2: http://groups.google.com/group/chilly-w ... -psp?hl=en

Finding Mac software is not something that would be discussed here. You'd be better off asking at a Mac emulation site, especially one that focused on Basilisk, like this one: http://www.emaculation.com/forum/viewforum.php?f=6
nickdudego3
Posts: 2
Joined: Mon Nov 10, 2008 7:06 am

dude

Post by nickdudego3 »

i've been googling for hours please can someone nice help me find it
hihi
jnj2828
Posts: 1
Joined: Wed Dec 31, 2008 7:02 am

Post by jnj2828 »

HELP!!!!! ........i no this is old...but how do i change the color of my psp key board....(cfw 5.00m33-4)!!!!...................
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

jnj2828 wrote:HELP!!!!! ........i no this is old...but how do i change the color of my psp key board....(cfw 5.00m33-4)!!!!...................
Go to your local hobby shop - they should have all kinds of paint available. :D

If you mean the Danzef OSK, change the color in the pngs using a paint program like GIMP or Photoshop.

If you mean the Sony OSK, you can't.
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

JF, its possible. It will just take a month of reverse enginnering, and finding that osk in the psp.
darkfang
Posts: 13
Joined: Mon Feb 16, 2009 11:32 pm

Post by darkfang »

why not use a java raw socket library and port it to psp? you can google"raw socket java" and find info or google "jpcap" a java for sending and recieving raw sockets.hope this helped
WE MUST FIND RAW SOCKETS FOR PSP
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

It wouldnt be easy as it may sound.
darkfang
Posts: 13
Joined: Mon Feb 16, 2009 11:32 pm

Post by darkfang »

true but anything is worth trying at the moment
WE MUST FIND RAW SOCKETS FOR PSP
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Well thats true. Ill do a search. Maybe ill find one written in C.

But theres many problems also when porting it to the pspsdk.
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

Dariusc123456 wrote:Well thats true. Ill do a search. Maybe ill find one written in C.
No. Raw sockets have to be implemented in the IP stack within the PSP kernel. Either support is there and we don't know how to use it or it's not and a kernel patch or hook will be required. A java or C library will not help.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

What crazyc said. :)

The only suggestion I've heard that's worth trying is to make a kernel mode prx and try calling the socket code from kernel mode. While Sony probably wouldn't allow raw sockets from user mode, it's possible it's there but reserved to kernel mode. Just haven't had the gumption to try that yet.
User avatar
Gaby_64
Posts: 33
Joined: Fri Dec 19, 2008 4:04 am

gethostbyname crash

Post by Gaby_64 »

Have you had that problem too when trying to get raw socket on psp?

gethostname works but when gethostbyname attempts to resolve it it crashes

Code: Select all

printf("\nFetching host name...");
	if(sceUtilityGetSystemParamString(PSP_SYSTEMPARAM_ID_STRING_NICKNAME, host, sizeof(host)) == PSP_SYSTEMPARAM_RETVAL_FAIL)
	{
		strcpy(host, "UNNAMED");
	}
	printf("%s\nResolving...", host);
	if((server=gethostbyname(host))!=0)
	{
		if &#40;server < 0&#41; &#123;
			errno = sceNetInetGetErrno&#40;&#41;;
			printf&#40;"Error,  %x, %d, %s\n", errno, HexToDec&#40;errno&#41;, errd&#91;HexToDec&#40;errno&#41;&#93;&#41;;
			sceKernelDelayThread&#40;1000000&#41;;
			do &#123; sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
			&#125; while &#40;pad.Buttons == 0&#41;;
			sceKernelExitGame&#40;&#41;;
		&#125;
		else &#123;
			printf&#40;"Unable to resolve, %s\n", hosterr&#91;&#40;int&#41;server&#93;&#41;;
			sceKernelDelayThread&#40;1000000&#41;;
			do &#123; sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
			&#125; while &#40;pad.Buttons == 0&#41;;
			sceKernelExitGame&#40;&#41;;
		&#125;
	&#125;
	dest.sin_family = AF_INET;
	dest.sin_port   = htons&#40;50000&#41;;  //your destination port
	memcpy&#40;&dest.sin_addr.s_addr,server->h_addr,server->h_length&#41;;
	printf&#40;"Resolved."&#41;;
Has anyone found a fix to this?
darkfang
Posts: 13
Joined: Mon Feb 16, 2009 11:32 pm

woot

Post by darkfang »

wow gaby_64 is here?^^
WE MUST FIND RAW SOCKETS FOR PSP
User avatar
Gaby_64
Posts: 33
Joined: Fri Dec 19, 2008 4:04 am

Post by Gaby_64 »

Its been a while (since I started AirCrack-PSP)

No one has had this problem with sockets? (gethostbyname crashes)

the host name on my PSP slim is P150, idk if its the same for every psp
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

In PSP Doom, there's this:

Code: Select all

  while &#40;++i < myargc && myargv&#91;i&#93;&#91;0&#93; != '-'&#41; &#123;
  	memset&#40;&#40;void *&#41;&IP_sendaddress&#91;doomcom->numnodes&#93;, 0, sizeof&#40;IP_sendaddress&#91;doomcom->numnodes&#93;&#41;&#41;;
    IP_sendaddress&#91;doomcom->numnodes&#93;.sin_family = AF_INET;
    IP_sendaddress&#91;doomcom->numnodes&#93;.sin_port = htons&#40;IP_DOOMPORT&#41;;
    if &#40;myargv&#91;i&#93;&#91;0&#93; == '.'&#41; &#123;
      IP_sendaddress&#91;doomcom->numnodes&#93;.sin_addr.s_addr = inet_addr &#40;myargv&#91;i&#93;+1&#41;;
      printf&#40;" %s", myargv&#91;i&#93;+1&#41;;
    &#125; else &#123;
      hostentry = gethostbyname &#40;myargv&#91;i&#93;&#41;;
      printf&#40;" %s", myargv&#91;i&#93;&#41;;
      if &#40;!hostentry&#41;
        I_Error &#40;"gethostbyname&#58; couldn't find %s", myargv&#91;i&#93;&#41;;
      IP_sendaddress&#91;doomcom->numnodes&#93;.sin_addr.s_addr = *&#40;int *&#41;hostentry->h_addr_list&#91;0&#93;;
    &#125;
    doomcom->numnodes++;
  &#125;
I don't remember hearing any complaints about it crashing, but I'm not sure if people ever used that path in the code. I certainly never did.
User avatar
Gaby_64
Posts: 33
Joined: Fri Dec 19, 2008 4:04 am

Post by Gaby_64 »

If fixed the problem but it cant resolve the psp host name P150 but when I put www.luaplayer.org or some otgher site it works

But it only works if I connect the psp to a AP
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Gaby_64 wrote:If fixed the problem but it cant resolve the psp host name P150 but when I put www.luaplayer.org or some otgher site it works

But it only works if I connect the psp to a AP
Err... if you're not connected to an AP, you aren't connected to the net. If you aren't connected to the net, how do you expect to resolve names?? The DNS servers are on the net (well, the ones I use certainly are).

Getting your own IP address isn't done through the resolver, just someone else's IP address. To get your own IP addy, do:

Code: Select all

    if &#40;sceNetApctlGetInfo&#40;8, szMyIPAddr&#41; != 0&#41;
      strcpy&#40;szMyIPAddr, "unknown IP address"&#41;;
    printf&#40;"IP&#58; %s\n", szMyIPAddr&#41;;
User avatar
Gaby_64
Posts: 33
Joined: Fri Dec 19, 2008 4:04 am

Post by Gaby_64 »

Then how would I make a socket without having to connect to an AP
DO I have to make a server socket

My objective with the socket is to be able to sniff incoming packets
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Gaby_64 wrote:Then how would I make a socket without having to connect to an AP
DO I have to make a server socket

My objective with the socket is to be able to sniff incoming packets
You HAVE to connect to an access point FIRST, then you create your sockets. With the PSP, you do the "standard" PSP network initialization, at which point THEN you can pretend you're working with normal sockets. Look at the net init code in B2 or Doom for an example of initializing the PSP network.
User avatar
Gaby_64
Posts: 33
Joined: Fri Dec 19, 2008 4:04 am

Post by Gaby_64 »

Is there any way I could fake a connection to an access point
<a><img></a>
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I wouldn't know of any. I just go ahead and make a real connection so that the code really works. A fake connection isn't going to allow you to do anything.
User avatar
Gaby_64
Posts: 33
Joined: Fri Dec 19, 2008 4:04 am

Post by Gaby_64 »

But wouldn't this work? (It freezes when trying to recv)

Code: Select all

sock = sceNetInetSocket&#40;AF_INET, SOCK_RAW, IPPROTO_RAW&#41;;
	if&#40;sock < 0&#41; &#123;
		errno = sceNetInetGetErrno&#40;&#41;;
		printf&#40;"Socket error %x, %d, %s\n", errno, HexToDec&#40;errno&#41;, errd&#91;HexToDec&#40;errno&#41;&#93;&#41;;
		sceKernelDelayThread&#40;1000000&#41;;
		do &#123; sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
		&#125; while &#40;pad.Buttons == 0&#41;;
		sceKernelExitGame&#40;&#41;;
	&#125;

	int val = 1;
	if&#40;sceNetInetSetsockopt&#40;sock, IPPROTO_IP, IP_HDRINCL, &val, sizeof&#40;val&#41;&#41; < 0&#41; &#123;
		errno = sceNetInetGetErrno&#40;&#41;;
		printf&#40;"Set IP_HDRINCL failed\n"&#41;;
		printf&#40;"Errno = %x, %d, %s\n", errno, HexToDec&#40;errno&#41;, errd&#91;HexToDec&#40;errno&#41;&#93;&#41;;
		sceKernelDelayThread&#40;1000000&#41;;
		do &#123; sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
		&#125; while &#40;pad.Buttons == 0&#41;;
		sceKernelExitGame&#40;&#41;;
	&#125;

	get_socket_addr&#40;sock, &addr&#41;;


	address.sin_family = AF_INET;
	address.sin_port   = htons&#40;23&#41;;  //your destination port
	address.sin_addr.s_addr = INADDR_ANY;

	printf&#40;"Binding\n"&#41;;
	if&#40;sceNetInetBind&#40;sock, &#40;struct sockaddr *&#41;&address, sizeof&#40;address&#41;&#41; < 0&#41; &#123;
		errno = sceNetInetGetErrno&#40;&#41;;
        printf&#40;"Bind returned %x\n", err&#41;;
        printf&#40;"Errno = %x, %d, %s\n", errno, HexToDec&#40;errno&#41;, errd&#91;HexToDec&#40;errno&#41;&#93;&#41;;
		sceKernelDelayThread&#40;1000000&#41;;
        do &#123; sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
		&#125; while &#40;pad.Buttons == 0&#41;;
		sceKernelExitGame&#40;&#41;;
	&#125;
	printf&#40;"Binding successfull\n"&#41;;
<a><img></a>
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Because raw sockets don't work on the PSP as far as anyone can determine. If you'd bothered searching the forum, you'd have found my own thread on it.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Well I think its time I started making a 5MB Shareware / Freeware pack for Basilisk PSP
Post Reply