-2

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?

schroeder
  • 123,438
  • 55
  • 284
  • 319
Noname
  • 139
  • 1
  • 1
  • 5

2 Answers2

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)

schroeder
  • 123,438
  • 55
  • 284
  • 319
Stolas
  • 333
  • 1
  • 13
0

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.

schroeder
  • 123,438
  • 55
  • 284
  • 319
vidarlo
  • 12,850
  • 2
  • 35
  • 47