SplitPath, A_WinDir,,,,,Root Root:=Root . "" DriveGet,SerialNumber,Serial, %Root% ;获取机器码 MsgBox,%SerialNumber% return Serial:=MD5(SerialNumber,StrLen(SerialNumber)) MD5(ByRef Buf, L) { Static P, Q, N, i, a,b,c,d, t, h0,h1,h2,h3, y = 0xFFFFFFFF h0 := 0x67452301, h1 := 0xEFCDAB89, h2 := 0x98BADCFE, h3 := 0x10325476 N := Ceil((L+9)/64)*64 VarSetCapacity(Q,N,0) P := &Q DllCall("RtlMoveMemory", UInt,P, UInt,&Buf, UInt,L) DllCall("RtlFillMemory", UInt,P+L, UInt,1, UInt,0x80) DllCall("ntdll.dllRtlFillMemoryUlong",UInt,P+N-8,UInt,4,UInt,8*L) Loop % N//64 { Loop 16 i := A_Index-1, w%i% := *P | *(P+1)> (32-b) } hex(x) { SetFormat Integer, HEX x += 0x100000000, x := SubStr(x,-1) . SubStr(x,8,2) . SubStr(x,6,2) . SubStr(x,4,2) SetFormat Integer, DECIMAL return x }