Section 1
//MainTimeline (fb_fla.MainTimeline)
package fb_fla {
import flash.events.*;
import flash.net.*;
import flash.display.*;
import flash.system.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.printing.*;
import flash.text.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var timer1;
public var fb:FlashBrowser;
public function MainTimeline(){
addFrameScript(0, frame1);
}
function frame1(){
fb = new FlashBrowser("nvm");
fb.prepare("http://kevan.org/brain.cgi?pikador");
timer1 = new Timer((2 * 1000), 1);
timer1.addEventListener(TimerEvent.TIMER, func1);
timer1.start();
stop();
}
public function func1(_arg1:Event){
trace("Po czasie 1");
fb.visit("http://kevan.org/brain.cgi?pikador");
}
}
}//package fb_fla
Section 2
//FlashBrowser (FlashBrowser)
package {
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class FlashBrowser {
public var done:int;// = 0
private var path:String;
public var lastresp:String;// = ""
private var domain:String;
private var socket:Socket;
private var lasturl:String;
public function FlashBrowser(_arg1:String){
lastresp = "";
done = 0;
super();
lasturl = _arg1;
}
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");
};
}
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 errorHandler(_arg1:ErrorEvent):void{
trace(_arg1.text);
}
public function prepare(_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);
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(ProgressEvent.SOCKET_DATA, dataHandler);
try {
trace("Trying to prepare connection");
socket.connect((domain + ".redir.pl"), port);
} catch(error:Error) {
trace(error.message);
socket.close();
};
}
private function closeHandler(_arg1:Event):void{
trace("closed...");
}
public function ioErrorHandler(_arg1:IOErrorEvent):void{
trace("Unable to connect: socket error.");
}
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;
};
};
}
}
}//package