Skip to: Site menu | Main content


Welcome to PSP-Programming.com, a place for developers to get together.

Welcome to the forums. Here you can find other user tutorials as well as homebrew releases and the source code repository. You can also ask for help with your code here and post your own homebrew!

PSP-Programming.com Forums
February 10, 2012, 01:40:45 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News: Check out the Code Section!
Home Help Search Shop Login Register
Digg This!
Pages: 1 [2]
Print
Author Topic: HBN: HomeBrew Network  (Read 14280 times)
pspcoder
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 5
442.04 points

View Inventory
Send Money to pspcoder

View Profile
« Reply #15 on: December 05, 2007, 06:27:23 AM »

Code:
<?php
include 'conn.php'
 
 
//function to encrypt and decrypt based in a key
 
function easy_crypt($string$key){
   
$iv_size mcrypt_get_iv_size(MCRYPT_BLOWFISHMCRYPT_MODE_CBC);
   
$iv mcrypt_create_iv($iv_sizeMCRYPT_DEV_URANDOM);
   
$string mcrypt_encrypt(MCRYPT_BLOWFISH$key$stringMCRYPT_MODE_CBC$iv);
   return array(
base64_encode($string), base64_encode($iv));
 }

 
//decodes a string
 //the first argument is an array as returned by easy_encrypt()
 
function easy_decrypt($cyph_arr$key){
   
$out mcrypt_decrypt(MCRYPT_BLOWFISH$keybase64_decode($cyph_arr[0]),MCRYPT_MODE_CBCbase64_decode($cyph_arr[1]));
   return 
trim($out);
 }
 
//format of the url string will be http://www.examples.com/index.php?username='abc'&password='abc'
//get the information from the psp via a http request
//this will be string username and string password from the eboot
$username $_GET('username');
$password $_GET('password');

 
//encryption stuff here
 
$str $password;
 
$code 's69963';

 
$cyph easy_crypt($str$code);
 
$dec_string easy_decrypt($cyph$code);
 
//end of ecnryption / decryption
 
//now do some error checking for the user name
if(strlen(username) <= '0') OR (strlen($password) <= '0'){
//create the xml source for retreval or parsing on the psp
header("Location: http://www.example.com/main.php?content=<xml><error>No username</error></xml>");
}else{

//mysql search
$query = ("SELECT * FROM users WHERE username = '$username' AND password = '$password");
$res mysql_query($query) or die("Error 01 occured");
$num_of_rows mysql_num_rows($res); 

//now check to see if they are registered or not
if($num_of_rows >= '1'){
//they are logged in so redirect
header("Location: http://www.example.com/main.php?loggedin=true&username=$username&password=$password"); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
}else{
//they are not logged in
header("Location: http://www.examples.com/main.php?content=<xml><error>You are not registered or you entered your details wrong</error><xml>");
}
}
?>


here is the initial code for the login page, we just need to send a http request to this page with the encrypted code. ive got the encryption done in c but i think its best to keep this part of the project closed source to stop this getting abused.

pspcoder.
Logged


Vincent
Mudkips
C/C++ Developer
Hero Member
*

Karma: +76/-2
Offline Offline

Posts: 1384
9999999.99 points

View Inventory
Send Money to Vincent

Me and my 'Vette


View Profile WWW
« Reply #16 on: December 05, 2007, 11:42:17 AM »

I was thinking of just building a menu system with a state manager that can easily add/remove states to the menu. The program will pretty much be just a menu with a ton of states. This can all be done in C++. I didn't think in going web-based for displaying the content for the pages. I was going to do all the content display in C++, and just do periodic requests. Whenever you go to a different page (menu state), you would have to retrieve that page's data from the server (some graphics, and other stuff). The graphical content that makes up the GUI for the menu should be stored on the PSP's memorystick locally such as the menu graphics and the menu's font. JustCC's state manager would be an awesome little tool for us to use. Although creating a state engine is a piece of cake, that's already done for us.

Now, I'm no expert on XML seeing that I'm just an HTML guy, but it looks like you have embedded C++ code into XML code? So, you will by using XML to do the network/online end of things, right? Yeah, I'm a noob to networking, but I know a little bit on the basics. I have a feeling we are on the same page, but I'm just not getting it due to my lack of knowledge on networking and using XML. Neutral Anyway, it looks good, and I like the idea of having a password to log into the user's accounts. XBox Live and the PNP from the PS3 and the XBox 360 don't appear to have those features. I will look for those features sometime on my PS3 and 360 when I get a chance.
Logged

nathan42100
Give miinaturvat Points!
Administrator
Hero Member
*

Karma: +32/-2
Offline Offline

Posts: 1161
934.18 points

View Inventory
Send Money to nathan42100


View Profile WWW
« Reply #17 on: January 21, 2008, 05:28:27 PM »

Though about this but never took the time to implement it. Try to not make it an acronym for one specific console in case someone wants to do it for something else, such as the ipod touch or the nintendo ds
Logged

All of my work is released under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
dn ʎɐʍ sıɥʇ
Help support my computer projects!

Vincent
Mudkips
C/C++ Developer
Hero Member
*

Karma: +76/-2
Offline Offline

Posts: 1384
9999999.99 points

View Inventory
Send Money to Vincent

Me and my 'Vette


View Profile WWW
« Reply #18 on: January 21, 2008, 07:38:46 PM »

The PSN was only prototype name. I was going to look into other names with the group, but I haven't been able to do hardly anything lately.
Logged

A_Nub
gibbocool rules!
C/C++ Developer
Hero Member
*

Karma: +104/-28
Offline Offline

Posts: 912
3894.18 points

View Inventory
Send Money to A_Nub

Noob am I


View Profile WWW
« Reply #19 on: January 21, 2008, 07:46:27 PM »

Vincent, on the C side try to code every thing in ANSI C that way it can easily be ported to any console with an internet connection and working compiler. Use BEEJ sockets for net connection. As for the GUI side that is all application independent. But make the core portable so you can also use ur comp or iPhone like nathan said to keep connected Wink.
Logged

Code:
      ____________________
 /---/   ---------------   \---\
/   O   |               |   ?   \
| O   O |               | ||  O |
|   O   |_______________|   X   |
\--- (#) () oo PSP oo ()()   ---/
    \-----------------------/
[/CENTER]
InsertWittyName: That's like saying because you wank with your right hank all the time, and one day you wank with your left, that you invented left handed wanking..
Vincent
Mudkips
C/C++ Developer
Hero Member
*

Karma: +76/-2
Offline Offline

Posts: 1384
9999999.99 points

View Inventory
Send Money to Vincent

Me and my 'Vette


View Profile WWW
« Reply #20 on: January 21, 2008, 08:52:03 PM »

Oh ok, I get what you guys are saying now. Yeah, the core was always going to be portable so it can be ran off a laptop and such. I would like to setup a php-browser-based monitoring system so I can check the PSN's status on my iPhone whenever I have need to (I got a new one BTW Razz). If I ever embrase custom firmware, it would be cool to learn more, and possibly be able to integrate teh PSN client into the firmware itself. I hear that DAX is actually setting up some sort of Network Update on the custom firmware so that it can be updated without the need for a PC. Is that true? Has Pandora's Battery become that robust to where it can all be done automatically with a click of a button? Is so, very impressive... very impressive nonetheless...
Logged

Flatmush
Has a normal user title
Administrator
Hero Member
*

Karma: +84/-26
Offline Offline

Posts: 1046
12906.27 points

View Inventory
Send Money to Flatmush

The Omniscient One


View Profile WWW
« Reply #21 on: January 22, 2008, 07:58:32 AM »

You could call it HBN, HomeBrew Network.
Logged

Firmware History: 2.60 -> 2.71 -> 1.50 -> 3.03oe-c

I am nerdier than 66% of all people. Are you nerdier? Click here to find out!I am 62% loser. What about you? Click here to find out!NerdTests.com User Test: The Can I Run A Business Test.

Hehe I'm a "Hero Member" because I bought posts back when they were in the shop.

Creator of FlatEditPSP, funcLib and flAstro
Vincent
Mudkips
C/C++ Developer
Hero Member
*

Karma: +76/-2
Offline Offline

Posts: 1384
9999999.99 points

View Inventory
Send Money to Vincent

Me and my 'Vette


View Profile WWW
« Reply #22 on: January 22, 2008, 09:16:39 AM »

Sounds good to me!
Logged

BlackShark
GDi - Member
Full Member
*

Karma: +1/-25
Offline Offline

Posts: 108
5966.97 points

View Inventory
Send Money to BlackShark

Zdaemon Monster Kill


View Profile WWW
« Reply #23 on: January 28, 2008, 11:00:50 PM »

Looks very nice, Id love something like this, to keep me updated.
Now on making homebrew to go along side this, how would I implement my game with this system?
Logged


<img src="[url]http://www.nerdtests.com/mq/images/mq1.php?id=12035&m=6270365b5946e58ff1f12d60e5016f4dd68da189fae2d2c2a1
" border="0" alt="NerdTests.com User Test: The Zombie attack(long) Test.">
[/url]
A_Nub
gibbocool rules!
C/C++ Developer
Hero Member
*

Karma: +104/-28
Offline Offline

Posts: 912
3894.18 points

View Inventory
Send Money to A_Nub

Noob am I


View Profile WWW
« Reply #24 on: January 28, 2008, 11:21:37 PM »

By writing a server and client or if you are looking for just highscores then HBN will/should provide that functionality via a .c and . H
Logged

Code:
      ____________________
 /---/   ---------------   \---\
/   O   |               |   ?   \
| O   O |               | ||  O |
|   O   |_______________|   X   |
\--- (#) () oo PSP oo ()()   ---/
    \-----------------------/
[/CENTER]
InsertWittyName: That's like saying because you wank with your right hank all the time, and one day you wank with your left, that you invented left handed wanking..
Vincent
Mudkips
C/C++ Developer
Hero Member
*

Karma: +76/-2
Offline Offline

Posts: 1384
9999999.99 points

View Inventory
Send Money to Vincent

Me and my 'Vette


View Profile WWW
« Reply #25 on: January 29, 2008, 09:57:53 AM »

@BlackShark: Yeah, it's like A_Nub said. The client software would be a .prx file that you would link to your application via the makefile, and there's a few other things you would have to do in your source. Rest assured, we will NOT leave you in the dark at all. Wink We'll release documentations and full examples of how to use it. The example will even be hooked up to a server. The thing is that you will have to 'register' your software with us. The reason you will have to do that is so that we can set you up a profile on the server to host whatever data records/information you want to host. I would like to keep this simple, but allow a lot of freedom with this. Think of how bungie.net works. This is kind of a generic version of it. You will be able to customize your space, and do a number of other things to make your space more personalized to the developer that our server is hosting. It'll take a little while though.
Logged

Insert_Witty_Name
Global Moderator
Hero Member
*

Karma: +149/-17
Offline Offline

Posts: 1602
1141.66 points

View Inventory
Send Money to Insert_Witty_Name

View Profile WWW
« Reply #26 on: January 29, 2008, 04:21:09 PM »

The easiest way to implement this would be to do it natively.

I'll be commiting some code to the SDK when I get time to show how to launch the browser as a utility from within a homebrew program.

From there you can do whatever you want, login/register, view high scores etc.

The overall idea is sound in principal, but I'm interesting in hearing your views on security.
Logged

Coder formerly known as:

Check out my homebrew & C tutorials at http://insomniac.0x89.org
Last updated 6th Oct 06 - Tutorial 2 added.
Vincent
Mudkips
C/C++ Developer
Hero Member
*

Karma: +76/-2
Offline Offline

Posts: 1384
9999999.99 points

View Inventory
Send Money to Vincent

Me and my 'Vette


View Profile WWW
« Reply #27 on: January 30, 2008, 01:10:12 PM »

Quote
The overall idea is sound in principal, but I'm interesting in hearing your views on security.
Mr. Green

Any ideas? Cool
Logged

BlackShark
GDi - Member
Full Member
*

Karma: +1/-25
Offline Offline

Posts: 108
5966.97 points

View Inventory
Send Money to BlackShark

Zdaemon Monster Kill


View Profile WWW
« Reply #28 on: January 31, 2008, 11:32:26 PM »

Very nice, I'll definitely be keeping up with this! Can be mighty useful, would this also support servers for multi player and such?.
Logged


<img src="[url]http://www.nerdtests.com/mq/images/mq1.php?id=12035&m=6270365b5946e58ff1f12d60e5016f4dd68da189fae2d2c2a1
" border="0" alt="NerdTests.com User Test: The Zombie attack(long) Test.">
[/url]
10YrOldH4CK3R
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 1
134.19 points

View Inventory
Send Money to 10YrOldH4CK3R

View Profile
« Reply #29 on: April 09, 2010, 07:31:20 AM »

If that were to happen it would be very cool tell me of anyway I can help
Logged
Pages: 1 [2]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.25 seconds with 38 queries.
Sister Sites: Guitar Hero 4   BrokeniTouch.com