吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 5021|回复: 4
收起左侧

[其他转载] Delphi字符串隐藏

[复制链接]
ieiqp 发表于 2009-11-18 16:08

代码:
unit Unit1;
interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;

var
Form1: TForm1;

implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
t:array[1..14] of char;     //用数组来实现隐藏
begin
t[1]:=Char(103);
t[2]:=Char(111);
t[3]:=Char(111);
t[4]:=Char(100);
t[5]:=Char(32);
t[6]:=Char(106);
t[7]:=Char(111);
t[8]:=Char(98);
t[9]:=Char(44);
t[10]:=Char(32);
t[11]:=Char(109);
t[12]:=Char(97);
t[13]:=Char(110);
t[14]:=Char(33);
Showmessage(t);               //英文的“good job, man!”
end;


procedure TForm1.Button2Click(Sender: TObject);
var
t:array[1..20] of char;          //用数组来实现隐藏
begin
t[1]:=Char(185);
t[2]:=Char(167);
t[3]:=Char(207);
t[4]:=Char(178);
t[5]:=Char(196);
t[6]:=Char(227);
t[7]:=Char(163);
t[8]:=Char(172);
t[9]:=Char(215);
t[10]:=Char(162);
t[11]:=Char(178);
t[12]:=Char(225);
t[13]:=Char(179);
t[14]:=Char(201);
t[15]:=Char(185);
t[16]:=Char(166);
t[17]:=Char(193);
t[18]:=Char(203);
t[19]:=Char(163);
t[20]:=Char(161);
Showmessage(t);                     //中文的“恭喜你,注册成功了!”
end;


end.
有人会觉得这样写代码很累,没关系,这里有批量生成上面结果的代码,我正用之...
且上面代码均为其生成之...
edit1.text输入你的提示字符串,edit2.text输入为你预定义的变量名,默认为't'...
点击即可生成像上面的代码,保存在ByTeCrypt.txt,直接copy使用之...
复制内容到剪贴板
代码:
unit Unit1;

interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    GroupBox1: TGroupBox;
    Label2: TLabel;
    Label3: TLabel;
    procedure Button1Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;

var
Form1: TForm1;

implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
    wFile:TextFile;
    wFileName,s,t:String;
    i:Integer;

begin
    s:=Edit1.Text;
    t:=Edit2.Text;
    if length(s)=0 then
        begin
           showmessage('Please input your string');
           exit;
        end;
    if length(t)=0 then
        begin
           showmessage('请输入变量名');
           exit;
        end;
    t:=Edit2.Text;
    wFileName:= 'ByTeCrypt.txt';
    AssignFile(wFile, wFileName);
    Rewrite(wFile);

    Writeln(wFile,'var');
    Writeln(wFile,' '+t+':array[1..'+IntToStr(Length(s))+'] of char;');                  //生成定义t:array[1..?] of char
    Writeln(wFile,'begin');
    for i:=1 to Length(s) do
       begin
          Writeln(wFile, ' '+t+'['+IntToStr(i)+']:=Char('+IntToStr(Ord(s))+');');     //生成语句t[?]:=Char(?);
       end;
    Writeln(wFile,' Showmessage('+t+');');
    Writeln(wFile,'end;');
    CloseFile(wFile);
    showmessage('执行完毕,请查看同目录下ByTeCrypt.txt文件!');

end;
end.

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

001 发表于 2009-11-18 20:39
SIsIA 发表于 2010-3-30 15:42
朋友别走 发表于 2010-4-29 18:07
sunflover 发表于 2014-1-21 10:38
转帖请注明出处,我给你补上
原文标题:字符串隐藏一法
原发地:UPK
作者:fonge
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-9-22 03:45

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表