- ; Processor Name v3
- ;
- ; CPUNAME.ASM
- ; Copyright (C) 2021 Boo Khan Ming
- ;
- ; MIT license apply
- ;
- format PE GUI 4.0
- entry start
- include 'win32a.inc'
- section '.data' readable writable
- _caption db 'Processor Name',0
- section '.code' code readable writable executable
- _name rb 48
- start:
- mov eax, 0x80000002
- cpuid
- mov dword [_name], eax
- mov dword [_name + 4], ebx
- mov dword [_name + 8], ecx
- mov dword [_name + 12], edx
- mov eax, 0x80000003
- cpuid
- mov dword [_name + 16], eax
- mov dword [_name + 20], ebx
- mov dword [_name + 24], ecx
- mov dword [_name + 28], edx
- mov eax, 0x80000004
- cpuid
- mov dword [_name + 32], eax
- mov dword [_name + 36], ebx
- mov dword [_name + 40], ecx
- mov dword [_name + 44], edx
- .show:
- push 0x40
- push _caption
- push _name
- push 0
- call [MessageBox]
- push 0
- call [ExitProcess]
- section '.idata' import readable writable
- library kernel,'KERNEL32.DLL',\
- user,'USER32.DLL'
- import kernel,\
- ExitProcess,'ExitProcess'
- import user,\
- MessageBox,'MessageBoxA'
复制代码 |