首页
社区
课程
招聘
[求助]关于『搜易垃圾邮件清理器』 V3.5软件中读取CPUID代码的问题
发表于: 2006-2-20 17:05 5047

[求助]关于『搜易垃圾邮件清理器』 V3.5软件中读取CPUID代码的问题

2006-2-20 17:05
5047
00479868  /$  53            PUSH EBX
00479869  |.  57            PUSH EDI
0047986A  |.  89C7          MOV EDI,EAX
0047986C  |.  B8 01000000   MOV EAX,1
00479871  |.  0FA2          CPUID       ;  [取CPU的序列号作为基数??]
00479873  |.  AB            STOS DWORD PTR ES:[EDI]
00479874  |.  89D8          MOV EAX,EBX
00479876  |.  AB            STOS DWORD PTR ES:[EDI]
00479877  |.  89C8          MOV EAX,ECX
00479879  |.  AB            STOS DWORD PTR ES:[EDI]
0047987A  |.  89D0          MOV EAX,EDX

以上就是『搜易垃圾邮件清理器』 V3.5该软件读取CPUID型号或者序列号(小弟也不明白到底是什么,只知道我的机器上这里的数值是十六进制的695)的地方,哪位高手能够帮忙解释一下,因为这个软件的注册码生成要用到这个CPUID,谢谢!

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (9)
雪    币: 288
活跃值: (415)
能力值: ( LV9,RANK:290 )
在线值:
发帖
回帖
粉丝
2
看CPUID返回数的软件
建议试试CrystalCPUID



CPUID指令的详解请看这里:
http://www.lidaibin.com/blog/index.php?action=show&id=42
2006-2-20 17:18
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
谢谢指导,我先看看,不懂再问老大
2006-2-20 18:02
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
那我在程序运行到 CPUID之后,EAX等寄存器当中就存了值,其中EAX的值为695,我不知道这个695(十六进制)具体是怎么得到的,小弟想了解一下取得该值的方法和过程,谁能赐教。这个软件的整个算法当中这是必须要的,另如果不是在汇编当中,假如我用VB、E语言,怎么取得该值
2006-2-21 01:15
0
雪    币: 288
活跃值: (415)
能力值: ( LV9,RANK:290 )
在线值:
发帖
回帖
粉丝
5
这个695实际上是CPU的微码,
它代表CPU的Family是6,Model是9,Stepping ID是5,
只能通过汇编语言来读取这个数字,
该数值与CPU的种类有关
2006-2-21 15:24
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
谢谢老大,我注册算法已经都搞清楚了,该软件的注册码生成方式为
(CPUID+15120)×42=注册码(需要转换成10进制)
我本来以为通过E、或VB语言可以写出注册机来,但是现在看来是不行了。
请问老大,象这样的软件,我怎么才可以写出他的注册机呢?

又或者说这个软件会不会从他的序列号中提取CPUID?呵呵,我只是猜想

麻烦老大帮忙看一下,小弟总觉得写不出注册机,心里不是特别舒服。

因为新手,问题多多,呵呵!

软件下载地址:http://www.onlinedown.net/soft/9203.htm
2006-2-21 15:43
0
雪    币: 179
活跃值: (131)
能力值: ( LV12,RANK:290 )
在线值:
发帖
回帖
粉丝
7
用C语言,内嵌汇编,可以轻松搞定
2006-2-21 18:38
0
雪    币: 179
活跃值: (131)
能力值: ( LV12,RANK:290 )
在线值:
发帖
回帖
粉丝
8
CPU指令集中可通过CPUID获取CPU的相关信息。操作码:0F A2,指令:cpuid。关于CPU指令集的资料可参阅《Intel架构开发者手册》,好在AMD架构的CPU对CPUID指令的支持完全兼容于Intel。

调用方式:

第一种方式
mov eax, (初始值)
dw A20FH

第二种方式
mov eax, (初始值)
cpuid

预先向EAX寄存器中置入初始值,并调用cpuid指令即可返回CPU相关信息到EAX、EBX、ECX和EDX寄存器中,不同的初始值返回的信息如下表所示:

Initial EAX
Value Information Provided about the Processor
  BASIC CPUID Information  
0H EAX Maximum Input Value for Basic CPUID Information
EBX "Genu"
ECX "ntel"
EDX "inel"

1H EAX Version Information (Type, Family, Model, and Stepping ID)
EBX Bits 7-0: Brand Index
    Bits 15-8: CLFLUSH line size. (Value returned ∗ 8 = cache line size)
    Bits 23-16: Reserved.
    Bits 31-24: Processor local APIC physical ID
ECX Reserved
EDX Feature Information  
2H EAX Cache and TLB Information
EBX Cache and TLB Information
ECX Cache and TLB Information
EDX Cache and TLB Information  
3H EAX Reserved
EBX Reserved
ECX Bits 00-31 of 96 bit processor serial number. (Available in
    Pentium III processor only; otherwise,
    the value in this register is reserved.)
EDX Bits 32-63 of 96 bit processor serial number. (Available in
    Pentium III processor only; otherwise,
    the value in this register is reserved.)
  Extended Function CPUID Information  
80000000H EAX Maximum Input Value for Extended Function CPUID Information
EBX Reserved
ECX Reserved
EDX Reserved
80000001H EAX Extended Processor Signature and Extended Feature Bits.
EBX Reserved
ECX Reserved
EDX Reserved
80000002H EAX Processor Brand String
EBX Processor Brand String Continued
ECX Processor Brand String Continued
EDX Processor Brand String Continued
80000003H EAX Processor Brand String Continued
EBX Processor Brand String Continued
ECX Processor Brand String Continued
EDX Processor Brand String Continued
80000004H EAX Processor Brand String Continued
EBX Processor Brand String Continued
ECX Processor Brand String Continued
EDX Processor Brand String Continued

当通过向EAX寄存器置入0H获取Vendor Information时应顺序读取EAX、EDX和ECX的数据,如:
EBX ← 756e6547h (* "Genu", with G in the low nibble of BL *)
EDX ← 49656e69h (* "ineI", with i in the low nibble of DL *)
ECX ← 6c65746eh (* "ntel", with n in the low nibble of CL *)

不同型号或系列的CPU的EAX最大初始值如下表所示,AMD的CPU懒得找资料可自行查阅,也可通过0H初始值得到。

IA-32 Processors Highest Value in EAX
Basic Information Extended Function Information
Earlier Intel486 Processors CPUID Not Implemented CPUID Not Implemented
Later Intel486 Processors and
Pentium Processors 1H Not Implemented
Pentium Pro and Pentium II
Processors, Intel Celeron™
Processors 2H Not Implemented
Pentium III Processors 3H Not Implemented
Pentium 4 Processors 2H 80000004H
Intel Xeon Processors 2H 80000004H

当EAX初始值为1时,返回CPU版本信息到EAX寄存器,版本信息分布如下:

处理器类型对应表如下:

Type Encoding
Original OEM Processor 00B
Intel OverDrive® Processor 01B
Dual processor* 10B
Intel reserved. 11B

当EAX初始值为1时,将返回处理器功能信息到EDX寄存器中,可通过对比对应位来判断:

最后,给出一段自己写的一个获取CPU信息的小程序(可执行文件):

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int
main(int argc, char **argv)
{
    unsigned long s1, s2;
    char vendor_id[13];
    char brand_string[49];

    memset(vendor_id, 0, 13);
    memset(brand_string, 0, 49);
    __asm {
        xor eax,eax
        cpuid
        mov dword ptr vendor_id,ebx
        mov dword ptr vendor_id + 4,edx
        mov dword ptr vendor_id + 8,ecx

        mov eax, 80000002h
        cpuid
        mov dword ptr brand_string, eax
        mov dword ptr brand_string + 4, ebx
        mov dword ptr brand_string + 8, ecx
        mov dword ptr brand_string + 12, edx
        mov eax, 80000003h
        cpuid
        mov dword ptr brand_string + 16, eax
        mov dword ptr brand_string + 20, ebx
        mov dword ptr brand_string + 24, ecx
        mov dword ptr brand_string + 28, edx
        mov eax, 80000004h
        cpuid
        mov dword ptr brand_string + 32, eax
        mov dword ptr brand_string + 36, ebx
        mov dword ptr brand_string + 40, ecx
        mov dword ptr brand_string + 44, edx

        mov eax, 01h
        cpuid
        mov s1, eax
        mov s2, edx
    }

    printf("Vendor Info: \t%s\n", vendor_id);
    printf("Brand String: \t%s\n", brand_string);

    printf("\nProcessorType: \t%d\n", (s1 & 0x00003000) >> 18);
    printf("Family: \t%d\n", (s1 & 0x00000F00) >> 8);
    printf("Model: \t\t%d\n", (s1 & 0x000000F0) >> 4);
    printf("Stepping ID: \t%d\n", s1 & 0x0000000F);

    printf("\nFPU: \t%d\n", s2 & 0x00000001);
    printf("VME: \t%d\n", (s2 & 0x00000002) >> 1);
    printf("DE: \t%d\n", (s2 & 0x00000004) >> 2);
    printf("PSE: \t%d\n", (s2 & 0x00000008) >> 3);
    printf("TSC: \t%d\n", (s2 & 0x00000010) >> 4);
    printf("MSR: \t%d\n", (s2 & 0x00000020) >> 5);
    printf("PAE: \t%d\n", (s2 & 0x00000040) >> 6);
    printf("MCE: \t%d\n", (s2 & 0x00000080) >> 7);
    printf("CX8: \t%d\n", (s2 & 0x00000100) >> 8);
    printf("APIC: \t%d\n", (s2 & 0x00000200) >> 9);
    printf("SEP: \t%d\n", (s2 & 0x00000800) >> 11);
    printf("MTRR: \t%d\n", (s2 & 0x00001000) >> 12);
    printf("PGE: \t%d\n", (s2 & 0x00002000) >> 13);
    printf("MCA: \t%d\n", (s2 & 0x00004000) >> 14);
    printf("CMOV: \t%d\n", (s2 & 0x00008000) >> 15);
    printf("PAT: \t%d\n", (s2 & 0x00010000) >> 16);
    printf("PSE-36: \t%d\n", (s2 & 0x00020000) >> 17);
    printf("PSN: \t%d\n", (s2 & 0x00040000) >> 18);
    printf("CLFSN: \t%d\n", (s2 & 0x00080000) >> 19);
    printf("DS: \t%d\n", (s2 & 0x00200000) >> 21);
    printf("ACPI: \t%d\n", (s2 & 0x00400000) >> 22);
    printf("MMX: \t%d\n", (s2 & 0x00800000) >> 23);
    printf("FXSR: \t%d\n", (s2 & 0x01000000) >> 24);
    printf("SSE: \t%d\n", (s2 & 0x02000000) >> 25);
    printf("SSE2: \t%d\n", (s2 & 0x04000000) >> 26);
    printf("SS: \t%d\n", (s2 & 0x08000000) >> 27);
    printf("TM: \t%d\n", (s2 & 0x20000000) >> 29);

    system("pause");

    return 0;
}
2006-2-21 18:39
0
雪    币: 179
活跃值: (131)
能力值: ( LV12,RANK:290 )
在线值:
发帖
回帖
粉丝
9
原文引用地址:
http://www.lidaibin.com/blog/index.php?action=show&id=42
2006-2-21 18:40
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
谢谢,收下了,我回去好好消化
2006-2-23 14:04
0
游客
登录 | 注册 方可回帖
返回
//