views:

356

answers:

2

Lately I have been interested in the code behind chatroulette.com. As you probably know it is a peer-to-peer webcam-chat-service written in actionscript, as I understand. What i have been wondering about is weather its possible to extract the ip-address of whomever you are currently communicating with. I have seen services that do that, but they require that you install a program that runs alongside on your computer sniffing UDP-packages. I was wondering if there was a simpler method.

What I do know is that the javascript on the page communicates with the application via "ExternalInterface". On this area I am pretty much a novice but according to my limited understanding you cant get information from the flash-application unless you have configured a listener for a call from javascript and then attach a callback to that event. Is this correct or can you access public functions and variables directly through javascript?

There is for example a public function like this:

public function get outgoingAddress():String{
    return (this.__info.outgoingAddress);
}

Can it be accessed directly through javascript?

If it cant be done so easily, is it possible to decompile the .swf-file, change it (add some functions) and recompile it and run it instead? I am hoping someone can satisfy my curiosity here.

+1  A: 

No, arbitrary public functions cannot be called through JavaScript. You need to use ExternalInterface.

ExternalInterface.addCallback("outgoingAddress", outgoingAddress);
Cory Petosky
+1  A: 

Not the most ethical of questions. But, for educational purposes, you might want to check out re-routing files. There is an article about it here: http://9mmedia.com/blog/?p=676

So in short, yes, of course it's possible to decompile, add some functions, and use the modified version instead. However, ethically it's just wrong. The code isn't yours and you're probably violating the license, and terms and conditions. But the theory is sound.

Joony