0

Using pydbg I'm opening files(ex. c:\\myfile.mnp) within a win32 application(Ex. c:\\myprog.exe) in this way.

  dbg = pydbg()
  dbg.load("c:\\myprog.exe", "c:\\myfile1.mnp") 

If the target application is already running then, is it possible to open a another file(For example c:\myfile2.mnp ) within the same application which is already running without closing that process/apps, using pydbg?

Dev.K.
  • 2,428
  • 5
  • 35
  • 49

1 Answers1

0

From personal experience, its better to have python start the application, or attach to it while its running.

import pydbg
from pydbg import *
from pydbg.defines import *
import struct
import utils
dbg = pydbg()
pid = ''
name = ''
found_program = False

for (pid, name) in dbg.enumerate_processes():
    if name.lower() == "program.exe":
        found_program = True
        dbg.attach(pid)

if found_program:  
 dbg.run()

To make python start it:

from os import system
system('start "c:\program.exe"')
b0nnie
  • 1
  • 1
  • Ive had problems attaching to something ive previously detached from if i modify my code and rerun the debugger. For me its best to have the application start up fresh so i can attach cleanly. – b0nnie Aug 17 '13 at 05:11