|
楼主 |
发表于 2006-11-13 11:39:42| 字数 1,830| - 中国–四川–绵阳 联通/广电网
|
显示全部楼层
源代码:(汇编)
- ;
- ; System Install date/time
- ;
- format PE GUI 5.0
- entry start
- include 'win32ax.inc'
- ERROR_SUCCESS=0
- KEY_QUERY_VALUE=0x0001
- section '.SIT' code data readable writable executable
- start:
- invoke RegOpenKeyEx,HKEY_LOCAL_MACHINE,\
- 'SOFTWARE\Microsoft\Windows NT\CurrentVersion',\
- 0,KEY_QUERY_VALUE,key_handle
- cmp eax,ERROR_SUCCESS
- jne error_open_key
- invoke RegQueryValueEx,dword[key_handle],\
- 'InstallDate',NULL,NULL,install_time,byte_count
- cmp eax,ERROR_SUCCESS
- jne error_query_value
- invoke RegCloseKey,dword[key_handle]
- cinvoke localtime,install_time
- cinvoke asctime,eax
- cinvoke wsprintf,buffer,'%s',eax
- invoke MessageBox,NULL,buffer,'System Install Time',\
- MB_OK+MB_ICONINFORMATION
- ret
- error_open_key:
- invoke MessageBox,NULL,\
- 'Can not open key for querying value',\
- 'Error',MB_ICONERROR+MB_OK
- ret
- error_query_value:
- invoke RegCloseKey,dword[key_handle]
- invoke MessageBox,NULL,\
- 'Can not query install time date value',\
- 'Error',MB_ICONERROR+MB_OK
- ret
- ;--------------------------------------
- key_handle dd ?
- install_time dd ?
- byte_count dd 4
- buffer rb 64
- ;--------------------------------------
- section '.RES' resource data readable
- directory RT_VERSION,versions,\
- RT_MANIFEST,manifests
- resource manifests,\
- 1,LANG_NEUTRAL,manifest
- resdata manifest
- include 'winxpvs.res'
- endres
- resource versions,\
- 1,LANG_NEUTRAL,version
- versioninfo version,VOS__WINDOWS32,VFT_APP,\
- VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0,\
- 'CompanyName','cwu@live.com',\
- 'FileDescription','Query System Install Time',\
- 'LegalCopyright',<'Copyright ',0A9h,' 2006 Chris Wu'>,\
- 'FileVersion','1.0.0.0',\
- 'ProductVersion','1.0.0.0',\
- 'OriginalFilename','instime.exe'
- data import
- library advapi32,'advapi32.dll',\
- msvcrt,'msvcrt.dll',\
- user32,'user32.dll'
- import advapi32,\
- RegCloseKey,'RegCloseKey',\
- RegOpenKeyEx,'RegOpenKeyExA',\
- RegQueryValueEx,'RegQueryValueExA'
- import msvcrt,\
- localtime,'localtime',\
- asctime,'asctime'
- import user32,\
- wsprintf,'wsprintfA',\
- MessageBox,'MessageBoxA'
- end data
复制代码 |
|