-
Notifications
You must be signed in to change notification settings - Fork 562
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
add Windows 10 support #1714
Comments
There are not many new ntoskrnl syscalls:
|
** TODO wow64 syscall using near indirect call
Symbols don't show a field beyond +0x248 =
Compare to pre-win10:
We made the far call* the syscall gateway before to have it inlined where |
Running c:/windows/system32/calc.exe and you end up with |
Back to the wow64 syscalls: I was going to use the far jmp and live with the perf hit of always using shared_syscall, but it complicates does_syscall_ret_to_callsite() and also our own generation of syscall instrs, so it's not clear what the best solution is. |
** TODO wow64 NtQueryInformationProcess has weird wrapper
So it adds 0xb to 0x59da1e68 => 0x59da1e73, and w/ the push of 0x33, ends So the question is: why does it read a byte from 77cd8d5d and if it's 0x4b This is the only syscall like this, as evidenced by it being the only one |
** TODO ASSERT os_take_over_wow64_extra() Running wow64 notepad x64 PEB is still in low 4GB |
** TODO ASSERT on safe_read fault continuation for Control Flow Guard binaries Running notepad on x86 kernel (hello works fine) (and it turns out,
I'm omitting a lot of debugging here and putting in some summaries: Return value is 0xc000000d == STATUS_INVALID_PARAMETER Raw sysenter code seems fine, and it's not some sysenter source security Setting just integer (0x10002) works! *** TODO is it TEB stack fields? TODO -- try tweaking them, and review DrMem#1676 notepad:
VS2013 dumpbin:
We need 8.1 SDK for this one: |
** TODO ASSERT ntdll.c:1097 TESTALL(CONTEXT_DR_STATE_NO_YMM, cxt->ContextFlags) Running wow64 winthread.exe
+0x000 ContextFlags : 0x10007 That's CONTROL, INTEGER, and SEGMENTS CONTEXT_DR_STATE_NO_YMM wants CONTROL, INTEGER, and CONTEXT_EXTENDED_REGISTERS |
Back to the syscall wrappers again here is more discussion: user32, etc. have own copy of Wow64SystemServiceCall
The user32 one (and presumably all of them) targets the central
And comes back here -- this jmp targets the retaddr of "call edx":
I'm sticking with the near call* as the "syscall" for these reasons:
We have to pattern-match to handle the multiple copies, and tools will miss a few instrs, but these negatives seem outweighed by the positives. |
Re: the NtContinue assert: it is indeed the TEB stack fields from DynamoRIO/drmemory#1676 DynamoRIO/drmemory#1723. Looks like we need to implement #1692 and swap TEB stack fields even if no client. |
** TODO (#899) ASSERT NYI syscall.c:2740 NtSetInformationVirtualMemory Running notepad, typing something, and then hitting Ctrl+S <Application C:\Windows\SysWOW64\notepad.exe (4432). Internal Error: DynamoRIO debug check failure: Not implemented @d:\dynamorio_package\core\win32\syscall.c:2740 (0) It's the new syscall NtSetInformationVirtualMemory which is related to CFG => #899 |
** TODO CURIOSITY about missing an unmap Running notepad, typing something, then closing: <CURIOSITY : !last_deallocated->unload_in_progress in file d:\dynamorio_package\core\vmareas.c line 10916 Turns out we're not calling postsys_UnmapViewOfSection for NtUnmapViewOfSectionEx. |
*** TODO related curiosity still there x86 notepad after saving in dialog: <CURIOSITY : !last_deallocated->unload_in_progress || ((last_deallocated->last_unload_base <= module_base && module_base < (last_deallocated->last_unload_base + last_deallocated->last_unload_size)) && "race - multiple unmaps") in file d:\dynamorio_package\core\vmareas.c l ** TODO CURIOSITY "read off end of rsrc version" notepad save dialog: <CURIOSITY : (0) && "read off end of rsrc version" in file d:\dynamorio_package\core\win32\module.c line 6075 |
** TODO AppInit injection => works on wow64 now, leaving #1522 for others % bin32/drconfig -debug -ops "-msgbox_mask 15" -reg notepad.exe -c samples/bin32/bbcount.dll That's #1522. *** DONE missing get_platform() libutil win10 version *** DONE ldr_module_statically_linked() thinks user32 is not statically linked direct PEB version check doesn't handle win10 |
Test suites -- I didn't copy src dir over though: *** TODO x64 2nd attempt: 10 failures (6 expected) These failed b/c I didn't copy src dir over: These may be real bugs: *** TODO wow64: 9 failures
**** DONE -opt_speed failing => fixed now *** TODO x86: 16 failures but 6 from missing filter event => #1769
|
Split mixed-mode off as #1770 b/c I do not plan to fix it |
For reference these are the commits that added win10 support:
|
This issue covers adding Windows 10 support to DynamoRIO
xref DrMem issue: DynamoRIO/drmemory#1669
The text was updated successfully, but these errors were encountered: