,  , Delphi

 
 
 
:  :  - 419,   - 4.60
S9
648 / 251 / 87
: 18.12.2010
: 541
#1

- Delphi

01.04.2011, 08:30. 62956. 70
( )


,

. - ,

.
.
1. ,
.
2. , .
. .
, , (
). .
, -
. , .
, .
3. .
.
, - .
, . -
. , , "" (4 , 4 32 ),
- , 32- .
.
4. , 3.
, - .
, - - . - -
, . .
, .
.: Delphi 7
1. .

TEST_FILE:File Of Byte; //,
CS:Byte;//
Res:Integer;//
Sum:Integer;//
:
1) Sum
2)
a.
.
Sum .
Sum;
Sum:=0;

While Not Eof(TEST_FILE) Do Begin//
Read(TEST_FILE,CS);//
Sum:=Sum+CS;//
End;
..
- , 10000.
Res:=Sum Mod 10000;
Res , .
. 1 Memo, 1 OpenDialog 2 SpeedButton
TEST_FILE
( implementation),..

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var
TEST_FILE:File Of Byte;//     
//
 
Procedure TForm1.SpeedButton1Click(Sender: TObject);
Begin
Memo1.Lines.Clear;// 
OpenDialog1.Filter:='  ( *.* )';
If OpenDialog1.Execute Then
AssignFile(TEST_FILE,OpenDialog1.FileName);// 
// TEST_FILE   
End;
Procedure TForm1.SpeedButton2Click(Sender: TObject);
Var
CS:Byte;
Res:Integer;//   
Sum:Integer;//   
Begin
Sum:=0;//  
Reset(TEST_FILE);//   
While Not Eof(TEST_FILE) Do Begin//   
Read(TEST_FILE,CS);//    
Sum:=Sum+CS;//     
End;
Res:=Sum Mod 10000;//     
//
//..       
Memo1.Lines.Text:=IntToStr(Res);// 
CloseFile(TEST_FILE);
End;
2.
( ) :
.
, .
DecToBin ( )
BinToDec( )
StrToBin ( )
FirstEight( 8 )
DecToBin
. Pascal
1 2 1 (
2) StringConst,
.. 1, ( 0).
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Function DecToBin(Int:Longint):String;
Var
StringConst:String[2];
Begin
StringConst:='01';
Result:='';//  
Repeat
// Int Mod 2 = 0(..  0)   ,
// Int Mod 2 = 1,    
Result:=StringConst[(Int Mod 2)+1] + Result;
Int:=Int Div 2;//    2
Until Int=0;
End;
{   DecToBin }
BinToDec
,
. .
DecValue*2 (DecValue ) 1 0
Value ( ) . ,
Digit 1, 1 Digit 2. ,
1. , DecValue
. IntToStr
. .
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
Function BinToDec(Value:String):String;
Var
i:SmallInt;// SmallInt     -32768  32767
DecValue:Integer;
Digit:String[2];
Begin
Digit:='01';
DecValue:=0;
For i:=1 To Length(Value) Do
DecValue:=DecValue*2+Pos(Value[i],Digit)-1;
Result:=IntToStr(DecValue);
End;
{   BinToDec }
StrToBin
( ).
.
(
DecToBin ). i-
Ord. Chr(100) d Ord(d) = 100.
DecToBin TempString.
1 8(.. 1 , 1 8 )
. ( ) 8 .
8-Length(TempString) ,
TempString. BinString.
TextValue.
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Function StrToBin(TextValue:String):String;
Var
TempString:String;
OctString:String;
BinString:String;
i,k:SmallInt;
Begin
For i:=1 To Length(TextValue) Do Begin
TempString:=DecToBin(Ord(TextValue[i]));// i-  
//     TempString
OctString:=;
If Length(TempString)<8 Then Begin//  TempString<8
For k:=1 To 8-Length(TempString) Do Begin//  
OctString:=OctString+'0';// 8-Length(TempString)  
//
End;
End;
TempString:=OctString+TempString;//  TempSting
BinString:=BinString+TempString;//    
Result:=BinString;//  
End;
End;
{  StrToBin }
FirstEight
. 8 .
: 8
.
Delphi
1
2
3
4
5
6
7
8
Function FirstEight(Str:String):String;
Var
i:SmallInt;
Begin
For i:=1 To 8 Do
Result:=Result+Str[i];
End;
{  FirstEight }
. .
3 , 1 OpenDialog ( Dialog) 1Edit.
, . : -
( , 8*n , n
), Edit ,
2.txt. .
(2.txt) , Edit1
.

.

Delphi
1
2
3
4
5
6
7
8
9
// FileName  , ..  Implementation
//        FileName  
//-
Begin
FileName:=;
OpenDialog1.Filter:='  (* . *)';
If OpenDialog1.Execute Then
FileName:=OpenDialog1.FileName;
End;
1. .

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Var
i:SmallInt;
MY_IN_FILE:TextFile;// -
MY_OUT_FILE:TextFile;// -   
RecString:String;
BinString:String;
Begin
Try // Try  Except  
RecString:=;
BinString:=StrToBin(Edit1.Text);//  Edit1
//        BinString
AssignFile(MY_IN_FILE,FileName);//  MY_IN_FILE 
// 
AssignFile(MY_OUT_FILE,2.txt);//  2.txt 
// MY_OUT_FILE
Reset(MY_IN_FILE);// MY_IN_FILE  
ReWrite(MY_OUT_FILE);//  MY_OUT_FILE  
i:=1;
While Not Eof(MY_IN_FILE) Do //   -
Begin
ReadLn(MY_IN_FILE,RecString);//    
If BinString[i]='1' Then//     1 
Insert(' ',RecString,Length(RecString)+1);//   
//,     0      
//  
WriteLn(MY_OUT_FILE,RecString);//    
Inc(i); // i  1,     
End;
CloseFile(MY_IN_FILE); // -
CloseFile(MY_OUT_FILE); //   
MessageDlg('  !',mtInformation, [mbOK], 0);//
  //
Except //     
MessageDlg(' ',mtError, [mbOK], 0);
End;
End;
2. .
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Var
TempString:String;
OutString:String;//   
RecString:String; //     
BinString:String;
DecValue,i,j:SmallInt;
MY_DECRYPT:TextFile;//-  
Begin
Try// Try  Except     
AssignFile(MY_DECRYPT,FileName);// -  
//    MY_DECRYPT.   FileName  ,
//        
Reset(MY_DECRYPT); //   
While Not Eof(MY_DECRYPT) Do//  
Begin
ReadLn(MY_DECRYPT,RecString); //    
If RecString[Length(RecString)]=' ' Then//   
//    BinString  1,   0
BinString:=BinString+'1' Else BinString:=BinString+'0';
End;
For i:=0 To Trunc(Length(BinString) Div 8) Do//..  
//   BinString  Trunc(Length(BinString) Div 8).
//Trunc     
Begin
TempString:=FirstEight(BinString);//   TempString
// 8   BinString (    
//1  
OutString:= OutString+Chr(StrToInt(BinToDec(TempString)));
//  OutString   .   
//.     TempString(   8
//,..   ), (   String)
//  Integer(   ,   )  
//Chr     .   
//   OutString.   OutString   
If Chr(StrToInt(BinToDec(FirstEight(BinString))))=#0 Then Break;
//     (#0  Chr(0)  
//   ,     )    
Delete(BinString,1,8);//    8 , 
//     
End;
Edit1.Text:=OutString;//  Edit1  
ShowMessage('  ');
CloseFile(MY_DECRYPT);// 
Except//     
ShowMessage('  ');
End;
End;
3. 2.
: .
2.
(3 , 1 Edit 1 OpenDialog ). 2.
.
.
Insert. :
If RecString[i]= Then Insert( ,RecString,i);
i RecString , .
: 1,
.
If(RecString[i]= ) And (RecString[i+1]= ) Then Bin:=Bin+1;
If(RecString[i]= ) And (RecString[i+1]<> ) Then Bin:=Bin+0;
. )

1. .
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Var
i:SmallInt;
k:LongInt;
BinString:String;//    
RecString:String; //    
MY_IN_FILE:TextFile; //-
MY_OUT_FILE:TextFile; //-  
Begin
AssignFile(MY_IN_FILE,FileName);// -
// MY_IN_FILE.   FileName  ,   
//     
AssignFile(MY_OUT_FILE,3.txt); //  3.txt 
//   -    
//   MY_OUT_FILE.
Reset(MY_IN_FILE);// -  
ReWrite(MY_OUT_FILE);//   
BinString:=StrToBin(Edit1.Text);//  BinString 
//    Edit1
k:=1; // k:=1     BinString 
// 
While Not Eof(MY_IN_FILE) Do //   
Begin
ReadLn(MY_IN_FILE,RecString);//    
For i:=1 To Length(RecString) Do//   
Begin
If RecString[i]=' ' Then//    
//     
Begin
Case BinString[k] Of
'1':Insert(' ',RecString,i);//   1    
//
'0':Insert('',RecString,i);//   0    
End;
Inc(k);// k  1     
End;
End;
WriteLn(MY_OUT_FILE,RecString); //    
End;
CloseFile(MY_OUT_FILE); // -
CloseFile(MY_IN_FILE); // -  
//
ShowMessage(' '); //    
End;
2. .
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Var//      2
i,k:SmallInt;
TempString:String;
DecString:String;
BinString:String;
RecString:String;
MY_DECRYPT:TextFile;
Begin
AssignFile(MY_DECRYPT,FileName);// -  
//    MY_DECRYPT.   FileName  ,
//        
Reset(MY_DECRYPT);//   
While Not Eof(MY_DECRYPT) Do//    
Begin
ReadLn(MY_DECRYPT,RecString);//    
For i:=1 To Length(RecString) Do//   
Begin
k:=i+1;// k     i- 
If(RecString[i]=' ') And (RecString[k]=' ') Then BinString:=BinString+'1';
//      BinString  1
If(RecString[i]=' ') And (RecString[k]<>' ') Then BinString:=BinString+'0';
//       BinString  0
End;
End;
For i:=0 To Trunc(Length(BinString) Div 8) Do//..   
//  BinString  Trunc(Length(BinString) Div 8). Trunc
//    .   8 ..  1  = 8 
Begin
TempString:=FirstEight(BinString);//   TempString
// 8 
DecString:=DecString+Chr(StrToInt(BinToDec(FirstEight(BinString))));
//    TempString(  )   
//  DecString    
If Chr(StrToInt(BinToDec(FirstEight(BinString))))=#0 Then Break;
//        
Delete(BinString,1,8);//  8    
// 
End;
ShowMessage(' ');
Edit1.Text:=DecString;//   Edit
CloseFile(MY_DECRYPT);// 
End;
4. , 3.
, - .
, - - . -
- , . .
2 (DecToBin, BinToDec, StrToBin
FirstEight).
.
2 3,
2 3.

1. .
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Var
i:SmallInt;
k:LongInt;
Bin:String;//     
Rec:String;
IN_FILE:TextFile;//-
OUT_FILE:TextFile;// -   
Begin
Try// Try  Except  
AssignFile(IN_FILE,FileName); // -
// MY_IN_FILE.   FileName  ,   
//     
AssignFile(OUT_FILE,'4.txt');//  4.txt  
//  -    
//   MY_OUT_FILE.
Reset(IN_FILE);// -  
ReWrite(OUT_FILE);// -  
Bin:=StrToBin(Edit1.Text);// StrToBin  
//Edit1         Bin
k:=1;
While Not Eof(IN_FILE) Do//    
Begin
ReadLn(IN_FILE,Rec);//  
For i:=1 To Length(Rec) Do//    
Begin
If ((Rec[i]='')// i-     
Or (Rec[i]='')
Or (Rec[i]='') // Or   , ..  
Or (Rec[i]='') // Rec[i]    
Or (Rec[i]='') //    (,,,,  )  
Or (Rec[i]='') //,    
Or (Rec[i]='')
Or (Rec[i]='')
Or (Rec[i]='')
Or (Rec[i]='')
Or (Rec[i]='')
Or (Rec[i]='')) Then
Begin
If Bin[k]='1' Then// k-   Bin  1 
Begin//    i-   Rec    
// 
If Rec[i]='' Then Rec[i]:='e'; //Rus->Eng
If Rec[i]='' Then Rec[i]:='a';
If Rec[i]='' Then Rec[i]:='o';
If Rec[i]='' Then Rec[i]:='E';
If Rec[i]='' Then Rec[i]:='A';
If Rec[i]='' Then Rec[i]:='O';
If Rec[i]='' Then Rec[i]:='c';
If Rec[i]='' Then Rec[i]:='p';
If Rec[i]='' Then Rec[i]:='x';
If Rec[i]='' Then Rec[i]:='E';
If Rec[i]='' Then Rec[i]:='C';
If Rec[i]='' Then Rec[i]:='X';
End;
Inc(k); //  k (  1),  
//  
End;
End;
WriteLn(OUT_FILE,Rec); //    -
// 
End;
CloseFile(OUT_FILE); //   
CloseFile(IN_FILE);
MessageDlg(' ',mtInformation, [mbOK], 0);//
//   
Except//   
ShowMessage(' '); //  
End;
2. .
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Var
i:Smallint;
Temp:String;
Res:String; //    
Bin:String;
Rec:String;
DECRYPT:Textfile;//-   
Begin
Try// Try  Except  
Assignfile(DECRYPT,Filename);// -  
//    MY_DECRYPT.   FileName  ,
//      OnClick   
Reset(DECRYPT);//   
Bin:='';
While Not Eof(DECRYPT) Do
Begin
Readln(DECRYPT,Rec);//    
For i:=1 To Length(Rec) Do//    
Begin
Case Rec[i] Of // i-    
//-        Bin '0' 
//'1'(     '1',       '0'
'E':Bin:=Bin+'1';//  
'A':Bin:=Bin+'1';
'O':Bin:=Bin+'1';
'A':Bin:=Bin+'1';
'E':Bin:=Bin+'1';
'O':Bin:=Bin+'1';
'C':Bin:=Bin+'1';
'P':Bin:=Bin+'1';
'X':Bin:=Bin+'1';
'C':Bin:=Bin+'1';
'P':Bin:=Bin+'1';
'X':Bin:=Bin+'1';
'':Bin:=Bin+'0';//  
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
'':Bin:=Bin+'0';
End;
End;
End;
For i:=0 To Trunc(Length(BinString) Div 8) Do//..  
//   BinString  Trunc(Length(BinString) Div 8).
//Trunc     
Begin
Temp:=Firsteight(Bin);//  8    Bin
Listbox1.Items.Add(Temp+' '+Chr(Strtoint(Bintodec(Firsteight(Bin)))));
If Temp='00000000' Then Break;//   Chr(0)  
//         
Temp:='';
Res:=Res+Chr(Strtoint(Bintodec(Firsteight(Bin))));
Delete(Bin,1,8); //   Bin  8 , 
//  8
End;
ShowMessage(' ');//   
//
Edit1.Text:=Res;//  Edit1  
Closefile(DECRYPT);// 
Except//   
ShowMessage('- ...');// 
End;
End;
.
22
 : rar S9.rar (1.03 , 525 )
? .
Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
01.04.2011, 08:30
(Delphi):


. ...


! . . ...

.
, jpeg....

LSB BMP
: ...


php. ...


, 0x48k, ? ...

70
S9
648 / 251 / 87
: 18.12.2010
: 541
09.07.2011, 20:41  [] #2
. - .
, .
2

----------------------------------------------- ------------------------------------------------
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Var
   BAG,OUT_FILE:TextFile;// BAG  -,   OUT_FILE   (.. -  
   Cell,i,j:Byte;
   Messg,s:String; // Messg  ,   
Begin
  Messg:=Memo1.Text;//  Memo   Messg 
  OpenDialog1.Filter:=' ';
If OpenDialog1.Execute Then//   , 
  Begin
  AssignFile(BAG,OpenDialog1.FileName);//  BAG ,    OpenDilog
  Reset(BAG);//   
  AssignFile(OUT_FILE,'  2.txt');
  ReWrite(OUT_FILE);//     -  
  For i:=1 To Length(Messg) Do//    Messg  
    Begin
      Cell:=Ord(Messg[i]); //   ( ,       0  255..  ASCII
      For j:=1 To 8 Do//..  1  = 8 ,     , ..   ,   
        Begin
          ReadLn(BAG,s);//   -
          If Cell And 1 = 1 Then//     1 
            s:=s + ' ';//   
          WriteLn(OUT_FILE,s);//    
          Cell:=Cell Shr 1;//   1 
        End;
    End;
  Form1.Caption:=' ';// ,   
  End
Else//       ,     
  Form1.Caption:='  -...';
If Not Eof(BAG) Then//    -, 
    While Not Eof(BAG) Do//    -   (.. OUT_FILE)
      Begin
        If Eof(BAG) Then Break;
          ReadLn(BAG,s);
          WriteLn(OUT_FILE,s);
      End;
 
  CloseFile(BAG);// ,  
  CloseFile(OUT_FILE);
End;
--------------------------------------------- ----------------------------------------------
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Var
  DECRYPT:TextFile;//   
  i,cell:Byte;
  s:String;
Begin
  OpenDialog1.Filter:=' -';
  OpenDialog1.Execute;
  AssignFile(DECRYPT,OpenDialog1.FileName);
  Reset(DECRYPT);
 
  While Not Eof(DECRYPT) Do// ,    
    Begin
      cell:=0;//   
      For i:=1 To 8 Do//    
        Begin
          cell:=cell Shr 1;//  1  
          ReadLn(DECRYPT,s);//        s
          If s[Length(s)] = ' ' Then//   , 
            cell:=cell Or 128;// 1   
// 128    128 = 1000 0000   ,      cell:=cell Or 128     1,    cell:=cell Or 128 ( s[Length(s)] = ' ' )   0(..      1    cell:=cell Shr 1).  
        End;//   8    cell   
        Memo1.Text:=Memo1.Text + Chr(cell);//    Memo
    End;
    CloseFile(DECRYPT);
End;
3

----------------------------------------------- ------------------------------------------------
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Var
  BAG,OUT_FILE:File Of Byte;//..        ,      .
  Messg:String;
  i,j:Integer;
  b,cell:Byte;
Begin
  OpenDialog1.Filter:=' ';
  IF OpenDialog1.Execute Then
    Begin
      AssignFile(BAG,OpenDialog1.FileName);
      Reset(BAG);
      AssignFile(OUT_FILE,'  3.txt');
      ReWrite(OUT_FILE);
      Messg:=Memo1.Text;
      For i:=0 To Length(Messg) Do
        Begin
          Cell:=Ord(Messg[i]);
            For j:=1 To 8 Do
              Begin
              If Eof(BAG) Then Break;//   ,    .           
                Repeat//..  ,           (  -  )
                  Read(BAG,b);
                  Write(OUT_FILE,b);
                Until b = 32;//   ,     (32  ASCII    ) 
              If cell And 1 = 1 Then
                Begin
                  b:=32;
                  Write(OUT_FILE,b);//   1      
                End; 
              cell:=cell Shr 1;
              End;
        End;
//      2.          -
If Not Eof(BAG) Then
        While Not Eof(BAG) Do
          Begin
          If Eof(BAG) Then Break;
            Read(BAG,cell);
            Write(OUT_FILE,cell);
          End;
        CloseFile(BAG);
        CloseFile(OUT_FILE);
    End
  Else
    Form1.Caption:='  ...';
End;
--------------------------------------------- ----------------------------------------------
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Var
  DECRYPT:File Of Byte;
  cell,b:Byte;
  i:Integer;
Begin
  OpenDialog1.Filter:='O -  ';
  If OpenDialog1.Execute Then
    Begin
      AssignFile(DECRYPT,OpenDialog1.FileName);
      Reset(DECRYPT);
    While Not Eof(DECRYPT) Do
      Begin
        cell:=0;
        For i:=1 To 8 Do
          Begin
            cell:=cell Shr 1;//  1  .     2
            Repeat
              Read(DECRYPT,b); // ,    
            Until b = 32;
              If Eof(DECRYPT) Then Break;//       ,      
            Read(DECRYPT,b);
            If b = 32 Then//      2
              cell:=cell Or 128;
          End;
          Memo1.Text:=Memo1.Text + Chr(cell);
      End;
      CloseFile(DECRYPT);
    End
  Else
    Form1.Caption:='  ...';
End;
4

----------------------------------------------- ------------------------------------------------
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Var
 BAG,RES:File Of Byte;
 i,j,cnt:Integer;
 b,cell:Byte;
 index:Integer;
 Messg:String;
Const
  Rus:Array[1..17] Of Char = ('','','','','','','','','','','','','','','','','');
  Eng:Array[1..17] Of Char = ('A','a','B','E','e','K','M','H','O','o','P','p','C','c','T','x','X');
Begin
 OpenDialog1.Execute;
 Messg:=Memo1.Text;
 AssignFile(BAG,OpenDialog1.FileName);
 AssignFile(RES,'  4.txt');
 Reset(BAG);
 ReWrite(RES);
For cnt:=0 To Length(Messg)+1 Do
  Begin
    cell:=Ord(Messg[cnt]);
    For i:=1 To 8 Do
      Begin
        index:= 0; 
        Repeat
          Read(BAG,b);
            For j:=1 To 17 Do//    
              If b = Ord(Rus[j]) Then//  -,
                index:=j;          //   
          If index = 0 Then //   . -, 
            Write(RES,b); //      
        Until index <> 0; 
        If cell And 1 = 1 Then
          b:=Ord(Eng[index]); // -
          Write(RES,b);
          cell:= cell Shr 1;
      End;
  End;
If Not Eof(BAG) Then
  While Not Eof(BAG) Do
    Begin
      If Eof(BAG) Then Break;
      Read(BAG,cell);
      Write(RES,cell);
    End;
 CloseFile(BAG);
 CloseFile(RES);
End;
--------------------------------------------- ----------------------------------------------
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Var
 DECRYPT:File Of Byte;
 i,j:Integer;
 cell,b:Byte;
 index:Integer;
Const
  Rus:Array[1..17] Of Char = ('','','','','','','','','','','','','','','','','');
  Eng:Array[1..17] Of Char = ('A','a','B','E','e','K','M','H','O','o','P','p','C','c','T','x','X');
Begin
  OpenDialog1.Execute;
  AssignFile(DECRYPT,OpenDialog1.FileName);
  Reset(DECRYPT);
While Not Eof(DECRYPT) Do
  Begin
    b:=0;
      For i:=1 To 8 Do
        Begin
          b:= b Shr 1;
          index:= 0; 
        Repeat
          If Eof(DECRYPT) Then Break;
          Read(DECRYPT,cell); 
          For j:=1 To 17 Do
            If (cell = Ord(Rus[j])) Or (cell = Ord(Eng[j])) Then//         (.. -  -)   index,    
              index:=j; 
        Until index <> 0; 
      If cell = Ord(Eng[index]) Then
        b:=b Or 128; 
      End;
      Memo1.Text:=Memo1.Text + Chr(b);
  End;
  CloseFile(DECRYPT);
End;
( ), , . , ( )
12
 : rar .rar (661.5 , 382 )
Lirrk
09.08.2011, 11:28 #3
. . , . .
. . .
. , 1, . 0 - A0h . , . , .
.
. RTF . , .
1
aidoqa
587 / 100 / 2
: 08.02.2011
: 839
18.03.2012, 14:44 #4
.BMP?
1
aaleksander
111 / 85 / 21
: 06.06.2011
: 397
: 1
20.03.2012, 16:42 #5
aidoqa
.BMP?
24- , 3 .
, ( RGB(134, 56, 78) RGB(135, 56, 79)).
, .
, 8 , - 2.66 ( 2 , 32- ).

- , .
, , , .
1
deathNC
1891 / 1004 / 123
: 08.12.2009
: 2,792
: 2
22.03.2012, 06:54 #6
JPG
JPG -
-

:

WinRAR

2
 : 7z 136828bs.7z (210.3 , 146 )
deathNC
1891 / 1004 / 123
: 08.12.2009
: 2,792
: 2
22.03.2012, 06:55 #7
... ... , jpg - , .
- - , jpg . - - ...
2
aidoqa
587 / 100 / 2
: 08.02.2011
: 839
22.03.2012, 07:35 #8
deathNC
-
Unix. . ?
1
deathNC
1891 / 1004 / 123
: 08.12.2009
: 2,792
: 2
22.03.2012, 07:42 #9
aidoqa, RAR' .
jpg. BMP ( )
, . ( hex-), rar jpg

1

:

- - - , ...

2
aidoqa
587 / 100 / 2
: 08.02.2011
: 839
22.03.2012, 07:46 #10
deathNC
,
?
deathNC
.
) )
2
deathNC
1891 / 1004 / 123
: 08.12.2009
: 2,792
: 2
22.03.2012, 08:02 #11
, , , WinRAR -, , - . .
JPG .
1) Delphi ( , )
2) . File-->Open...
3) , jpg
4) File-->Save As...
, , ...


1) C
2) "image.jpg", "archive.rar"
:
copy /B c:\image.jpg + /B c:\archive.rar c:\dest.jpg
: Windows + R, cmd

1
*.rar - . jpg -

http://habrahabr.ru/post/128433/
2
deathNC
1891 / 1004 / 123
: 08.12.2009
: 2,792
: 2
22.03.2012, 08:27 #12

rarimages.7z
2
aaleksander
111 / 85 / 21
: 06.06.2011
: 397
: 1
22.03.2012, 08:56 #13
. ?
- .
.
2
deathNC
22.03.2012, 09:22
  #14

:

( , )
, , ...
Rar, ... Rar - : http://www.securitylab.ru/contest/262791.php
jpg :
>>
>>
Rar
>>
>>
,

2
aidoqa
587 / 100 / 2
: 08.02.2011
: 839
03.04.2012, 20:04 #15
? jpeg, bmp, gif, mpeg,
2
deathNC
1891 / 1004 / 123
: 08.12.2009
: 2,792
: 2
03.04.2012, 20:38 #16
aidoqa, , ,
1
aidoqa
587 / 100 / 2
: 08.02.2011
: 839
03.04.2012, 20:42 #17
deathNC, ) )
1
deathNC
1891 / 1004 / 123
: 08.12.2009
: 2,792
: 2
03.04.2012, 20:59 #18
aidoqa
deathNC, )
,
( ) ... .
, *.ico ...

3
...
JPEG $FF $D9

8
aidoqa
jpeg, bmp, gif, mpeg,

:

ico, png, cur

1
S9
648 / 251 / 87
: 18.12.2010
: 541
03.04.2012, 22:27  [] #19
, , ,
bmp jpeg, - (, , 1 2). ,

, , ( )

:

, , , ""

0
aidoqa
587 / 100 / 2
: 08.02.2011
: 839
05.04.2012, 17:10 #20
S9, jpeg bmp, . PNG, CUR, Ico

10 0
unit Steganos;
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
unit Steganos;
 
interface
 
uses Classes, Windows, Dialogs, SysUtils, Forms, JPEG, Graphics;
 
type
  TImageFileInfo=record
    FileN:String; //Èìÿ bmpøêè
    width:dword; //øèðè** ðèñó*ê*
    height:dword; //âûñîò* ðèñó*ê*
    smeshenie:dword; //Ñìåùå*èå ðèñó*ê* îò **÷*ë* ô*éë*
    FileSize:dword; //Ð*çìåð bmpøêè
    ImageSize:dword; //Ð*çìåð ðèñó*ê*
    InfoHide:dword; //Ñêîëüêî è*ôû ìîæ*î ñïðÿò*òü
    RLE:byte; //Óðîâå*ü ñæ*òèÿ - äîëæå* áûòü ð*âå* 0
    BitsPerPixel:byte; //Ð*çðÿä*îñòü ðèñó*ê* (áèò ** ïèêñåëü) - **ì *óæ*û 24-õ ð*çðÿä*ûå
    Signature:string[2]; //Ïåðâûå äâ* á*éò* ô*éë* - bmp-ô*éëîâ äîëæ*û áûòü 'BM'
end;
 
BitsArray=array[0..7] of byte;
 
 
  function FileType(FileN:string):string;
  procedure ConvertJPG2BMP(JPGName, BMPName:string);
  procedure GetFileFormat(FileN:string;var StrLst:TStringList;var ImageInfo:TImageFileInfo);
  procedure IHide(ImageInfo:TImageFileInfo; DFile:string; SaveDialog:TSaveDialog; cb:byte);
  procedure IExtract(IFile:string;SaveDialog:TSaveDialog; cb:byte);
 
implementation
 
 
function FileType(FileN:string):string;
var st:TMemoryStream;
    str:string[3];
    i:integer;
begin
  st:=TMemoryStream.Create;
  st.LoadFromFile(FileN);
 
  str:='   ';
  for i:=1 to 3 do
  st.ReadBuffer(str[i], sizeof(str[i]));
 
  if copy(str, 1,2) = 'BM'
    then Result:='BMP'
  else if str = 'ÿØÿ'
    then Result:='JPG'
  else Result:='???';
 
  st.Free;
end;
 
 
procedure ConvertJPG2BMP(JPGName, BMPName:string);
var
 jpg:TJPEGImage;
 bmp:TBitmap;
begin
   try
    jpg:=TJPEGImage.Create;
    bmp:=TBitmap.Create;
    jpg.CompressionQuality:=100;
    jpg.Compress;
    jpg.LoadFromFile(JPGName);
    bmp.Assign(jpg);
    bmp.SaveToFile(BMPName);
    FreeAndNil(jpg);
    FreeAndNil(bmp);
   except
    on e:Exception do
     begin
      FreeAndNil(jpg);
      FreeAndNil(bmp);
     end;
   end;
end;
 
 
 
procedure GetFileFormat(FileN:string;var StrLst:TStringList;var ImageInfo:TImageFileInfo);
var
  Stream:TMemoryStream;
  ch:char;
  size,dwrd:dword;
  wrd:word;
//  bt:byte;
  str:string;
begin
  StrLst:=TStringList.Create;
  stream:=TMemoryStream.Create;
 
  stream.LoadFromFile(FileN); //Ç*ãðóæ*åì bmpøêó â òîëüêî ÷òî ñîçä***ûé MemoryStream
 
  StrLst.Add(' ***Òåõ*è÷åñê*ÿ è*ôîðì*öèÿ î ô*éëå*** ');
  StrLst.Add(' ***Ô*éë èçîáð*æå*èÿ: '+FileN+'***');
 
  stream.Read(ch,sizeof(ch)); //×èò*åì ñèã**òóðó
  str:=ch;
  stream.Read(ch,sizeof(ch));
  str:=str+ch;
  StrLst.Add(' ***********');
  ImageInfo.Signature:=str; //Ç**åñåì â ç*ïèñü ñèã**òóðó
 
 if ImageInfo.Signature ='BM' then //Åñëè ñèã**òóð* = BM, òî ç**÷èò âñå *îðì*ëü*î - ïðîäîëæ*åì
    begin
      ImageInfo.FileN:=ExpandFileName(FileN); //Ç**åñåì â ç*ïèñü èìÿ bmpøêè
 
      stream.Read(dwrd,sizeof(dwrd)); //Ñ÷èò*åì èç ç*ãîëîâê* ð*çìåð ô*éë*
      ImageInfo.Filesize:=dwrd;
 
      size:=round(dwrd/1024); //Ïåðåâåäåì â êèëîá*éòû äëÿ ä*ëü*åéøåãî âûâîä* â îïèñ**èå
      StrLst.add('Ð*çìåð ô*éë* ñ èçîáð*æå*èåì: '+IntToStr(dwrd)+' ( '+InTToStr(size)+' kb)');
 
      stream.Read(dwrd,sizeof(dwrd)); //Ç*ðåçåðâèðîâ**î - *å èñïîëüçóåòñÿ
      stream.Read(dwrd,sizeof(dwrd)); //Ç*ðåçåðâèðîâ**î - *å èñïîëüçóåòñÿ
 
      ImageInfo.smeshenie:=dwrd; //Åñëè ÷òî-òî ä*ëåå *å ÿñ*î - ñìîòðè îïèñ**èå ôîðì*ò*
      StrLst.Add('Ñìåùå*èå ä***ûõ áèòîâîãî îáð*ç* îò ç*ãîëîâê*: '+IntToStr(dwrd)+' á*éò');
 
      stream.Read(dwrd,sizeof(dwrd));
      StrLst.Add('Ð*çìåð BITMAPINFOHEADER: '+IntToStr(dwrd)+' á*éò');
 
      stream.Read(dwrd,sizeof(dwrd));
      ImageInfo.width:=dwrd;
      StrLst.Add('Øèðè** èçîáð*æå*èÿ: '+IntToStr(dwrd)+' ïèêñåëåé');
 
      stream.Read(dwrd,sizeof(dwrd));
      ImageInfo.height:=dwrd;
      StrLst.Add('Âûñîò* èçîáð*æå*èÿ: '+IntToStr(dwrd)+' ïèêñåëåé');
 
      stream.Read(wrd,sizeof(wrd));
      StrLst.Add('×èñëî áèòîâûõ ïëîñêîñòåé óñòðîéñòâ*: '+IntToStr(wrd));
 
      stream.Read(wrd,sizeof(wrd));
      ImageInfo.BitsPerPixel:=wrd;
      StrLst.Add('Ãëóáè** èçîáð*æå*èÿ (÷èñëî áèòîâ ** ïèêñåëü): '+IntToStr(wrd));
 
      stream.Read(dwrd,sizeof(dwrd));
      StrLst.Add('Òèï ñæ*òèÿ (0-îòñóòñòâóåò): '+IntToStr(dwrd));
      ImageInfo.RLE:=dwrd;
 
      stream.Read(dwrd,sizeof(dwrd));
      size:=round(dwrd/(1024));
      StrLst.Add('Ð*çìåð ê*ðòè*êè â á*éò*õ: '+IntToStr(dwrd)+' ( '+IntToStr(size)+' kb)');
 
      ImageInfo.ImageSize:=dwrd;
      stream.Read(dwrd,sizeof(dwrd));
      StrLst.Add('Ãîðèçî*ò*ëü*îå ð*çðåøå*èå óñòðîéñòâ* (ïèêñåëü/ì): '+IntToStr(dwrd));
 
      stream.Read(dwrd,sizeof(dwrd));
      StrLst.Add('Âåðòèê*ëü*îå ð*çðåøå*èå óñòðîéñòâ* (ïèêñåëü/ì): '+IntToStr(dwrd));
 
      stream.Read(dwrd,sizeof(dwrd));
      StrLst.Add('×èñëî èñïîëüçóåìûõ öâåòîâ: '+IntToStr(dwrd));
 
      stream.Read(dwrd,sizeof(dwrd));
      StrLst.Add('×èñëî â*æ*ûõ öâåòîâ: '+IntToStr(dwrd));
 
      ImageInfo.InfoHide:=(ImageInfo.width*ImageInfo.height*3) div 8;
      StrLst.Add(' ***********');
      StrLst.Add('Ìîæ*î ñïðÿò*òü è*ôîðì*öèè '+IntToStr(ImageInfo.infohide)+'á*éò ('+IntToStr(round((ImageInfo.infohide)/1024))+'kb)');
end
else StrLst.Add('Îøèáê*: ýòî *å ô*éë ôîðì*ò* Windows 3.11 BMP.');
stream.Free;
end;
 
 
procedure HexToBin(x:byte;var a:BitsArray);
var
  bit,i:byte;
begin
  for i:=7 downto 0 do
  begin
    if (X and (1 shl i))<>0
      then bit:=1
      else bit:=0;
    a[i]:=bit;
  end;
end;
 
 
procedure BinToHex(var x:byte;a:BitsArray);
var i:dword;
    bit,t:byte;
begin
  x:=0;
  for i:=7 downto 0 do
    begin
      bit:=a[i];
      x:=x or bit;
      if i<>0
        then x:=x shl 1;
    end;
end;
 
 
function SetBit(SByte: byte; num: byte): byte;
begin
  Result := SByte or (1 shl num);
end;
 
 
function ResetBit(SByte: byte; num: byte): byte;
begin
  Result := SByte and not (1 shl num);
end;
 
 
procedure IHide(ImageInfo:TImageFileInfo; DFile:string; SaveDialog:TSaveDialog; cb:byte);
var
  sz,n,z:dword;
  len,v,i,xi,xd:byte;
  FIStream,FDStream:TMemoryStream;
  BAr,BArLog:BitsArray;
  tmp,FName:string;
  f:File;
  filesize:longint;
begin
  //Â FDStream ïîäãðóæ*åòñÿ ô*éë ä***ûõ, * â FIStream ô*éë-êî*òåé*åð
  FDStream:=TMemoryStream.Create;
  FDStream.LoadFromFile(DFile);
  FIStream:=TMemoryStream.Create;
 
  //Òóò èäóò ð*çëè÷*ûå ïðîâåðêè ** òî ïîäõîäèò ýòîò ô*éë ** ðîëü êî*òåé*åð* èëè *åò
  if ImageInfo.Signature<>'BM' then
  begin
    MessageBox(Application.handle,'Ýòî *å èçîáð*æå*èå ôîðì*ò* Windows Bitmap.','Error',MB_ICONERROR);
    exit;
  end;
 
  if ImageInfo.BitsPerPixel<>24 then
  begin
    MessageBox(Application.handle,'Èçîáð*æå*èå äîëæ*î áûòü 24-õ áèò*ûì!','Error',MB_ICONERROR);
    exit;
  end;
 
  if ImageInfo.RLE<>0 then
  begin
    MessageBox(Application.handle,'Â ä***îì èçîáð*æå*èè èñïîëüçóåòñÿ ñæ*òèå.','Error',MB_ICONERROR);
    exit;
  end;
 
  if (ImageInfo.InfoHide < FDStream.Size) then
  begin
    MessageBox(Application.handle,'Ýòî èçîáð*æå*èå ñëèøêîì ì*ëî, ÷òîá ïîìåñòèòü â ñåáÿ ñòîëüêî è*ôîðì*öèè.','Error',MB_ICONERROR);
    exit;
  end;
 
  //Åñëè ô*éë ïðîøåë âñå ïðîâåðêè - ïîäãðóæ*åì åãî â ï*ìÿòü
  FIStream.LoadFromFile(ImageInfo.FileN);
  FIStream.Position:=ImageInfo.smeshenie;
  //Ð*çìåð ô*éë* ä***ûõ ïîìåù*åì â sz
  sz:=FDStream.size;
 
  //Ç*ïèñûâ*åì ð*çìåð ô*éë* êîòîðûé ïðÿ÷åì â bmpøêó
  for n:=31 downto 0 do
  begin
    //×èò*åì á*éò èç ô*éë*-êî*òåé*åð*
    FIStream.Read(xi,sizeof(xi));
    //Åñëè â szå áèò ñ *îìåðîì n ð*âå* 1, òî óñò***âëèâ*åì 0-îé áèò â òîëüêî ÷òî ñ÷èò**îì
    //á*éòå, *ó * åñëè n*ûé áèò ñáðîøå*, òî ñáð*ñûâ*åì 0-îé áèò
    if (sz and (1 shl n))<>0
      then xi:=SetBit(xi,cb)
      else xi:=ResetBit(xi,cb);
    //Îòê*òûâ*åìñÿ ** ïîçèöèþ **ç*ä, ÷òîá ïåðåç*ïèñ*òü òîò áèò êîòîðûé ìû ñ÷èò*ëè, *î
    //òîëüêî òåïåðü ñ èçìå*å**ûì *óëåâûì áèòîì
    FIStream.Position:=FIStream.Position-1;
    FIStream.Write(xi,sizeof(xi));
  end;
 
  //Ïîëó÷*åì èìÿ ô*éë* ä***ûõ áåç ïóòè ê ô*éëó
  tmp:=ExtractFileName(DFile);
  //Ïîëó÷*åì äëè**ó èìå*è
  len:=Length(tmp);
  //Ð*çáèâ*åì á*éò â êîòîðîì õð**èòñÿ äëè*** èìå*è ** ì*ññèâ 1 è 0
  HexToBin(len,BAr);
 
  //Ç*ïèñûâ*åì äëè**ó èìå*è â ô*éë-êî*òåé*åð
  for n:=7 downto 0 do
  begin
    FIStream.Read(xi,sizeof(xi));
    if BAr[n]=1 then xi:=SetBit(xi,cb);
    if BAr[n]=0 then xi:=ResetBit(xi,cb);
    FIStream.Position:=FIStream.Position-1;
    FIStream.Write(xi,sizeof(xi));
  end;
 
  //Ç*ïèñûâ*åì ñ*ìî èìÿ ô*éë* â bmpøêó
  for n:=1 to len do
  begin
    //Áåðåì ñèìâîë ñ *îìåðîì n, ïîëó÷*åì åãî ascii-êîä, ð*çáèâ*åì ïîëó÷å**îå ** áèòû è //ç*ïèñûâ*åì
    v:=ord(tmp[n]);
    HexToBin(v,BAr);
    for i:=7 downto 0 do
    begin
      FIStream.Read(xi,sizeof(xi));
      if BAr[i]=1 then xi:=SetBit(xi,cb);
      if BAr[i]=0 then xi:=ResetBit(xi,cb);
      FIStream.Position:=FIStream.Position-1;
      FIStream.Write(xi,sizeof(xi));
    end;
  end;
 
  //Ïèøåì â bmpøêó ñ*ìî òåëî ô*éë*
  //ê*æäûé á*éò ð*çáèâ*åì ** áèòû è ç*ïèñûâ*åì
  for n:=0 to (sz-1) do
  begin
    FDStream.Read(xd,sizeof(xd));
    HexToBin(xd,BAr);
    for i:=7 downto 0 do
    begin
      FIStream.Read(xi,sizeof(xi));
      if BAr[i]=1 then xi:=SetBit(xi,cb);
      if BAr[i]=0 then xi:=ResetBit(xi,cb);
      FIStream.Position:=FIStream.Position-1;
      FIStream.Write(xi,sizeof(xi));
    end;
  end;
  SetLength(FName,0);
  //Âûçûâ*åì.. *åò, *å äóõîâ, * äè*ëîã ñîõð**å*èÿ ô*éëîâ
  if SaveDialog.Execute then FName:=SaveDialog.FileName;
  if LowerCase(ExtractFileExt(FName))<>'.bmp' then FName:=FName + '.bmp';
  //Ñîõð**ÿåì
  FIStream.SaveToFile(FName);
  //Îñâîáîæä*åì ïåðåìå**ûå
  FDStream.Free;
  FIStream.Free;
  ShowMessage('Âûïîë*å*î!');
end;
 
 
procedure IExtract(IFile:string;SaveDialog:TSaveDialog; cb:byte);
var
  IInfo:TImageFileInfo;
  Lst:TStringList;
  IFstream,DFStream:TMemoryStream;
  n,i,sz:dword;
  a:BitsArray;
  b:array[0..31] of byte;
  bit,len,x,z:byte;
  DFile:string;
begin
  Lst:=TStringList.Create;
 
  //Ïîëó÷*åì è*ôó èç bmpøêè
  GetFileFormat(IFile,Lst,IInfo);
 
  //Ãðóçèì âñå â ï*ìÿòü
  IFstream:=TMemoryStream.Create;
  DFStream:=TMemoryStream.Create;
 
  IFstream.LoadFromFile(IFile);
  IFstream.Position:=IInfo.smeshenie;
 
//Ñîáèð*åì ì*ññèâ èç 1 è 0, êîòîðûé åñòü ð*çìåð ñïðÿò***îãî ô*éë*
  for n:=31 downto 0 do
  begin
    IFstream.Read(z,sizeof(z));
    if (z and (1 shl cb))<>0 then z:=1 else z:=0;
    b[n]:=z;
  end;
  sz:=0;
 
  //Ñîáèð*åì dword ïî áèò*ì èç ì*ññèâ* ïîëó÷å**ãî âûøå
  for i:=31 downto 0 do
  begin
    bit:=b[i];
    sz:=sz or bit;
    if i<>0 then sz:=sz shl 1;
  end;
 
  SetLength(DFile,0);
  DFIle:='';
  z:=0;
 
  //Ïîëó÷*åì èç ô*éë*-êî*òåé*åð* äëè**ó èìå*è
  for n:=7 downto 0 do
  begin
    IFstream.Read(z,sizeof(z));
    if (z and (1 shl cb))<>0 then z:=1 else z:=0;
    a[n]:=z;
  end;
  len:=0;
 
  //Ì*ññèâ 1 è 0->á*éò
  BinToHex(len,a);
 
  //Ïîëó÷*åì èìÿ ñïðÿò***îãî ô*éë*
  for n:=1 to len do
  begin
    for i:=7 downto 0 do
    begin
      IFstream.Read(z,sizeof(z)); // Error!
      if (z and (1 shl cb))<>0 then z:=1 else z:=0;
      a[i]:=z;
    end;
    BinToHex(z,a);
    DFile:=Dfile+chr(z);
  end;
 
  //Äîñò*åì ñ*ìî òåëî ô*éë*
  for i:=0 to sz-1 do
  begin
    //Ñ÷èòûâ*åì 8 áèò
    for n:=7 downto 0 do
    begin
      IFstream.Read(z,sizeof(z));
      if (z and (1 shl cb))<>0 then z:=1 else z:=0;
      a[n]:=z;
    end;
    //Ñîáèð*åì èç ýòèõ áèò á*éò
    BinToHex(x,a);
    //Äîïèñûâ*åì á*éò ê òîìó ÷òî åñòü â ï*ìÿòè - ñîáèð*åì ô*éë
    DFStream.Write(x,sizeof(x));
  end;
 
  try
    //Ïðåäëîæèì äëÿ ñîõð**å*èÿ ô*éë* èìÿ, ïîä êîòîðûì î* áûë óï*êîâ**.
    SaveDialog.FileName:=DFile;
    //Âûçûâ*åì äè*ëîã ñîõð**å*èÿ
    if SaveDialog.Execute then DFile:=SaveDialog.FileName;
 
    //Ñîõð**ÿåì èçâëå÷å**ûé ô*éë
    DFStream.SaveToFile(DFile);
  except
    MessageBox(0,PAnsiChar('Îøèáê* ïðè ïîïûòêå ñîõð**å*èÿ.'+#13#10+DFile),'X-Date',MB_ICONERROR);
  end;
 
  IFstream.Free;
  DFStream.Free;
  Lst.Free;
  MessageBox(0,'Âûïîë*å*î!','X-Data',MB_ICONINFORMATION);
end;
 
 
end.
PNG, djvu, ico ( )
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtDlgs, ComCtrls, XPMan, ExtCtrls, CheckLst;
 
type
  TForm1 = class(TForm)
    SaveDialog1: TSaveDialog;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    OpenDialog1: TOpenDialog;
    Image1: TImage;
    RadioGroup1: TRadioGroup;
    Memo2: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
uses Steganos;
 
var
  IInfo:TImageFileInfo;
  DFile:string;
 
{$R *.dfm}
 
 
procedure TForm1.Button1Click(Sender: TObject);
var i:byte;
    Strgs:TStringList;
    ft:string;
begin
  OpenDialog1.Filter:='*.jpg; *.bmp|*.jpg; *.bmp';
  if OpenDialog1.Execute then
  begin
    ft:=FileType(OpenDialog1.FileName);
    if ft = 'BMP'
    //Åñëè BMP - îïðåäåëÿåì åãî ïîê*ç*òåëè
        then
        begin
          GetFileFormat(OpenDialog1.FileName,Strgs,IInfo);
          Image1.Picture.Bitmap.LoadFromFile(OpenDialog1.FileName);
        end
      else if ft = 'JPG'
    //Åñëè JPG - êî*âåðòèðóåì âî âðåìå**ûé ô*éë
    //è îïðåäåëÿåì ïîê*ç*òåëè âðåìå**îãî ô*éë*
        then begin
          ConvertJPG2BMP(OpenDialog1.FileName, 'tmpfile');
          Image1.Picture.Bitmap.LoadFromFile('tmpfile');
          GetFileFormat('tmpfile',Strgs,IInfo);
        end
      else exit;
 
  end
    else exit;
  
end;
 
 
procedure TForm1.Button2Click(Sender: TObject);
begin
OpenDialog1.Filter:='*.txt|*.txt';
if OpenDialog1.Execute then
  begin
  DFile:=OpenDialog1.FileName;
  Memo2.Lines.LoadFromFile(DFile);
  end;
end;
 
 
procedure TForm1.Button3Click(Sender: TObject);
var ft:string;
begin
  if DFile<>''
    then
    begin
      ft:=FileType(IInfo.FileN);
      if ft = 'BMP'
      //Åñëè BMP - âûçûâ*åì ïðîöåäóðó ñêðûòèÿ äëÿ èñõîä*îãî èìå*è ô*éë*
        then IHide(IInfo,Dfile,SaveDialog1,RadioGroup1.itemindex)
      else if ft = 'JPG'
      //Åñëè JPG, òî âûçûâ*åì ïðîöåäóðó ñêðûòèÿ äëÿ èìå*è âðåìå**îãî ô*éë*
      //è óä*ëÿåì ýòîò âðåìå**ûé ô*éë
        then begin
          IHide(IInfo, DFile, SaveDialog1, RadioGroup1.itemindex);
          DeleteFile('tmpfile');
        end;
    end
    else MessageBox(handle,'Íå âûáð** ô*éë ä***ûõ!!!','XData Error',MB_ICONERROR);
end;
 
 
procedure TForm1.Button4Click(Sender: TObject);
begin
  OpenDialog1.Filter:='*.bmp|*.bmp';
  if OpenDialog1.Execute
    then IExtract(OpenDialog1.FileName,SaveDialog1,RadioGroup1.itemindex);
end;
 
 
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if FileExists('tmpfile') then DeleteFile('tmpfile');
end;
 
end.
40
)
S9, PNG, djvu, ico .. ( BMP, Jpeg, tiff, GIF,AVI, MP3) ?
2
05.04.2012, 17:10
MoreAnswers
37091 / 29110 / 5898
: 17.06.2006
: 43,301
05.04.2012, 17:10
! :


! , ...


. . peg2 ...


, ! ...


, , .....




:
20

- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
@Mail.ru