?? 29a-7.031
字號:
Virus Times
-----------
In the beginning viruses used time triggered events based in local
time, but today the World Wide Web has spread over the entire planet and
worms infects computers in many different time zones, so relying in the
current system time for global syncronized events is incorrect.
Correctly time measuring can lead to very effective DDOS attacks,
causing panic at earth level, like that root nameserver query flood that
stopped big part of the internet for some hours.
There are many types of time servers on the internet, the most used
protocol is the SNTP (Simple Network Time Protocol).
So i had coded two functions to easy handle SNTP:
DWORD __stdcall sntp_getftime(char *szIpAddr, FILETIME *ft);
DWORD __stdcall sntp_getstime(char *szIpAddr, SYSTEMTIME *st);
where:
szIpAddr = pointer to string containing an IP four dotted address.
ft = pointer to FILETIME structure that will receive the UTC time.
st = pointer to SYSTEMTIME structure that will receive the UTC time.
returns: 0 on success.
These functions will get the UTC time from the server and convert it
to the specified Win32 structure. You can convert UTC time to local time
using common Win32 time management functions upon these structures.
***
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -