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?

2 Answers 2


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)


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .