In Kali Linux whenever I open a binary in Olly Debugger after compiling the c source file, it gives an error:

"The file is not a valid PE file."

No debugging takes place thereafter. Is there any workaround for this?


gcc complies to the ELF format. PE is for Windows Executable files.

Use a Linux debugger. Something like gdb is fine.

Or cross-compile the c file to a Windows one (if that suits your use case)

| improve this answer | |

Linux uses the ELF format for binaries.

Windows uses primarily the PE format.

They are distinct. Olly is made for Windows binaries and does not understand ELF files.

GDB is a good debugger for Linux.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.