📄 scre.cpp
字号:
// scre.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <stdio.h>
unsigned char kkk[8];
unsigned char buffer[600],ch_buffer[600];
unsigned byteswritten;
int main(int argc, char* argv[])
{
int fh1, fh2;
unsigned int i,j=0;
unsigned int nbytes = 600, bytesread;
kkk[0] =0x12;
kkk[1] =0x25;
kkk[2] =0x7d;
kkk[3] =0xde;
kkk[4] =0x3e;
kkk[5] =0xb2;
kkk[6] =0xc4;
kkk[7] =0x93;
fh1 = _open( "11.rar", _O_RDONLY|_O_BINARY );
if( fh1 == -1 )
{
perror( "open failed on input file" );
return(-1);
}
fh2 = _open( "11.rao", _O_RDWR | _O_CREAT|_O_TRUNC|_O_BINARY );
if( fh2 == -1 )
{
perror( "Open failed on output file" );
return(-1);
}
while(1)
{
bytesread = _read(fh1,buffer,nbytes);
if(bytesread == -1)
{
perror( "read failed on output file" );
return(-1);
}
for(i= 0 ; i < bytesread ; i++)//转换
{
ch_buffer[i] = buffer[i]^kkk[j];
j++;
if(j==8)
j = 0 ;
}
if(bytesread !=0)
{
byteswritten = _write(fh2,&ch_buffer[0],bytesread);
if(byteswritten==-1)
{
perror( "write failed on output file" );
return(-1);
}
}
if(bytesread < nbytes)
break;
}
_close( fh1 );
_close( fh2 );
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -