Comments 4
Функции ядра находятся в
Вы не перепутали?
gdi32.dll
и user32.dll
?Вы не перепутали?
Разница же состоит в том, что в функциях zw- не проводится валидация параметров. <...> Работает это так: если вызывается zw, то он загружает в EAX номер функции, в EDX ложит указатель на стек ядра, а потом вызывает nt- вариант, который не проводит валидацию.
Хм, по-вашему выходит, и Zw-функции не проводят валидацию, и Nt-функции не проводят?
Где же она проводится?
msdn.microsoft.com/en-us/library/windows/hardware/ff565438%28v=vs.85%29.aspx
For calls from a kernel-mode driver, the Nt and Zw versions of a routine differ in how they handle the parameter values that the caller passes to the routine.
A kernel-mode driver calls the Zw version of a native system services routine to inform the routine that the parameters come from a trusted, kernel-mode source. In this case, the routine assumes that it can safely use the parameters without first validating them. However, if the parameters might be from either a user-mode source or a kernel-mode source, the driver instead calls the Nt version of the routine, which determines, based on the history of the calling thread, whether the parameters originated in user mode or kernel mode.
В ntdll обе версии приводят к вызову в ядре Zw-версии. Nt напрямую можно импортировать только из драйвера, т. к. там валидация может быть не нужна.
Sign up to leave a comment.
Вызов функций Windows в режиме ядра