name22

NtQuerySystemTime - Get windows system time

Jul 20th, 2013
139
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $hNtDll = DllOpen("Ntdll.dll")
  2.  
  3. ConsoleWrite(_NtQuerySystemTime($hNtDll) & @CRLF)
  4.  
  5. DllClose($hNtDll)
  6.  
  7. ; #FUNCTION# ====================================================================================================================
  8. ; Name ..........: _NtQuerySystemTime
  9. ; Description ...: Returns the system time in a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
  10. ; Syntax ........: _NtQuerySystemTime([$_hNtdll = Default])
  11. ; Parameters ....: $_hNtdll             - [optional] Handle to an opened Ntdll.dll file.
  12. ; Return values .: Success - System time in a 64-bit integer.
  13. ;                  Failure - -1 and sets @error to 1.
  14. ; Author ........: name22 (www.autoit.de)
  15. ; Modified ......:
  16. ; Remarks .......:
  17. ; Related .......: _RtlTimeToSecondsSince1970
  18. ; Link ..........: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724512%28v=vs.85%29.aspx
  19. ; Example .......: Yes
  20. ; ===============================================================================================================================
  21. Func _NtQuerySystemTime($_hNtdll = Default)
  22.     If $_hNtdll = Default Then $_hNtdll = "Ntdll.dll"
  23.  
  24.     $_aRet = DllCall($_hNtdll, "INT", "NtQuerySystemTime", "INT64*", "")
  25.     If @error Then Return SetError(1, 0, -1)
  26.  
  27.     Return $_aRet[1]
  28. EndFunc
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×