-
[c++] Binary XOR EncProgramming/c++ 2015. 12. 9. 10:54반응형
/*
Make by Gray_Carlos
@Gray hack
Desc : 파일을 바이너리 단계로 오픈 한뒤 fgetc 으로 한글자씩 가져와 fputc로 xor을 시켜 파일을 생성한다.
*/
#include <stdio.h>
#include <stdlib.h>
int main(void) {
FILE *in,*out;
int ch;
if ( (in = fopen("File Name.exe", "rb")) == NULL ) {
fputs("파일 열기 에러!", stderr);
exit(1);
}
if ( (out = fopen("File Name_enc.exe", "wb")) == NULL ) {
fputs("파일 열기 에러!", stderr);
exit(1);
}
while ( (ch = fgetc(in)) != EOF ) {
fputc(ch^1234,out);
}
fclose(in);
fclose(out);
printf("암호화 완료\n");
return 0;
}
반응형