Delpi As2

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

unit a;

interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPServer,
IdMappedPortTCP, XPMan, sSkinProvider, sSkinManager, ExtCtrls, sLabel,
ComCtrls, sStatusBar, sGroupBox, sCheckBox, ShellApi, IdIPWatch;
type
TAce = class(TForm)
IdMappedPortTCP1: TIdMappedPortTCP;
Button1: TButton;
Button2: TButton;
GroupBox1: TGroupBox;
EditHost: TEdit;
Button3: TButton;
Label1: TLabel;
sSkinManager1: TsSkinManager;
sSkinProvider1: TsSkinProvider;
XPManifest1: TXPManifest;
sLabelFX1: TsLabelFX;
sLabelFX2: TsLabelFX;
sLabelFX3: TsLabelFX;
sGroupBox1: TsGroupBox;
sGroupBox2: TsGroupBox;
sGroupBox3: TsGroupBox;
sStatusBar1: TsStatusBar;
ip: TsLabel;
Timer2: TTimer;
IdIPWatch1: TIdIPWatch;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure IdMappedPortTCP1OutboundData(AThread: TIdMappedPortThread);
procedure Timer2Timer(Sender: TObject);
procedure sLabelFX2Click(Sender: TObject);
procedure sLabelFX1Click(Sender: TObject);
procedure sLabelFX3Click(Sender: TObject);
procedure IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Ace: TAce;
implementation
{$R *.dfm}
function AddHeader(header, Newheader:string):string;
begin
header := StringReplace(header, #13#10 + #13#10, #13#10 + Newheader + #13#10 + #
13#10, [rfReplaceAll]);
Result := header;
end;

procedure TAce.Button2Click(Sender: TObject);


begin
groupbox1.Visible:= true;
groupbox1.BringToFront;
end;
procedure TAce.Button3Click(Sender: TObject);
begin
groupbox1.Visible:=false;
end;
procedure TAce.Button1Click(Sender: TObject);
begin
with idmappedporttcp1 do begin
if button1.Caption = 'Start' then begin
Bindings.Add.IP := '127.0.0.1';
bindings.Add.Port := 2121;
MappedHost := '10.1.89.130';
MappedPort := 8000;
Active:= true;
button1.Caption:='Stop';
end
else begin
Active:=false;
Bindings.Clear;
button1.Caption:='Start';
end;
end;
end;
procedure TAce.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
var EditHost: string;
begin
with AThread do begin
if Pos('HTTP', NetData) <> 0 then begin
NetData := StringReplace(NetData, sLineBreak+sLineBreak, sLineBreak+
'X-Online-Host: '+EditHost+sLineBreak+
'Front Query: '+EditHost+sLineBreak+
'X-Forward-F: '+EditHost+sLineBreak+
'Set-Cookie: BIGipServerPL_TBSBRN_IST_WAP_GW_PROXY
=289319104.16415.0000; path=/; HttpOnly'+sLineBreak+
'Connection: Keep-Alive'+sLineBreak+sLineBreak, [r
fReplaceAll]);
OutboundClient.Write(NetData);
NetData :='GET http://'+EditHost+'/ HTTP/1.1' + sLineBreak +
'Host: '+EditHost+sLineBreak+
'UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/2
0100101 Firefox/27.0'+sLineBreak;
end;
end;
end;
procedure TAce.IdMappedPortTCP1OutboundData(AThread: TIdMappedPortThread);
begin
if Pos ('HTTP/1.1 504 Gateway Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'504 Gateway Time-out','200 OK'

,[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 504 Gateway Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'504 Gateway Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('504 Gateway Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'504 Gateway Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 503 Service Unavailable', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'503 Service Unavailable','200
OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 503 Service Unavailable', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'503 Service Unavailable','200
OK',[rfReplaceAll]);
end else
if Pos ('503 Service Unavailable', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'503 Service Unavailable','200
OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 502 Bad Gateway', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'502 Bad Gateway','200 OK',[rfR
eplaceAll]);
end else
if Pos ('HTTP/1.0 502 Bad Gateway', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'502 Bad Gateway','200 OK',[rfR
eplaceAll]);
end else
if Pos ('502 Bad Gateway', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'502 Bad Gateway','200 OK',[rfR
eplaceAll]);
end else
if Pos ('HTTP/1.1 500 Internal Server Error', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'500 Internal Server Error','20
0 OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 500 Internal Server Error', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'500 Internal Server Error','20
0 OK',[rfReplaceAll]);
end else
if Pos ('500 Internal Server Error', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'500 Internal Server Error','20
0 OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 408 Request Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'408 Request Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 408 Request Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'408 Request Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('408 Request Time-out', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'408 Request Time-out','200 OK'
,[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 407 Proxy Authentication Required', AThread.NetData) <> 0 then
begin

AThread.NetData := StringReplace(athread.NetData,'407 Proxy Authentication Requi


red','200 OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 407 Proxy Authentication Required', AThread.NetData) <> 0 then
begin
AThread.NetData := StringReplace(athread.NetData,'407 Proxy Authentication Requi
red','200 OK',[rfReplaceAll]);
end else
if Pos ('407 Proxy Authentication Required', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'407 Proxy Authentication Requi
red','200 OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 404 Not Found', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'404 Not Found','200 OK',[rfRep
laceAll]);
end else
if Pos ('HTTP/1.0 404 Not Found', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'404 Not Found','200 OK',[rfRep
laceAll]);
end else
if Pos ('404 Not Found', AThread.NetData) <> 0 then begin
AThread.NetData := StringReplace(athread.NetData,'404 Not Found','200 OK',[rfRep
laceAll]);
end else
if Pos ('HTTP/1.1 403 Forbidden', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'403 Forbidden','200 OK',[rfRep
laceAll]);
end else
if Pos ('HTTP/1.0 403 Forbidden', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'403 Forbidden','200 OK',[rfRep
laceAll]);
end else
if Pos ('403 Forbidden', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'403 Forbidden','200 OK',[rfRep
laceAll]);
end else
if Pos ('HTTP/1.1 400 Bad Request', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'400 Bad Request','200 OK',[rfR
eplaceAll]);
end else
if Pos ('HTTP/1.0 400 Bad Request', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'400 Bad Request','200 OK',[rfR
eplaceAll]);
end else
if Pos ('400 Bad Request', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'400 Bad Request','200 OK',[rfR
eplaceAll]);
end else
if Pos ('HTTP/1.1 307 Temporary Redirect', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'307 Temporary Redirect','200 O
K',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 307 Temporary Redirect', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'307 Temporary Redirect','200 O
K',[rfReplaceAll]);
end else
if Pos ('307 Temporary Redirect', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'307 Temporary Redirect','200 O
K',[rfReplaceAll]);
end else

if Pos ('HTTP/1.1 305 Use Proxy', AThread.NetData) <>0 then begin


AThread.NetData := StringReplace(athread.NetData,'305 Use Proxy','200 OK',[rfRep
laceAll]);
end else
if Pos ('HTTP/1.0 305 Use Proxy', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'305 Use Proxy','200 OK',[rfRep
laceAll]);
end else
if Pos ('305 Use Proxy', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'305 Use Proxy','200 OK',[rfRep
laceAll]);
end else
if Pos ('HTTP/1.1 302 Found', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'302 Found','200 OK',[rfReplace
All]);
end else
if Pos ('HTTP/1.0 302 Found', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'302 Found','200 OK',[rfReplace
All]);
end else
if Pos ('302 Found', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'302 Found','200 OK',[rfReplace
All]);
end else
if Pos ('HTTP/1.0 302 Moved Temporarily', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'302 Moved Temporarily','200 OK
',[rfReplaceAll]);
end else
if Pos ('302 Moved Temporarily', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'302 Moved Temporarily','200 OK
',[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 301 Moved Permanently', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'301 Moved Permanently','200 OK
',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 301 Moved Permanently', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'301 Moved Permanently','200 OK
',[rfReplaceAll]);
end else
if Pos ('301 Moved Permanently', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'301 Moved Permanently','200 OK
',[rfReplaceAll]);
end else
if Pos ('HTTP/1.1 101 Switching Protocols', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'101 Switching Protocols','200
OK',[rfReplaceAll]);
end else
if Pos ('HTTP/1.0 101 Switching Protocols', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'101 Switching Protocols','200
OK',[rfReplaceAll]);
end else
if Pos ('101 Switching Protocols', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,'101 Switching Protocols','200
OK',[rfReplaceAll]);
end else
if Pos (' Set-Cookie', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(AThread.NetData,' Set-Cookie',' 200 OK',[rfRepl
aceAll]);
end else

if Pos (':80', AThread.NetData) <>0 then begin


AThread.NetData := StringReplace(athread.NetData,':80',':443',[rfReplaceAll]);
end else
if Pos (':22', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,':22',':443',[rfReplaceAll]);
end else
if Pos (':109', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,':109:',':443',[rfReplaceAll]);
end else
if Pos (':143', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(athread.NetData,':143',':443',[rfReplaceAll]);
end else
if Pos (' %2f', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(AThread.NetData,' %2f',' /',[rfReplaceAll]);
end else
if Pos (' %20', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(AThread.NetData,' %20',' _',[rfReplaceAll]);
end;
end;

procedure TAce.Timer2Timer(Sender: TObject);


begin
ip.Caption := IdIpWatch1.LocalIP;
end;
procedure TAce.sLabelFX2Click(Sender: TObject);
begin
ShellExecute(Handle, 'open', 'https://www.facebook.com/febriantheyellowflash',ni
l,nil, SW_SHOWNORMAL);
end;
procedure TAce.sLabelFX1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open', 'http://pokkt.com/pm/1c159920dc3be4bc94bd7a25eeda2d
55',nil,nil, SW_SHOWNORMAL);
end;
procedure TAce.sLabelFX3Click(Sender: TObject);
begin
ShellExecute(Handle, 'open', 'https://www.facebook.com/groups/1513110125604454/'
,nil,nil, SW_SHOWNORMAL);
end;
end.

You might also like