- 如何将.exe转成16进制数字(0~F)
- 如何在转换过程中识别到文件末尾
已知以下程序转化过程中会意外停止(hello.exe是hello world的exe)
#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("hello.exe","r",stdin);
freopen("hello.out.txt","w",stdout);
char c;
while(c!=EOF){
c=getchar();
printf("%02x",c);
}
return 0;
}
如何使该程序正确判断文件末尾?
如何将16进制转换回去?