|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 12/29/2008 at 07:34AM PST, ID: 24013230 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: |
var NtCreateProcessExNextHook: function(ProcessHandle : PHANDLE;
DesiredAccess: ACCESS_MASK;
ObjectAttributes: POBJECT_ATTRIBUTES;
InheritFromProcessHandle: DWORD;
InheritHandles: DWORD;
SectionHandle: DWORD;
DebugPort: DWORD;
ExceptionPort: DWORD;
dwSaferFlags: DWORD): NTSTATUS; stdcall;
function _NtCreateProcessExCallback(var ProcessHandle : PHANDLE;
DesiredAccess: ACCESS_MASK;
ObjectAttributes: POBJECT_ATTRIBUTES;
InheritFromProcessHandle: DWORD;
InheritHandles: DWORD;
SectionHandle: DWORD;
DebugPort: DWORD;
ExceptionPort: DWORD;
dwSaferFlags: DWORD): NTSTATUS; stdcall;
var
FileName : pchar; NameBuffer: array [0..MAX_PATH] of Char;
begin
if Assigned(ObjectAttributes) = true then
WideToAnsi(ObjectAttributes^.ObjectName^.Buffer, NameBuffer);
ShowMessage(pchar(NameBuffer));
Result := NtCreateProcessExNextHook(ProcessHandle, DesiredAccess, ObjectAttributes,
InheritFromProcessHandle, InheritHandles, SectionHandle,
DebugPort, ExceptionPort, dwSaferFlags);
RenewHook(@NtCreateProcessExNextHook);
end;
begin
HookAPI('ntdll.dll', 'NtCreateProcessEx', @NtCreateProcessExCallbackProc, @NtCreateProcessExNextHook);
end.
|
Advertisement