Debugging Windows Service using Dr Memory.

718 views
Skip to first unread message

Ananda M R

unread,
Jul 31, 2014, 7:23:19 AM7/31/14
to drmemor...@googlegroups.com
Hi,
 
I need to debug Windows service using Dr Memory. If possible, please suggest me the way to follow.
 
Thanks and Regards,
Anand

Qin Zhao

unread,
Jul 31, 2014, 11:22:36 AM7/31/14
to drmemor...@googlegroups.com
hmm, that might be a bit tricky.

I am not sure if Dr. Memory has a direct way to do so.

Because Dr.Memory is running on top of DynamoRIO, and we can use DynamoRIO to run with Windows service by registering the process using drconfig.
You might have to find a exact command Dr.Memory used for running DynamoRIO, and use drconfig to register the Windows service to run with Dr.Memory, then start the Windows service.


--

---
You received this message because you are subscribed to the Google Groups "Dr. Memory Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drmemory-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Derek Bruening

unread,
Jul 31, 2014, 12:10:11 PM7/31/14
to drmemor...@googlegroups.com
Today Dr. Memory does not support attaching, nor the AppInit method of injection.  But its base tool platform DynamoRIO does support AppInit (on pre-Win8).  So you'll want to first set up a config file for Dr. Memory for the executable in which your target Windows service runs (is it in svchost?  If so there is some naming magic: if not it will be just the .exe name).  Then set DR for AppInit via -syswide_on arg to drconfig, and then re-start the Windows service.

The config file will look something like:

% cat /c/users/<username>/dynamorio/foo.exe.config32 
DYNAMORIO_RUNUNDER=1
DYNAMORIO_AUTOINJECT=c:\path\to\drmemory\dynamorio\lib32\release\dynamorio.dll
DYNAMORIO_LOGDIR=c:\path\to\drmemory\dynamorio\logs
DYNAMORIO_OPTIONS=-code_api -probe_api -disable_traces -bb_single_restore_prefix -max_bb_instrs 256 -vm_size 256M -no_enable_reset -no_early_inject -stderr_mask 12 -msgbox_mask 0 -client_lib "c:\path\to\drmemory\bin\release\drmemorylib.dll;0;-logdir `c:\path\to\drmemory\logs` -lib_blacklist C:\Windows*.d?? "


Reply all
Reply to author
Forward
0 new messages