Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build own implementation of Windows system library routines needed for typical clients #1063

Open
derekbruening opened this issue Nov 28, 2014 · 4 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] on January 22, 2013 16:55:00

split from issue #916 .

this issue covers building our own implementation using the DR API and DR's internal syscall infrastructure, rather than building on the native API. while the latter would enable libraries that could be used for other projects, the internal allocs inside ntdll routines mean we need to redirect them and in some cases it's easier to redirect the higher-up kernel32 routine instead.

the initial goal would be to cover the 210 kernel32 routines used by the union of dbghelp, typical C++ clients, and msvcrt.

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1063

@derekbruening
Copy link
Contributor Author

From [email protected] on February 08, 2013 10:13:42

we should implement relative path support in issue #298

@derekbruening
Copy link
Contributor Author

From [email protected] on February 08, 2013 16:30:49

** TODO redirect kernel32 forwards (xref issue #1073 )

on win7, forwards we care about:
% dumpbin /exports c:/windows/syswow64/kernel32.dll | grep forwarded
205 CB DecodePointer (forwarded to NTDLL.RtlDecodePointer)
212 D2 DeleteCriticalSection (forwarded to NTDLL.RtlDeleteCriticalSection)
237 EB EncodePointer (forwarded to NTDLL.RtlEncodePointer)
241 EF EnterCriticalSection (forwarded to NTDLL.RtlEnterCriticalSection)
285 11B ExitThread (forwarded to NTDLL.RtlExitUserThread)
718 2CC HeapAlloc (forwarded to NTDLL.RtlAllocateHeap)
725 2D3 HeapReAlloc (forwarded to NTDLL.RtlReAllocateHeap)
727 2D5 HeapSize (forwarded to NTDLL.RtlSizeHeap)
742 2E4 InitializeCriticalSection (forwarded to NTDLL.RtlInitializeCriticalSection)
827 33A LeaveCriticalSection (forwarded to NTDLL.RtlLeaveCriticalSection)
1213 4BC SubmitThreadpoolWork (forwarded to NTDLL.TpPostWork)

@derekbruening
Copy link
Contributor Author

From [email protected] on February 08, 2013 16:31:17

should be issue #1071

@derekbruening
Copy link
Contributor Author

From [email protected] on March 06, 2014 13:37:24

A lot of routines have already been implemented, but we still have a ways to go. This is a good issue for incremental contributions.

Here is how to go about filling in the remaining routines:

The header files in core/win32/drwinapi/ contain the initial set of routines we'd like implemented. Find routines that are not yet present in the table in the corresponding _redir.c file. Add implementations in the appropriate .c file (in the same group as in the _redir.h file: see the banner comments there). Add unit tests at the bottom of the file.

Labels: GoodContrib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant