DynamoRIO / DynamoRIO/drmemory

[win32] support AppInit injection

Open
#112 1 comment 0 reactions 0 assignees View on GitHub
Migrated OpSys-Windows Priority-Low
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [derek.br...@gmail.com](https://code.google.com/u/117968039472581148324/) on December 10, 2010 17:57:41_

PR 408521

for AppInit injection we need to initialize the shadow memory for the part of the stack
that has been used already. I didn't do this earlier b/c I had no way to get the current
stack: but PR 395156 gives that to me now.

another problem is handling loss of control on a cbret
this shows up as:
ASSERT pt_parent != NULL common/alloc.c:1019

in addition to marking stack, etc. after re-taking over, DR often takes
over via NtAllocateVirtualMemory hook. client sees post-syscall but never
saw pre => more asserts, like:

in event_basic_block(tag=0x772f03a0)
processing system call `#2` NtCallbackReturn
in event_basic_block(tag=0x772f0573)
processing system call `#21` NtAllocateVirtualMemory
NtAllocateVirtualMemory: 0x002b0000-0x002b2000 vcommit commit
ASSERT FAILURE (thread 3504): E:/derek/dr/misc/internal/clients/drmemory/common/alloc.c:1268: !is_in_heap_region(base) (HeapAlloc vs VirtualAlloc: error distinguishing)

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=112_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.