我一直在阅读有关在 Windows 中调用系统调用的方式。
我读过的所有文章的总体主题是:
64bit-在 ntdll 32bit 中调用-
从 ntdll 跳转到 KiFastSystemcall
但是当我打开带有 64 位和 32 位 ntdlls 的 IDA 以验证这些文章时,我看到的是:
(32 位)
NtCreateFile proc near
mov eax, 55h ; syscall num
mov edx, offset j_Wow64Transition
call edx ; weird stub is called instead of KiFastSystemcall.
; I couldn't find anything about it.perhaps a wrapper around KiFastSystemcall?
retn 2Ch
NtCreateFile endp
(64位)
NtCreateFile proc near
mov r10, rcx ; NtCreateFile
mov eax, 55h
test byte ptr ds:7FFE0308h, 1 ; some test to decide wether to use int 0x2E or syscall?
; I don't know why int 0x2E be used. I thought it causes overhead?
jnz short loc_18009CB15
syscall
retn
loc_18009CB15:
int 2Eh
retn
NtCreateFile endp
如果有人知道为什么系统调用是这样调用的,我很想知道。
总结一下:
(32 位)为什么是 j_Wow64Transition 而不是 KiFastSystemcall?
(64 位)正在比较什么,为什么?
谢谢。