DynamoRIO / DynamoRIO/dynamorio

64-bit drwrap mixed-mode support for wrapping and replacing 32-bit functions

Open
#1,475 1 comment 0 reactions 0 assignees View on GitHub
Component-Extension Migrated Priority-Medium Type-Feature
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on July 16, 2014 12:17:57_

This issue covers adding support for wrapping and replacing 32-bit
functions when using a 64-bit-compiled drwrap in mixed-mode (on Windows
for now, until we have issue #1345):

drwrap wrap:
- Need to add code to handle 32-bit calling convention for 64-bit drwrap
when the target address to be wrapped is 32-bit code. Arg access is
through API routines written in C so this should be straightforward.
- How does drwrap know whether target function is 32-bit or not? Add a
flag to drwrap_wrap_flags_t
Is there some other way? dcontext->x86_mode is only updated in DR code
(right?) and drwrap is invoked from arbitrary points in the cache.

drwrap replace_native:
- Ditto, but needs to directly marshal args from 32-bit slots into 64-bit
slots via generated code, so this is a little trickier than wrapping.
- It's up to the client to handle differences in structure field sizes and
layouts.
- Plus pop;jmp instead of ret
- May need to add drwrap_replace_native_ex() that takes in flags

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

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.