6

I am using Ubuntu 13.10. Is it possible to debug a windows executable under Linux?

I've tried gdb, but it always throw me this error message.

/bin/bash: line 0: exec: /some.exe: cannot execute: Permission denied
Znatz
  • 1,530
  • 2
  • 18
  • 31

3 Answers3

10

I don't have much experience with this but, I think, what you're looking for is winedbg. Initially, it should allow you to debug Win32 applications in Linux.

Vladimir Panteleev
  • 24,651
  • 6
  • 70
  • 114
jcm
  • 2,568
  • 14
  • 18
4

I suggest you try the IDA Debugger (cross platform debugger).
Hope it helps.

  • Thank you. I have tried it locally but it keeps throwing `/ida64/procs/cli.ilx can't load file` error... – Znatz Nov 25 '13 at 11:56
2

You are trying to execute a program designed to run in a OS, from within another one, which could be using a complete different processor than a x86.

In order for a executable program to be run in a specific OS, these modules or services must exist:

  • A module that can understand the binary code of the executable program and translate, if needed, into binary code of the host processor.
  • A service that can intercept any instruction identified as a system call, and emulate its behaviour using host resources
  • A module that is able to load, parse and prepare a process block to acommodate the new "guest" process

This is just for executing a program. To debug it, you also need a service that can interact with the above mentioned modules/services in order to control execution of that program.

That said, you can probably debug an EXE file using some utility from the Wine project, asumming your Ubuntu is running on a x86 processor. Take a look at it. http://www.winehq.org/

Also, I recall VirtualBox offers some sort of debugging help for processes running on the guest OS, but I'm not sure about this.

mcleod_ideafix
  • 11,128
  • 2
  • 24
  • 32