Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load a new exe with gdb

Tags:

gdb

dos

I am currently trying to make use of gdb to disassemble an exe, and from my home, I start the application like such:

gdb "c:\file.exe"

And gdb starts and loads that file automatically.

Now the problem is that from where I am atm, the command prompt is disabled and thus I cannot run the terminal window with the filename as the argument.

The only thing I think can do atm is open the gdb.exe file directly and then load the exe with a command or something, from gdb itself.

Is there a command I can use to load the exe to debug from within the application itself rather than passing it as an argument?

(gdb) <some command> "c:\file.exe"
like image 330
Andreas Grech Avatar asked Dec 17 '22 04:12

Andreas Grech


2 Answers

(gdb)file c:\file.exe

like image 118
Arkaitz Jimenez Avatar answered Jan 15 '23 03:01

Arkaitz Jimenez


To start debugging it , use the file command, as @Arkaitz Jimenez said

If your file.exe is a running process, you can use the attach command

like image 43
Tom Avatar answered Jan 15 '23 03:01

Tom