NXT-Spy – Start of the project

Yeay it’s the beginning of my honours project!

To start with something, I have decided to start a blog because it implies finding a name and doing a good graphical design for it. For the name, it will be NXT-spy (NXT because the robot used is a Lego Mindstorm NXT robot and spy because the aim of this project is to mount a camera on the robot and have a wider control range).

Because I want to have a 3D model of the Lego robot (to illustrates my presentations and this website), and because I own a version of SolidWorks, I have started looking for the Lego NXT parts on internet.

I finally found what I was looking for on this website : http://www.education.rec.ri.cmu.edu/content/lego/solid_model/index.htm.
Also, because I really think that I;m going to use my brand new Nokia N900 for the embedded phone, I have started modeling it too.

I’m waiting to see Jon Kerridge (my supervisor) to ask him to show me which robot I’m going to use for this project in order to model the robot on SolidWorks with the Lego parts I have found.

Get the stream (pls) of a streamtheworld radio

If like me you are listening to some webradios, you probably have faced this problem : a lot of radios are broadcasting over the web via an embedded flash player to force you to go on their website to be able to listen to it.

So if you want to get the actual audio stream URL (pls or m3u), the widely used solution is to take a look at the requests that the player is sending to its server (with the NET tab of Firebug on Firefox per example).
But it sometimes happens that the URL you get is not an audio stream but a flash file with a buffering system so in this case, you cannot use it on your favorite webradio player (or on your N900 like me :p).

So, let’s get to the point of this post : if the radio you want is a streamtheworld stream (like the radio I wanted to get : Radio CKOI), I’ve got a really simple solution for you :
First of all, use Firebug on Firefox to see the requests that the player is doing and try to locate a request that looks like : http://38.100.101.69/CKOIFMAAC?streamtheworld_user=1&nobuf=1271075550431.
Once that you have done so, you just have to use the stream ID this URL provided you : CKOIFMAAC in this example.

The URL you are looking for is : http://provisioning.streamtheworld.com/pls/{theIDofTheStream}.pls

Decompile a SWF file on Windows

I have recently discovered a great tool to decompile SWF animations (I needed a tool to extract the animation of a game to add design to one of my school projects).

So the only free solution I have found is called SWFTools. But the problems are that you don’t have any GUI for the tools that it provides so you have to do all the operations with the console and that you cannot extract all the objects at a time : you have to specify the ID of the object you want to extract!

So I have written a little batch script to extract all the objects automatically :

First of all, you have to create a sub-folder in your SWFTools folder (“badger” in this example).
Then copy the swf file you want to decompile in your SWFTools folder (“badger.swf” in this example).
Then decide how many objects you want to try to extract (200 in this example), it depends on the size of the swf file. The bigger the number the longer it will take.

Then create a bat file in your SWFTools folder, edit it with notepad, copy/paste the following script in it and finally replace the values.

:: To extract all the elements of the animation
FOR /L %%i IN (0,1,200) DO (
swfextract.exe -i %%i -o badger/%%i.swf badger.swf
)

:: To ajust the dimentions of the windows
FOR /L %%i IN (0,1,200) DO (
swfbbox.exe -o badger/%%i.swf -Oe badger/%%i.swf
)

Once you have extracted the object you were looking for (123.swf in this example), if you want to extract the png images of the different frames, copy paste it to the SWFTools folder and execute the following script.

:: To extract all the images of an animation
FOR /L %%i IN (0,1,50) DO (
swfextract.exe -p %%i -o badger/%%i.png 123.swf
)

Else, if you want to extract the vectors from the swf you have isolated, use Flash Exploit