用asm 来嵌入到delphi程序中,
ASM
.....
END;
ASM
.....
END;
解决方案 »
- Delphi 批量更新有问题 ApplyUpdates (少用) ,各位高手请看下代码!
- 在Canvas 上 显示文字的问题
- 弱弱的问,为什么我的控件栏里没有QReport和Dicision Cube页面?
- 如何得到主窗口打开完成后的事件,比如我想完成程序载入后执行一些内容。在线...
- 请问下面的语句是什么意思 干什么用的??
- 请教高手,能否提取 .html 文件的内容?????
- 大家我看看有什么错,是关于杀广告窗体的?
- 求救~~~如何将转译visualfoxpro成delphi程序
- 关于主/从窗口
- 大侠救我啊!!!! 为什么我一执行调用DLL的程序就出现非法操作!!!
- 请问如何象JetCar那样实现文件的分段同步下载
- 如何在delphi中执行dos命令?
我要完整的答案,实际上,我已经做到下面这个程度:
CONST
GDTR=0; //df
SavedGate=0; //dq 0
Ourgate:DWORD= ARRAY [0..3] OF Dword=($0,$28,$ee00,$0);
implementation{$R *.DFM}
procedure Ring0Proc;
asm
mov eax, CR0
iretd
end;procedure startup;
asm
mov eax, offset Ring0Proc
mov [OurGate],AX // ; Put the offset words
shr eax, 16 //; into our descriptor
mov [OurGate+6], ax xor eax, eax sgdt fword ptr GDTR
mov ebx, dword ptr [GDTR+2] //; load GDT Base Address
sldt ax
add ebx, eax //; Address of the LDT descriptor in
// ; ebx
mov al, [ebx+4] // ; Load the base address
mov ah, [ebx+7] // ; of the LDT itself into
shl eax, 16 // ; eax, refer to your pmode
mov ax, [ebx+2] // ; Address of int9 descriptor in ebx mov edi, offset SavedGate
mov esi, ebx
movsd // ; Save the old descriptor
movsd //; into SavedGate mov edi, ebx
mov esi, offset OurGate
movsd // ; Replace the old handler
movsd // ; with our new one int 9h // ; Trigger the exception, thus
// ; passing control to our Ring0
// ; procedure mov edi, ebx
mov esi, offset SavedGate
movsd //; Restore the old handler
movsd call ExitProcess LARGE -1end;
编译后,有3出错误!
mov [ourgate],ax
..
mov [ourgate+6],ax
..
stid fWORDd ptr GDTR
..
call winprocexit
若上述4个错误能消灭掉,非常感谢!!!
这是个变量吧,你怎么定义在常量里
mov [ebx],ax
2.delphi中没有fword,你可以声明 6个byte大小的array,sidt yourarray即可
3.call ExitProcess,LRAGE -1 是汇编编译器预处理的内容,是宏,你可以
push -1
call ExitProcess
来结束程序