when i try to read the first byte from an EXE file it's give different
results
code:
FILE *me,*u;
char buf_me[1];
char buf_u[1];
me= fopen(argv[0],"rb");
u= fopen(argv[1],"rb+");
fread(buf_me,si zeof(char),1,me );
fread(buf_u,siz eof(char),1,u);
printf("%s\n",b uf_me);
printf("%s\n",b uf_u);
----
when you run this code and put EXE file as an argument , the program
will print
M
MM
why it double the byte in the second time
results
code:
FILE *me,*u;
char buf_me[1];
char buf_u[1];
me= fopen(argv[0],"rb");
u= fopen(argv[1],"rb+");
fread(buf_me,si zeof(char),1,me );
fread(buf_u,siz eof(char),1,u);
printf("%s\n",b uf_me);
printf("%s\n",b uf_u);
----
when you run this code and put EXE file as an argument , the program
will print
M
MM
why it double the byte in the second time
Comment