Advertising (This ad goes away for registered users. You can Login or Register)

[Release]UsbServer

Submit your entry for the competition here.
check http://wololo.net/genesis for detailed rules
User avatar
jvhellraiser
Posts: 1478
Joined: Tue Jan 18, 2011 4:09 pm

Post by jvhellraiser » Tue May 31, 2011 2:14 pm

DELETE PLEASE!!!
Advertising
Last edited by jvhellraiser on Tue May 31, 2011 2:25 pm, edited 2 times in total.

User avatar
jvhellraiser
Posts: 1478
Joined: Tue Jan 18, 2011 4:09 pm

Re: [Release]UsbServer

Post by jvhellraiser » Tue May 31, 2011 2:22 pm

where this goes?


#!/usr/bin/perl -00
use File::Temp;$f=File::Temp->new;print{$f}<>;system qw{firefox -remote},"openURL(file://$f, new-tab)"


????????? :mrgreen:
Advertising

User avatar
ohrores
Posts: 21
Joined: Thu Apr 14, 2011 5:11 pm
Location: Germany

Re: [Release]UsbServer

Post by ohrores » Tue May 31, 2011 2:23 pm

Yes, but it works not good... :D
So, first you must build the edited sourcecode.

Code: Select all

javac UsbServerPC.java
In the same folder you have a script named pipe.pl:

Code: Select all

#!/usr/bin/perl -00
use File::Temp;$f=File::Temp->new;print{$f}<>;system qw{firefox -remote},"openURL(file://$f, new-tab)" 
Then you do the same as normal:
1.Starting UsbServer on the psp
2.Starting usbhostfs_pc in the terminal and open firefoy
And then you pipe the output from UsbServerPC to firefox like this:

Code: Select all

java UsbServerPC www.wololo.net | ./pipe.pl
Now in firefox a new tap should open and in there is the home of wololo
[spoiler]Image[/spoiler]

thecobra
HBL Collaborator
Posts: 167
Joined: Thu Feb 24, 2011 7:50 pm

Re: [Release]UsbServer

Post by thecobra » Tue May 31, 2011 5:44 pm

Abhinav The Great wrote:when i pressed X the network connection window opened , so i scanned but no access points were detected
Below is the status of Start Example at that time

C:\Documents and Settings\Abhinav\Desktop\PC>java -jar UsbServerPC.jar
USBSERVERPC v1.0 by Thecobra(James A.) 04/17/2011
Connecting to USBSERVER ... DONE.
USBSERVER Online: false
USBSERVER IP: unknown IP
Webpage :
C:\Documents and Settings\Abhinav\Desktop\PC>pause
Press any key to continue . . .

Well.................. what am i doing wrong???????????????????
Mexicouger wrote:I follow the steps, and it just says:


C:\Users\Administrator\Desktop\PC>java -jar UsbServerPC.jar
USBSERVERPC v1.0 by Thecobra(James A.) 04/17/2011
Connecting to USBSERVER ..

And it doesn't do anything past that
It also didn't say my drivers installed properly when I plugged my psp in with USBserver on, so I dunno if thats a problem

I may have forgot to say something:
Firt you need to make sure that you don't have usbhostfs plugin enable in you cfw. the program auto load it so if you have it enable it will lag trying to load it. I try to fix this problem in the next version so that it check to see if it loaded and if it not then try to load it.
Second, The psp internet only works if you have wifi hotspot near you. No wifi = no internet.

I think that all.


Went i get back home from work tonight, i try to work on the proxy again, i think i figure out how to fix it(the solution came to me in a dream, i can always figure hard stuff while i am asleep lol) and when i get home i try to put that to the test.
vasi4_5 wrote:Is there any chance for brick with this HB?And sorry for calling you as*hole :lol: You ROCK! Thanks for this HB.
There no chance for this version to brick you psp since it doesn't patch anything yet. And don't worry about it, just try not to do it again unless 100% it fake lol.

npt@ thanks, i did not see my project in the front page so i though it wasn't accepted. i still gonna be working on it so look forward for a way better version of it by the end of this project ;)
ohrores wrote:I have wrote a little mod.
To pipe it to firefox.
UsbServerPC.java:

Code: Select all

import java.net.* ;

import java.io.* ;





public class UsbServerPC {



	private static String title = "USBSERVERPC v1.0 by Thecobra(James A.) 04/17/2011";

	public static Socket s = null;

	public static DataInputStream dIn;

	public static DataOutputStream dOut;



	public static void main(String[] args) throws IOException {

		// TODO Auto-generated method stub

		try{

			s = new Socket("127.0.0.1",10005);

			dIn = new DataInputStream(s.getInputStream());

			dOut = new DataOutputStream(s.getOutputStream());

		} catch(IOException e){

			System.out.println("Fehler: "+e);

		}



		//System.out.print(RecvUsbWait());

		WaitForUsbServer();

		String data = "GET  /index.html HTTP/1.1\r\n" + "User-Agent: HTTPGrab\r\n"

		+ "Accept: text/*\r\n" + "Connection: close\r\n" + "Host: "+args[0]+" \r\n" + "\r\n";

		String webpage = GetWebPage(args[0],80,data);
		String[] page = webpage.split("<head>");

		System.out.print("" + page[1]);

	}



	public static void SendUsb(String data) throws IOException{

		dOut.write(data.getBytes());

		dOut.flush();

	}





	public static String RecvUsb() throws IOException{

		int timeout = 1000;

		while(timeout >= 0){

			if(dIn.available() > 0){

				return dIn.readLine();

			}

			timeout--;

		}

		return "";

	}



	public static String RecvUsbWait() throws IOException{

		return dIn.readLine();

	}



	public static int MakeClientSocket(int time, String address, int port) throws IOException{

		int sock = -1;

		if(time >= 10){

			return -1;

		}

		SendUsb("SC*" + port + "*" + address);

		String data = RecvUsbWait().trim();

		if(data.startsWith("SCD*")){

			sock =  Integer.parseInt(data.substring(4));

		} else {

			return MakeClientSocket(time++,address,port);

		}



		return sock;

	}



	public static int MakeHostSocket(int time,int port) throws IOException{

		int sock = -1;

		if(time >= 10){

			return -1;

		}

		SendUsb("CC*" + port);

		String data = RecvUsbWait().trim();

		if(data.startsWith("CCD*")){

			sock =  Integer.parseInt(data.substring(4));

		} else {

			return MakeHostSocket(time++,port);

		}

		return sock;

	}



	public static int CloseSocket(int time,int port) throws IOException{

		int sock = -1;

		if(time >= 10){

			return -1;

		}

		SendUsb("CS*" + port);

		String data = RecvUsbWait().trim();

		if(data.startsWith("CSD*")){

			sock =  Integer.parseInt(data.substring(4));

		} else {

			return CloseSocket(time++,port);

		}

		return sock;

	}



	public static String RecvData(int sock, int maxlen) throws IOException{

		int slen = 0;

		String buf = "";

		SendUsb("RD*" + sock + "*" + maxlen);

		String tempbuf = RecvUsbWait().trim();

		if(tempbuf.startsWith("RDD*")){

			slen = Integer.parseInt(tempbuf.substring(4));

			while(slen > 5){

				tempbuf = RecvUsbWait();

				buf = buf + tempbuf;

				slen -= tempbuf.length() + 2;

			}

		}

		return buf;

	}





	public static int SendData(int sock,String buf, int maxlen) throws IOException{

		int sendt = 0;

		SendUsb("SD*" + sock + "*" +maxlen + "*" + buf);

		String tempbuf = RecvUsbWait();

		if(tempbuf.startsWith("SDD*")){

			sendt = Integer.parseInt(tempbuf.substring(4));

		}

		return sendt;

	}



	public static String GetIP() throws IOException {

		String reip = "0.0.0.0";

		SendUsb("PI");

		String data = RecvUsbWait().trim();

		if(data.startsWith("PID*")){

			reip = data.substring(4);

		}

		return reip;

	}



	public static Boolean GetOnline(int time) throws IOException {

		SendUsb("WP");

		String data = RecvUsbWait().trim();

		if(time >= 10){

			return false;

		}

		if(data.startsWith("WPD*")){

			if(data.substring(4).matches("1")){

				return true;

			} else {

				return false;

			}

		} else {

			return GetOnline(time++);

		}

	}





	private static void WaitForUsbServer() throws IOException {

		SendUsb("EC*ECHO");

		RecvUsbWait();

	}



	private static String GetWebPage(String address, int port, String data) throws IOException{

		int sock = MakeClientSocket(0,address,port);

		SendData(sock,data,data.length());

		String webpage = "";

		String buffer = "";

		Boolean more = true;



		while(more){

			buffer = RecvData(sock,1024);

			if(buffer.length() > 0){

				webpage += buffer;



			} else {

				more = false;

			}

		}



		CloseSocket(0,sock);

		return webpage;

	}



	private static int AcceptClient(int sock) throws IOException{

		int ac = -1;

		SendUsb("CA*"+sock);

		String c = RecvUsb();

		if(c.startsWith("CAD*")){

			ac = Integer.parseInt(c.substring(4));

		}

		return ac;

	}



	private static void MakeServerHost(int port) throws IOException{

		int socket = MakeHostSocket(0,port);

		int client = AcceptClient(socket);

		String data = "";

		while(true){

			data = RecvData(socket,512);

			System.out.print(data);

			SendData(socket,data,data.length());

		}

	}



}
And a pipetool :

Code: Select all

#!/usr/bin/perl -00
use File::Temp;$f=File::Temp->new;print{$f}<>;system qw{firefox -remote},"openURL(file://$f, new-tab)" 
And then start UsbServer on the psp, start usbhostfs on the pc, open firefox and write this in the terminal:

Code: Select all

java UsbServerPC http://www.wololo.net | ./pipe.pl
before you must build the "mod":
javac UsbServerPC.java
for me it works ;)
http://www.wololo.net works, but not many others :lol:
Thank for posting that, i gonna give it a look and maybe implement it in the next version. ofcourse i give you credit for that.
jvhellraiser wrote:DELETE PLEASE!!!
Please don't, else i would be sad :)

p.s this version may not be none -tech friendly version but don't worry, it would get their soon. just follow ohrores instruction and you may be able to get you web browser working.

all@ Thank you for liking this project. i would be working on this project until i can say i 100% happy how it is. Right now i am only 40% happy with it so you can expect alot more update for it.

and all good luck
Image
Cheap & Fast VPS Server from DigitalOcean
PSVita 3.xx eCFW <Thank to wololo Community>
PSVita 1.67 vHBL Dead :(
PSP FAT 6.60 - CFW pro

taxik
Posts: 220
Joined: Tue Jan 18, 2011 8:05 pm

Re: [Release]UsbServer

Post by taxik » Tue May 31, 2011 5:46 pm

Thanks ! I need for this USB Type B?

//WTF, how i can use internet from PC ? I have Type B already installed
Image

thecobra
HBL Collaborator
Posts: 167
Joined: Thu Feb 24, 2011 7:50 pm

Re: [Release]UsbServer

Post by thecobra » Tue May 31, 2011 6:08 pm

taxik wrote:Thanks ! I need for this USB Type B?

//WTF, how i can use internet from PC ? I have Type B already installed
Oyeah, i forgot to say one more thing(it seem i getting old lol), you guys need to install the usbhostfs driver on the pc before you can use this. search up "usbhostfs and remotejoy" since they have the driver and instruction on how to install them. i think there no need for me to remake a tutorial for that since there already alot of them online.
Image
Cheap & Fast VPS Server from DigitalOcean
PSVita 3.xx eCFW <Thank to wololo Community>
PSVita 1.67 vHBL Dead :(
PSP FAT 6.60 - CFW pro

Mexicouger
Posts: 89
Joined: Sun Feb 13, 2011 8:32 pm

Re: [Release]UsbServer

Post by Mexicouger » Tue May 31, 2011 6:16 pm

Alright I did everything it said, and even installed the B Pin drivers, but when I click Usbhostfs and then The bat file, it just says its connecting and never connects.

thecobra
HBL Collaborator
Posts: 167
Joined: Thu Feb 24, 2011 7:50 pm

Re: [Release]UsbServer

Post by thecobra » Tue May 31, 2011 6:36 pm

Mexicouger wrote:Alright I did everything it said, and even installed the B Pin drivers, but when I click Usbhostfs and then The bat file, it just says its connecting and never connects.
have you made sure that no plugin are running on your psp? also did you connect the psp to the pc first and then ran the usbhostfs? the usbhostfs should show a message saying device connected. if it doesn't then that mean you either did not install the driver correctly or the psp program is not running usbhost correctly.
Image
Cheap & Fast VPS Server from DigitalOcean
PSVita 3.xx eCFW <Thank to wololo Community>
PSVita 1.67 vHBL Dead :(
PSP FAT 6.60 - CFW pro

User avatar
jvhellraiser
Posts: 1478
Joined: Tue Jan 18, 2011 4:09 pm

Re: [Release]UsbServer

Post by jvhellraiser » Tue May 31, 2011 10:46 pm

jvhellraiser wrote:
DELETE PLEASE!!!

Please don't, else i would be sad!!
:mrgreen: :mrgreen: :mrgreen:

NOT the post the double post i did
i want this app to be a good one!!!

Halvhjearne
Posts: 664
Joined: Mon Mar 14, 2011 1:58 am
Location: Denmark

Re: [Release]UsbServer

Post by Halvhjearne » Tue May 31, 2011 11:40 pm

Signed libusb 64-bit drivers ... thanx to JJS:
http://jjs.at/software/lwbridge.html

however i suggest to just to install pspdisp latest version instead, as it include the drivers as well as a nice homebrew ... ;)

@thecobra ... once you got a bit more stable version out i will gladly try to write a little guide on this for you, if you would like that?
Dr. Evil wrote:I used to use Windows, but it was designed by freakin' idiots.
Now i use linux allowing me to conrol the "lasers" on my "death star" with ease.
I'm Dr. Evil, and I'm aspiring to take over the world.

Post Reply

Return to “Submissions”