When debugging a DLL or com program, the DLL file may be occupied by other programs and cannot be replaced. On WINXP and Vista, you can create a. Local folder to redirect the DLL loading path.
Procedure(Assume that your exeis myapp.exe and the DLL to be debugged is mymodule. dll ):
1) create a myapp.exe. Local file in the myapp.exe directory.
2) copy the mymodule. dll you want to load to the myapp.exe. Local directory.
3) Run myapp.exe
OriginalE:/test/myapp.exeLoaded DLL
Modload: 00400000 00432000 myapp.exe
Modload: 7c800000 7c8f4000 C:/Windows/system32/kernel32.dll
Modload: 77c10000 77c68000 C:/Windows/system32/msvcrt. dll
Modload: 00440000 00c80000 C:/Windows/system32/mymodule. dll
Modload: 77dd0000 77e6b000 C:/Windows/system32/advapi32.dll
After creating the. Local folder,E:/test/myapp.exeLoaded DLL
Modload: 00400000 00432000 myapp.exe
Modload: 7c800000 7c8f4000 C:/Windows/system32/kernel32.dll
Modload: 77c10000 77c68000 C:/Windows/system32/msvcrt. dll
Modload: 00440000 00c80000 E:/test/myapp.exe. Local/mymodule. dll
Modload: 77dd0000 77e6b000 C:/Windows/system32/advapi32.dll
Note: To enable the. Local function, you must set the veriverrideenable value in the Registry and restart the machine.
[HKEY_LOCAL_MACHINE/software/Microsoft/Windows NT/CurrentVersion/Image File Execution options]"
Veriverrideenable"= DWORD: 00000001 [tips] You can enter the following command on the command line to set the registry: reg Add "HKLM/software/Microsoft/Windows NT/CurrentVersion/Image File Execution options"/V implements verrideenable/T REG_DWORD/D 1/f --