⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 infile.txt

📁 想学习汇编语言的
💻 TXT
字号:
INFILE.TXT

This text file will be encoded by the Encode.exe program:



#include <iostream.h>
#include <fstream.h>


/* Translate a buffer of <count> bytes, using an encryption
   character <eChar>. Uses an XOR operation (ASM function).*/

//extern "C" void TranslateBuffer(char *buf, 
//    unsigned int count, char eChar);


void TranslateBuffer( char * buf, unsigned count, char eChar )
{
  __asm 
 {
   mov esi,buf    // necessary to push ESI?
   mov ecx,count
   mov al,eChar

L1:
   xor [esi],al
   inc  esi
   Loop L1
 }
}


const int BUFSIZE = 200;
char buffer[BUFSIZE];

int main() 
{  
  unsigned int count;    // character count
  
  // character used for encryption 
  const unsigned char encryptChar = 241;  

  char infilename[] = "infile.txt";
  char outfilename[] = "outfile.txt";

  ifstream infile( infilename, ios::binary );
  ofstream outfile( outfilename, ios::binary );
  
  while (!infile.eof() )
  {
    infile.read(buffer, BUFSIZE );
    count = infile.gcount();
    TranslateBuffer(buffer, count, encryptChar);

    //outfile.write(buffer, count);
  }

  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -