Slide 14.5: Linking to C/C++ Slide 14.7: Linking to C/C++ (cont.) Home |
main.cpp
: The C++ startup program reads the names of the input and output files from the command line.
It calls Encrypt
from a loop that reads blocks of data from a file, encrypts it, and writes the translated buffer to a new file.
Encrypt.h
: The header file contains a single function prototype:
void Encrypt( char* buf, long count, char eChar );
Encrypt.asm
: The Encrypt
procedure loops through a character array and XOR
each character with a predefined value.
Encrypt infile.txt outfile.txt
Some of the following C++ commands are used in the program:
End-Of-File
has been reached.
n
.
str
and following by successive characters in the array until the number of characters specified by n
has been successfully written.