Time:10-13
CodePudding user response:
search "VB6 WMI"
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As String, ByRef hWnd As Long, ByRef Msg As Long, ByRef wParam As Long, ByRef lParam As Long) As Long Private m_CPUAsm As String The Public Function GetCPUSerialAPI () As String Dim sOut As String Dim eax As Long, ebx As Long, ecx As Long, edx As Long Call CallWindowProc (CPUAsm, eax, ebx, ecx, edx) If eax & gt; 0 Then Eax=1 CallWindowProc CPUAsm, eax, ebx, ecx, edx If eax & lt;> 0 Then sOut=Right (" 00000000 "& amp; Hex (eax), 8) If edx & lt;> 0 Then sOut=Right (" 00000000 "& amp; Hex (edx), 8) & amp; SOut GetCPUSerialAPI=sOut End the If End the Function Private Function CPUAsm () As String If m_CPUAsm="" Then Dim the Asm As String Asm=Asm & amp; CRH (& amp; H56) '56 push esi Asm=Asm & amp; CRH (& amp; H55) '55 push ebp Asm=Asm & amp; CRH (& amp; H8B) & amp; CRH (& amp; HEC) '8 b EC mov ebp, esp Asm=Asm & amp; CRH (& amp; H8B) & amp; CRH (& amp; H75) & amp; CRH (& amp; HC) '8 b, 75 c mov esi, dword PTR [ebp + 0 ch] Asm=Asm & amp; CRH (& amp; H8B) & amp; CRH (& amp; H6) '06 mov eax, 8 b dword PTR (esi) Asm=Asm & amp; CRH (& amp; HF) & amp; CRH (& amp; HA2) '0 f A2 cpuid Asm=Asm & amp; CRH (& amp; H8B) & amp; CRH (& amp; H75) & amp; CRH (& amp; HC) '8 b, 75 c mov esi, dword PTR [ebp + 0 ch] Asm=Asm & amp; CRH (& amp; H89) & amp; CRH (& amp; H6) '06 89 mov dword PTR (esi), eax Asm=Asm & amp; CRH (& amp; H8B) & amp; CRH (& amp; H75) & amp; CRH (& amp; H10) '8 b 75 10 mov esi, dword PTR [ebp + 10 h] Asm=Asm & amp; CRH (& amp; H89) & amp; CRH (& amp; H1E) '89 1 e mov dword PTR (esi), ebx Asm=Asm & amp; CRH (& amp; H8B) & amp; CRH (& amp; H75) & amp; CRH (& amp; H14) '8 b 75 14 mov esi, dword PTR [ebp + 14 h] Asm=Asm & amp; CRH (& amp; H89) & amp; CRH (& amp; HE) '89 0 e mov dword PTR (esi), ecx Asm=Asm & amp; CRH (& amp; H8B) & amp; CRH (& amp; H75) & amp; CRH (& amp; H18) '8 b 75 18 mov esi, dword PTR [ebp + 18 h] Asm=Asm & amp; CRH (& amp; H89) & amp; CRH (& amp; H16) '89 16 mov dword PTR (esi), edx Asm=Asm & amp; CRH (& amp; H5D) '5 d pop ebp Asm=Asm & amp; CRH (& amp; '5 e pop esi H5E) Asm=Asm & amp; CRH (& amp; HC2) & amp; CRH (& amp; H10) & amp; CRH (& amp; H0) 'C2 10. 00 ret 10 h M_CPUAsm=Asm End the If CPUAsm=m_CPUAsm End the Function
Page link:https//www.codepudding.com/Softwareengineering/64374.html