国际棋牌

 
 加入
12
返回列表
楼主: lllangxx

取硬盘序列号-国际棋牌

[复制链接]
发表于 2016-8-17 15:39:55 | 显示全部楼层
修改卷序列号:
  1. #include

  2. const $ioctl_lock_volume = 0x90018
  3. const $ioctl_unlock_volume = 0x9001c
  4. const $tagdrive_per_sector_data = "ubyte sectordata[512]"

  5. local $hdrive, $iaccessmask, $pbuffer, $pserial
  6. local $tbuffer, $tserial, $sdrive = "c:", $bnewserial = 0x11111111

  7. $iaccessmask = bitor($generic_read, $generic_write)
  8. $pbuffer = _cm_heap_alloc(512)

  9. switch drivegetfilesystem($sdrive)
  10. case "ntfs"
  11.         $pserial = $pbuffer 72
  12. case "fat32"
  13.         $pserial = $pbuffer 67
  14. case else
  15.         _cm_heap_free($pbuffer)
  16.         msgbox(48, "error!", $sdrive & " not support.")
  17.         exit
  18. endswitch

  19. $hdrive = _cm_create_file("\\." & $sdrive, $iaccessmask, 3, 0, 3, 0)
  20. _cm_device_io_control($hdrive, $ioctl_lock_volume, 0, 0, 0, 0)
  21. _cm_read_device($hdrive, $pbuffer, 512)
  22. _cm_device_io_control($hdrive, $ioctl_unlock_volume, 0, 0, 0, 0)
  23. _cm_close_handle($hdrive)

  24. $tbuffer = dllstructcreate($tagdrive_per_sector_data, $pbuffer)

  25. $tserial = dllstructcreate("hwnd serial", $pserial)
  26. dllstructsetdata($tserial, "serial", $bnewserial)

  27. $hdrive = _cm_create_file("\\." & $sdrive, $iaccessmask, 3, 0, 3, 0)
  28. _cm_device_io_control($hdrive, $ioctl_lock_volume, 0, 0, 0, 0)
  29. _cm_write_device($hdrive, $pbuffer, 512)
  30. _cm_device_io_control($hdrive, $ioctl_unlock_volume, 0, 0, 0, 0)
  31. _cm_close_handle($hdrive)

  32. msgbox(64, "", "done!")
  33. if (drivegetfilesystem($sdrive) = "ntfs") then
  34.         msgbox(48, "", "a system reboot is required to update the serial number.")
  35. endif
  36. opt("trayiconhide", 1)
  37. processclose(@autoitpid)
复制代码
发表于 2017-8-13 22:35:00 | 显示全部楼层
终于看完了~~~












发表于 2017-9-11 21:42:16 | 显示全部楼层
找了一圈了
发表于 2021-5-3 00:17:11 | 显示全部楼层
传送的可以,学习一下
发表于 2021-5-17 11:15:33 | 显示全部楼层
在win10不能运行,郁闷,还是要找其他方法
发表于 2021-5-17 11:19:46 | 显示全部楼层
在win10不能运行,郁闷,还是要找其他方法啊,谁会吗
发表于 6 天前 | 显示全部楼层
  1. msgbox(4096,"",_diskdrive(),20)

  2. func _diskdrive() ;硬盘名称 大小 分区数量
  3.         $objwmiservice = objget("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  4.         $coldiskdrive = $objwmiservice.execquery("select * from win32_diskdrive")
  5.         local $sall = ""
  6.         for $object in $coldiskdrive
  7.                 $sall &= stringstripws("序列号" & $object.serialnumber, 4) & @crlf
  8.         next
  9.         $diskdrive = $sall
  10.         return $diskdrive
  11. endfunc   ;==>_diskdrive
复制代码
您需要登录后才可以回帖 登录 | 加入

||小黑屋|国际棋牌 ( ) "));

gmt 8, 2023-12-7 00:52 , processed in 0.079798 second(s), 14 queries .

powered by x3.5

© 2001-2023 .

返回列表
网站地图