1 Star 0 Fork 0

phy0292/cheat-engine

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cpuidunit.pas 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
cheat-engine 提交于 2019-12-20 00:49 +08:00 . Fix registry issues
unit cpuidUnit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
type
TCPUIDResult=record
eax: dword;
ebx: dword;
ecx: dword;
edx: dword;
end;
function CPUID(index: dword; index2: dword=0): TCPUIDResult;
implementation
{$ifdef cpu32}
procedure _cpuid(p: pointer); assembler;
asm
push edi
mov edi,p
push eax
push ebx
push ecx
push edx
mov eax,[edi]
mov ebx,[edi+4]
mov ecx,[edi+8]
mov edx,[edi+12]
cpuid
mov [edi],eax
mov [edi+4],ebx
mov [edi+8],ecx
mov [edi+12],edx
pop edx
pop ecx
pop ebx
pop eax
pop edi
end;
{$endif}
{$ifdef cpu64}
procedure _cpuid(p: pointer); stdcall; assembler;
asm
mov r8,p
mov r9,rbx //save rbx
mov eax,[r8]
mov ebx,[r8+4]
mov ecx,[r8+8]
mov edx,[r8+12]
cpuid
mov [r8],eax
mov [r8+4],ebx
mov [r8+8],ecx
mov [r8+12],edx
mov rbx,r9 //restore rbx
end;
{$endif}
function CPUID(index: dword; index2: dword=0): TCPUIDResult;
var
r: TCPUIDResult;
begin
r.eax:=index;
r.ebx:=0;
r.ecx:=index2;
r.edx:=0;
_cpuid(@r);
result:=r;
end;
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/phy0292/cheat-engine.git
git@gitee.com:phy0292/cheat-engine.git
phy0292
cheat-engine
cheat-engine
master

搜索帮助