I cant find any solution to the aforementioned problem, even thought i searched in the opened/closed issues of Dynamorio GITHUB history
* Platform: Windows 64bits - RAM: 16G.
* IDE: MSVS Community 2015 ( launched as administrator )
* DynamoRio: windows X64 RC.7.0.1
* Process being injected: Windows 64 bits executable Release
* Debug command: $(SolutionDir)Dependencies\DR\bin64\drrun.exe
* Debug command line args: "-stderr_mask 15 -msgbox_mask 15 -c $(TargetPath) -- <process name>.exe"
* Debug Working dir:$(ProjectDir)
* Project configuration > C/C++ > Code generation: Multi-threaded Debug (/MTd)
* Replacement method: drwrap_replace_native( ..., override = false );
* Replaced functions all use a single custom heap for HeapAlloc/GlobalAlloc/LocalAlloc
* Heap is created with: dr_custom_alloc( dr_get_current_drcontext(), DR_ALLOC_NON_HEAP | DR_ALLOC_NON_DR, arena_sze, DR_MEMPROT_READ | DR_MEMPROT_WRITE | DR_MEMPROT_EXEC, NULL );
* User adr and sizes are aligned on 16 bytes
* Whole heap check of the custom heap before and after each call to any replaced function
* Calling the original(are they ? or are they replaced by DR ?) functions HeapFree, HeapRealloc etc if the adr is not hosted by the custom heap, same for global and local functions
* Functions calls pattern in the body of the replacement functions:
replacement_function()
{
dr_switch_to_app_state( dr_get_current_drcontext() );
ret_type ret_val = replacement implementation
drwrap_replace_native_fini( dr_get_current_drcontext() );
dr_switch_to_dr_state( dr_get_current_drcontext() );
return ret_val;
}
* Number of Screenshots: 3
- Screenshot 1 > replaced functions
- Screenshot 2 > result when debugging without attaching to the target process
- Screenshot 3 > result when debugging by attaching to the target process
Screenshot 1 of 3 - replaced functions
Screenshot 2 of 3 - result when debugging without attaching to the target process
Screenshot 3 of 3 - result when debugging by attaching to the target process
* Questions:
1) Does anyone have a solid idea on what is causing that (i check my whole heap before and after each call to any replaced function) ?
2) Is it possible to make DynamoRio execute my replacement functions only for the target application, not for the modules loaded by the application ?
3) Anything I am doing wrong, please tell me so that I can exclude it from the possible causes for my problem...