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

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Delphi] DH Junk Code Maker 0.4
« en: 9 Julio 2016, 16:40 pm »

Un programa en Delphi para generar codigo basura y lograr quitar algunas firmas de AV en un malware hecho en Delphi.

Tiene las siguientes opciones :

  • Generar constantes
  • Generar variables
  • Generar varios for
  • Generar funciones con variables
  • Generar funciones con for
  • Generar codigo con todas las funciones anteriores juntas
  • Se puede establecer una lontigud para cada opcion

Una imagen :



El codigo :

Código
  1. // DH Junk Code Maker 0.4
  2. // (C) Doddy Hackman 2016
  3.  
  4. unit junk;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls,
  12.  Vcl.ComCtrls, Vcl.Styles.Utils.Menus, Vcl.Styles.Utils.SysStyleHook,
  13.  Vcl.Styles.Utils.SysControls, Math, Vcl.Menus, Vcl.Imaging.pngimage,
  14.  Vcl.ImgList;
  15.  
  16. type
  17.  TFormHome = class(TForm)
  18.    imgLogo: TImage;
  19.    gbOutput: TGroupBox;
  20.    mmOutput: TMemo;
  21.    gbEnterLength: TGroupBox;
  22.    txtLength: TEdit;
  23.    udLength: TUpDown;
  24.    gbType: TGroupBox;
  25.    cmbOptions: TComboBox;
  26.    gbOptions: TGroupBox;
  27.    btnGenerate: TButton;
  28.    ppOptions: TPopupMenu;
  29.    copy: TMenuItem;
  30.    clear: TMenuItem;
  31.    ilIconos: TImageList;
  32.    procedure btnGenerateClick(Sender: TObject);
  33.    procedure clearClick(Sender: TObject);
  34.    procedure copyClick(Sender: TObject);
  35.  private
  36.    { Private declarations }
  37.  public
  38.    { Public declarations }
  39.  end;
  40.  
  41. var
  42.  FormHome: TFormHome;
  43.  
  44. implementation
  45.  
  46. {$R *.dfm}
  47. // Functions
  48.  
  49. function dh_generate_string(option: string; length_string: integer): string;
  50. const
  51.  letters1: array [1 .. 26] of string = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
  52.    'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
  53.    'x', 'y', 'z');
  54. const
  55.  letters2: array [1 .. 26] of string = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
  56.    'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
  57.    'X', 'Y', 'Z');
  58. const
  59.  numbers: array [1 .. 10] of string = ('0', '1', '2', '3', '4', '5', '6', '7',
  60.    '8', '9');
  61.  
  62. const
  63.  cyrillic: array [1 .. 44] of string = ('?', '?', '?', '?', '?', '?', '?', '?',
  64.    '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
  65.    '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
  66.    '?', '?', '?', '?', '?', '?');
  67.  
  68. const
  69.  no_idea1: array [1 .. 13] of string = ('?', '?', '?', '?', '?', '?', '?', '?',
  70.    '?', '?', '?', '?', '?');
  71.  
  72. const
  73.  no_idea2: array [1 .. 28] of string = ('?', '?', '?', '?', '?', '?', '?', '?',
  74.    '?', '?', '?', '?', '?', '?', '?', '?', '??', '?', '?', '?', '?', '?', '?',
  75.    '?', '?', '?', '?', '??');
  76.  
  77. const
  78.  no_idea3: array [1 .. 13] of string = ('??', '?', '?', '?', '?', '?', '?',
  79.    '_', '?', '`', '?', '_', '?');
  80.  
  81. const
  82.  no_idea4: array [1 .. 26] of string = ('?', '?', '€', '?', 'l', '?', '™', 'O',
  83.    'e', '?', '?', '?', '?', '?', '?', '?', '?', '-', '/', '·', 'v', '8', '?',
  84.    '˜', '?', '=');
  85.  
  86. const
  87.  no_idea5: array [1 .. 33] of string = ('?', '?', '?', '?', 'n', '?', '?', '?',
  88.    '?', '?', '?', 'G', '?', '?', '?', 'e', 'ß', '?', '?', '?', '?', '?', '?',
  89.    '?', '?', '?', '?', '?', '?', '?', '8', 'S', '?');
  90.  
  91. const
  92.  no_idea6: array [1 .. 32] of string = ('?', '?', '?', '?', '?', '?', '?', '?',
  93.    '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
  94.    '?', '?', '?', '?', '?', '?', '?', '?', '?');
  95. var
  96.  code: string;
  97.  gen_now: string;
  98.  i: integer;
  99.  index: integer;
  100. begin
  101.  
  102.  gen_now := '';
  103.  
  104.  for i := 1 to length_string do
  105.  begin
  106.    if (option = '1') then
  107.    begin
  108.      gen_now := gen_now + letters1[RandomRange(1, Length(letters1) + 1)];
  109.    end
  110.    else if (option = '2') then
  111.    begin
  112.      gen_now := gen_now + letters2[RandomRange(1, Length(letters2) + 1)];
  113.    end
  114.    else if (option = '3') then
  115.    begin
  116.      gen_now := gen_now + numbers[RandomRange(1, Length(numbers) + 1)];
  117.    end
  118.    else if (option = '4') then
  119.    begin
  120.      gen_now := gen_now + cyrillic[RandomRange(1, Length(cyrillic) + 1)];
  121.    end
  122.    else if (option = '5') then
  123.    begin
  124.      gen_now := gen_now + no_idea1[RandomRange(1, Length(no_idea1) + 1)];
  125.    end
  126.    else if (option = '6') then
  127.    begin
  128.      gen_now := gen_now + no_idea2[RandomRange(1, Length(no_idea2) + 1)];
  129.    end
  130.    else if (option = '7') then
  131.    begin
  132.      gen_now := gen_now + no_idea3[RandomRange(1, Length(no_idea3) + 1)];
  133.    end
  134.    else if (option = '8') then
  135.    begin
  136.      gen_now := gen_now + no_idea4[RandomRange(1, Length(no_idea4) + 1)];
  137.    end
  138.    else if (option = '9') then
  139.    begin
  140.      gen_now := gen_now + no_idea5[RandomRange(1, Length(no_idea5) + 1)];
  141.    end
  142.    else if (option = '10') then
  143.    begin
  144.      gen_now := gen_now + no_idea6[RandomRange(1, Length(no_idea6) + 1)];
  145.    end
  146.    else
  147.    begin
  148.      gen_now := gen_now + letters1[RandomRange(1, Length(letters1) + 1)];
  149.    end;
  150.  end;
  151.  code := gen_now;
  152.  
  153.  Result := code;
  154. end;
  155.  
  156. function message_box(title, message_text, type_message: string): string;
  157. begin
  158.  if not(title = '') and not(message_text = '') and not(type_message = '') then
  159.  begin
  160.    try
  161.      begin
  162.        if (type_message = 'Information') then
  163.        begin
  164.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  165.            MB_ICONINFORMATION);
  166.        end
  167.        else if (type_message = 'Warning') then
  168.        begin
  169.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  170.            MB_ICONWARNING);
  171.        end
  172.        else if (type_message = 'Question') then
  173.        begin
  174.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  175.            MB_ICONQUESTION);
  176.        end
  177.        else if (type_message = 'Error') then
  178.        begin
  179.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  180.            MB_ICONERROR);
  181.        end
  182.        else
  183.        begin
  184.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  185.            MB_ICONINFORMATION);
  186.        end;
  187.        Result := '[+] MessageBox : OK';
  188.      end;
  189.    except
  190.      begin
  191.        Result := '[-] Error';
  192.      end;
  193.    end;
  194.  end
  195.  else
  196.  begin
  197.    Result := '[-] Error';
  198.  end;
  199. end;
  200.  
  201. //
  202.  
  203. procedure TFormHome.btnGenerateClick(Sender: TObject);
  204. var
  205.  id: string;
  206.  i, y: integer;
  207.  vars, vars2, name, name2, value, value2: string;
  208.  strings, strings2: string;
  209.  functions, code: string;
  210.  limit_random: integer;
  211. begin
  212.  
  213.  if (StrToInt(txtLength.Text) > 0) then
  214.  begin
  215.  
  216.    if (cmbOptions.ItemIndex = 0) then
  217.    begin
  218.      for i := 1 to StrToInt(txtLength.Text) do
  219.      begin
  220.        name := dh_generate_string('1', 5);
  221.        value := dh_generate_string('1', 20);
  222.        mmOutput.Lines.Add('const ' + name + '=' + '''' + value + '''' + ';');
  223.      end;
  224.      mmOutput.Lines.Add('');
  225.    end
  226.    else if (cmbOptions.ItemIndex = 1) then
  227.    begin
  228.  
  229.      vars := 'var ';
  230.      strings := '';
  231.  
  232.      for i := 1 to StrToInt(txtLength.Text) do
  233.      begin
  234.        name := dh_generate_string('1', 5);
  235.        value := dh_generate_string('1', 20);
  236.        if (i = StrToInt(txtLength.Text)) then
  237.        begin
  238.          vars := vars + name + ':string;';
  239.        end
  240.        else
  241.        begin
  242.          vars := vars + name + ',';
  243.        end;
  244.        if (i = StrToInt(txtLength.Text)) then
  245.        begin
  246.          strings := strings + name + ':=' + '''' + value + '''' + ';';
  247.        end
  248.        else
  249.        begin
  250.          strings := strings + name + ':=' + '''' + value + '''' + ';' +
  251.            sLineBreak;
  252.        end;
  253.      end;
  254.  
  255.      id := dh_generate_string('1', 5);
  256.  
  257.      code := 'procedure gen_vars_' + id + ';' + sLineBreak + vars + sLineBreak
  258.        + 'begin' + sLineBreak + strings + sLineBreak + 'end;';
  259.  
  260.      mmOutput.Lines.Add(code);
  261.      mmOutput.Lines.Add('');
  262.  
  263.    end
  264.    else if (cmbOptions.ItemIndex = 2) then
  265.    begin
  266.      vars := 'var i,y:integer;';
  267.      strings := '';
  268.      for i := 1 to StrToInt(txtLength.Text) do
  269.      begin
  270.        value := dh_generate_string('3', 2);
  271.  
  272.        if (i = StrToInt(txtLength.Text)) then
  273.        begin
  274.          strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak +
  275.            sLineBreak;
  276.          strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak +
  277.            'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;';
  278.        end
  279.        else
  280.        begin
  281.          strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' + sLineBreak +
  282.            sLineBreak;
  283.          strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak +
  284.            'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' + sLineBreak
  285.            + sLineBreak;
  286.        end;
  287.      end;
  288.  
  289.      id := dh_generate_string('1', 5);
  290.  
  291.      code := 'procedure gen_fors_' + id + ';' + sLineBreak + vars + sLineBreak
  292.        + 'begin' + sLineBreak + strings + sLineBreak + 'end;';
  293.  
  294.      mmOutput.Lines.Add(code);
  295.      mmOutput.Lines.Add('');
  296.  
  297.    end
  298.    else if (cmbOptions.ItemIndex = 3) then
  299.    begin
  300.      code := '';
  301.      functions := '';
  302.  
  303.      for i := 1 to StrToInt(txtLength.Text) do
  304.      begin
  305.        vars := 'var ';
  306.        strings := '';
  307.        limit_random := StrToInt(dh_generate_string('3', 1));
  308.        if (limit_random = 0) then
  309.        begin
  310.          limit_random := 5;
  311.        end;
  312.        for y := 1 to limit_random do
  313.        begin
  314.          name := dh_generate_string('1', 5);
  315.          value := dh_generate_string('1', 20);
  316.          if (y = limit_random) then
  317.          begin
  318.            vars := vars + name + ':string;';
  319.          end
  320.          else
  321.          begin
  322.            vars := vars + name + ',';
  323.          end;
  324.          if (y = limit_random) then
  325.          begin
  326.            strings := strings + name + ':=' + '''' + value + '''' + ';';
  327.          end
  328.          else
  329.          begin
  330.            strings := strings + name + ':=' + '''' + value + '''' + ';' +
  331.              sLineBreak;
  332.          end;
  333.        end;
  334.  
  335.        id := dh_generate_string('1', 5);
  336.  
  337.        if (i = StrToInt(txtLength.Text)) then
  338.        begin
  339.          functions := 'function gen_vars_' + id + '():string;' + sLineBreak +
  340.            vars + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak +
  341.            'Result :=' + '''' + id + '''' + ';' + sLineBreak + 'end;' +
  342.            sLineBreak;
  343.        end
  344.        else
  345.        begin
  346.          functions := 'function gen_vars_' + id + '():string;' + sLineBreak +
  347.            vars + sLineBreak + 'begin' + sLineBreak + strings + sLineBreak +
  348.            'Result :=' + '''' + id + '''' + ';' + sLineBreak + 'end;' +
  349.            sLineBreak + sLineBreak;
  350.        end;
  351.  
  352.        code := code + functions;
  353.  
  354.      end;
  355.  
  356.      mmOutput.Lines.Add(code);
  357.      // mmOutput.Lines.Add('');
  358.    end
  359.    else if (cmbOptions.ItemIndex = 4) then
  360.    begin
  361.  
  362.      code := '';
  363.  
  364.      for i := 1 to StrToInt(txtLength.Text) do
  365.      begin
  366.  
  367.        vars := 'var i,y:integer;';
  368.        strings := '';
  369.        limit_random := StrToInt(dh_generate_string('3', 1));
  370.  
  371.        if (limit_random = 0) then
  372.        begin
  373.          limit_random := 5;
  374.        end;
  375.        for y := 1 to limit_random do
  376.        begin
  377.          value := dh_generate_string('3', 2);
  378.  
  379.          if (i = limit_random) then
  380.          begin
  381.            strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' +
  382.              sLineBreak;
  383.            strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak +
  384.              'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' +
  385.              sLineBreak;
  386.          end
  387.          else
  388.          begin
  389.            strings := strings + 'i := 0;' + sLineBreak + 'y := 0;' +
  390.              sLineBreak;
  391.            strings := strings + 'for i := 0 to ' + value + ' do' + sLineBreak +
  392.              'begin' + sLineBreak + 'inc(y);' + sLineBreak + 'end;' +
  393.              sLineBreak;
  394.          end;
  395.        end;
  396.  
  397.        id := dh_generate_string('3', 5);
  398.  
  399.        if (i = StrToInt(txtLength.Text)) then
  400.        begin
  401.          functions := 'function gen_fors_' + id + '():integer();' + sLineBreak
  402.            + vars + sLineBreak + 'begin' + sLineBreak + strings + 'Result :=' +
  403.            id + ';' + sLineBreak + 'end;' + sLineBreak;
  404.        end
  405.        else
  406.        begin
  407.          functions := 'function gen_fors_' + id + '():integer();' + sLineBreak
  408.            + vars + sLineBreak + 'begin' + sLineBreak + strings + 'Result :=' +
  409.            id + ';' + sLineBreak + 'end;' + sLineBreak + sLineBreak;
  410.        end;
  411.  
  412.        code := code + functions;
  413.  
  414.      end;
  415.  
  416.      mmOutput.Lines.Add(code);
  417.      // mmOutput.Lines.Add('');
  418.  
  419.    end
  420.    else if (cmbOptions.ItemIndex = 5) then
  421.    begin
  422.  
  423.      code := '';
  424.      functions := '';
  425.  
  426.      for i := 1 to StrToInt(txtLength.Text) do
  427.      begin
  428.  
  429.        vars := 'var ';
  430.        strings := '';
  431.        vars2 := 'var ';
  432.        strings2 := '';
  433.  
  434.        limit_random := StrToInt(dh_generate_string('3', 1));
  435.  
  436.        if (limit_random = 0) then
  437.        begin
  438.          limit_random := 5;
  439.        end;
  440.        for y := 1 to limit_random do
  441.        begin
  442.          name := dh_generate_string('1', 20);
  443.          name2 := dh_generate_string('1', 20);
  444.          value := dh_generate_string('1', 20);
  445.          value2 := dh_generate_string('3', 2);
  446.  
  447.          if (y = limit_random) then
  448.          begin
  449.            vars := vars + name + ':string;';
  450.          end
  451.          else
  452.          begin
  453.            vars := vars + name + ',';
  454.          end;
  455.  
  456.          if (y = limit_random) then
  457.          begin
  458.            strings := strings + name + ':=' + '''' + value + '''' + ';';
  459.          end
  460.          else
  461.          begin
  462.            strings := strings + name + ':=' + '''' + value + '''' + ';' +
  463.              sLineBreak;
  464.          end;
  465.  
  466.          vars2 := 'var i,y:integer;';
  467.  
  468.          if (y = limit_random) then
  469.          begin
  470.            strings2 := strings2 + 'i := 0;' + sLineBreak + 'y := 0;' +
  471.              sLineBreak;
  472.            strings2 := strings2 + 'for i := 0 to ' + value2 + ' do' +
  473.              sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak +
  474.              'end;' + sLineBreak;
  475.          end
  476.          else
  477.          begin
  478.            strings2 := strings2 + 'i := 0;' + sLineBreak + 'y := 0;' +
  479.              sLineBreak;
  480.            strings2 := strings2 + 'for i := 0 to ' + value2 + ' do' +
  481.              sLineBreak + 'begin' + sLineBreak + 'inc(y);' + sLineBreak +
  482.              'end;' + sLineBreak;
  483.          end;
  484.        end;
  485.  
  486.        id := dh_generate_string('1', 5);
  487.  
  488.        if (i = StrToInt(txtLength.Text)) then
  489.        begin
  490.          functions := 'function gen_functions_' + id + '():string;' +
  491.            sLineBreak + vars + sLineBreak + vars2 + sLineBreak + 'begin' +
  492.            sLineBreak + strings + sLineBreak + strings2 + 'Result :=' + '''' +
  493.            id + '''' + ';' + sLineBreak + 'end;' + sLineBreak;
  494.        end
  495.        else
  496.        begin
  497.          functions := 'function gen_functions_' + id + '():string;' +
  498.            sLineBreak + vars + sLineBreak + vars2 + sLineBreak + 'begin' +
  499.            sLineBreak + strings + sLineBreak + strings2 + 'Result :=' + '''' +
  500.            id + '''' + ';' + sLineBreak + 'end;' + sLineBreak + sLineBreak;
  501.        end;
  502.  
  503.        code := code + functions;
  504.      end;
  505.  
  506.      mmOutput.Lines.Add(code);
  507.  
  508.    end;
  509.  
  510.    message_box('DH Junk Code Maker 0.4', 'Enjoy the junk source',
  511.      'Information');
  512.  end
  513.  else
  514.  begin
  515.    message_box('DH Junk Code Maker 0.4',
  516.      'The length should be greater than zero', 'Warning');
  517.  end;
  518. end;
  519.  
  520. procedure TFormHome.clearClick(Sender: TObject);
  521. begin
  522.  mmOutput.clear;
  523.  message_box('DH Junk Code Maker 0.4', 'Output cleaned', 'Information');
  524. end;
  525.  
  526. procedure TFormHome.copyClick(Sender: TObject);
  527. begin
  528.  mmOutput.SelectAll;
  529.  mmOutput.CopyToClipboard;
  530.  message_box('DH Junk Code Maker 0.4', 'Output copied to the clipboard',
  531.    'Information');
  532. end;
  533.  
  534. end.
  535.  
  536. // The End ?
  537.  

Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
Github.

Eso seria todo.


En línea

crack81

Desconectado Desconectado

Mensajes: 222



Ver Perfil
Re: [Delphi] DH Junk Code Maker 0.4
« Respuesta #1 en: 19 Julio 2016, 20:23 pm »

Esta bueno una recomendación trata de separar el código en units para tener un codigo mas limpio
Saludos...


En línea

Si C/C++ es el padre de los lenguajes entonces ASM es dios.
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Pack Source Code of RAT in Delphi « 1 2 »
Análisis y Diseño de Malware
d(-_-)b 10 11,952 Último mensaje 14 Octubre 2010, 19:26 pm
por fary
Pack Source Code of Crypters in Delphi
Análisis y Diseño de Malware
d(-_-)b 2 3,744 Último mensaje 26 Noviembre 2010, 13:19 pm
por NINGUNA1212
[Delphi] DH Virus Maker 0.3
Programación General
BigBear 0 1,845 Último mensaje 30 Enero 2015, 16:03 pm
por BigBear
[Delphi] DH Virus Maker 2.0
Programación General
BigBear 1 1,958 Último mensaje 11 Noviembre 2016, 15:54 pm
por Borito30
[SOURCE-CODE] DDMM (Dummy Drive Mirror Maker)
.NET (C#, VB.NET, ASP)
Eleкtro 7 4,482 Último mensaje 19 Febrero 2018, 20:22 pm
por Eleкtro
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines