searches for files using the magic number of the file header

68 Views Asked by At

I'm doing an exercise: write a C program for Linux that searches for files in ELF, PE32, COFF and a.out formats using the magic number of the file header. I tried writing my own program to find magic number and it worked, however when I try to use it in my whole project it barely works. Here is my program to get file's magic number: https://github.com/hoangtv13/Magic_number And here is my project: https://github.com/hoangtv13/OCP_Lab1 In the 2nd option: find the file with a size smaller than the input size, almost everything is fine, but with the first option I think there is something wrong while reading the file. How should i fix it?

0

There are 0 best solutions below