⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.asm

📁 CMOS数据的写程序
💻 ASM
📖 第 1 页 / 共 5 页
字号:
	.386p
	ifdef ??version
	if ??version GT 500H
	.mmx
	endif
	endif
	model flat
	ifndef	??version
	?debug	macro
	endm
	endif
	?debug	S "E:\CMOSRW\Unit1.cpp"
	?debug	T "E:\CMOSRW\Unit1.cpp"
_TEXT	segment dword public use32 'CODE'
_TEXT	ends
_DATA	segment dword public use32 'DATA'
_DATA	ends
_BSS	segment dword public use32 'BSS'
_BSS	ends
DGROUP	group	_BSS,_DATA
_BSS	segment dword public use32 'BSS'
	align	4
_DriverHandle	label	dword
	db	4	dup(?)
	align	4
_Ring	label	byte
	db	32	dup(?)
	align	4
_retbyte	label	dword
	db	4	dup(?)
_BSS	ends
_DATA	segment dword public use32 'DATA'
$mpbeaiia	label	byte
	db	0
	db	259	dup(?)
_DATA	ends
_DATA	segment dword public use32 'DATA'
@_$DCAF$@BuildDriverService$qv	segment virtual
	align	2
@@_$DCAF$@BuildDriverService$qv	label	dword
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-4
	dd	0
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-8
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-12
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-16
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-20
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-24
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-4
	dd	0
@_$DCAF$@BuildDriverService$qv	ends
_DATA	ends
_DATA	segment dword public use32 'DATA'
@_$ECTBF$@BuildDriverService$qv	segment virtual
	align	2
@@_$ECTBF$@BuildDriverService$qv	label	dword
	dd	0
	dd	-60
	dw	0
	dw	5
	dd	0
	dd	@@_$DCAF$@BuildDriverService$qv
	dw	8
	dw	5
	dd	0
	dd	@@_$DCAF$@BuildDriverService$qv+16
@_$ECTBF$@BuildDriverService$qv	ends
_DATA	ends
_TEXT	segment dword public use32 'CODE'
@BuildDriverService$qv	segment virtual
	align	2
@@BuildDriverService$qv	proc	near
?live16385@0:
@1:
	push ebp
	mov ebp,esp
	add esp,-320
	mov eax,offset @@_$ECTBF$@BuildDriverService$qv
	push ebx
	push esi
	push edi
	call @__InitExceptBlockLDTC
	push 983103
	push 0
	push 0
	call @OpenSCManagerA
	mov esi,eax
?live16385@32: ; ESI = scHandle
	test esi,esi
	jne       short @2
?live16385@48: ; 
	xor eax,eax
	mov edx,dword ptr [ebp-60]
	mov dword ptr fs:[0],edx
	jmp @3
?live16385@64: ; ESI = scHandle
@2:
	push 983551
	push offset s@+4
	push esi
	call @OpenServiceA
	mov ebx,eax
?live16385@80: ; EBX = srvHandle, ESI = scHandle
	test ebx,ebx
	jne       @4
?live16385@96: ; ESI = scHandle
@5:
	push esi
	lea edi,dword ptr [ebp-320]
	mov esi,offset $mpbeaiia
	mov ecx,65
	rep movsd
	pop esi
	xor eax,eax
	mov word ptr [ebp-44],20
	mov dword ptr [ebp-8],eax
	mov ecx,dword ptr [@Forms@Application]
	inc dword ptr [ebp-32]
	lea edx,dword ptr [ebp-8]
	mov eax,dword ptr [ecx]
	call @@Forms@TApplication@GetExeName$qqrv
	lea eax,dword ptr [ebp-8]
	mov eax,dword ptr [eax]
	xor edx,edx
	mov dword ptr [ebp-12],edx
	lea edx,dword ptr [ebp-12]
	inc dword ptr [ebp-32]
	call @@Sysutils@ExtractFilePath$qqrx17System@AnsiString
	lea eax,dword ptr [ebp-12]
	push eax
	mov edx,offset s@+12
	lea eax,dword ptr [ebp-16]
	call @@System@AnsiString@$bctr$qqrpxc
	inc dword ptr [ebp-32]
	xor eax,eax
	mov dword ptr [ebp-20],eax
	lea edx,dword ptr [ebp-16]
	inc dword ptr [ebp-32]
	lea ecx,dword ptr [ebp-20]
	pop eax
	call @@System@AnsiString@$badd$xqqrrx17System@AnsiString
	lea edx,dword ptr [ebp-20]
	push edx
	mov edx,offset s@+20
	lea eax,dword ptr [ebp-24]
	call @@System@AnsiString@$bctr$qqrpxc
	inc dword ptr [ebp-32]
	xor eax,eax
	mov dword ptr [ebp-4],eax
	lea edx,dword ptr [ebp-24]
	inc dword ptr [ebp-32]
	lea ecx,dword ptr [ebp-4]
	pop eax
	call @@System@AnsiString@$badd$xqqrrx17System@AnsiString
	dec dword ptr [ebp-32]
	lea eax,dword ptr [ebp-24]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
	dec dword ptr [ebp-32]
	lea eax,dword ptr [ebp-20]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
	dec dword ptr [ebp-32]
	lea eax,dword ptr [ebp-16]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
	dec dword ptr [ebp-32]
	lea eax,dword ptr [ebp-12]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
	dec dword ptr [ebp-32]
	lea eax,dword ptr [ebp-8]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
	mov word ptr [ebp-44],8
	cmp dword ptr [ebp-4],0
	je        short @6
	mov ecx,dword ptr [ebp-4]
	jmp short @7
@6:
	mov ecx,offset s@+25
@7:
	push ecx
	lea eax,dword ptr [ebp-320]
	push eax
	call @_strcat
	add esp,8
	lea edx,dword ptr [ebp-320]
	push 0
	push 0
	push 0
	push 0
	push 0
	push edx
	push 1
	push 3
	push 1
	push 983551
	push offset s@+34
	push offset s@+26
	push esi
	call @CreateServiceA
	mov ebx,eax
?live16385@160: ; EBX = srvHandle, ESI = scHandle
	dec dword ptr [ebp-32]
	lea eax,dword ptr [ebp-4]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
	mov word ptr [ebp-44],0
@8:
@4:
	test ebx,ebx
	jne       short @9
?live16385@192: ; 
	xor eax,eax
	mov edx,dword ptr [ebp-60]
	mov dword ptr fs:[0],edx
	jmp short @3
?live16385@208: ; EBX = srvHandle, ESI = scHandle
@9:
	push 0
	push 0
	push ebx
	call @StartServiceA
	push ebx
	call @CloseServiceHandle
?live16385@240: ; ESI = scHandle
	push esi
	call @CloseServiceHandle
?live16385@256: ; 
	mov al,1
	mov edx,dword ptr [ebp-60]
	mov dword ptr fs:[0],edx
@10:
@3:
	pop edi
	pop esi
	pop ebx
	mov esp,ebp
	pop ebp
	ret 
@@BuildDriverService$qv	endp
@BuildDriverService$qv	ends
_TEXT	ends
_TEXT	segment dword public use32 'CODE'
@DeleteDriverService$qv	segment virtual
	align	2
@@DeleteDriverService$qv	proc	near
?live16389@0:
@11:
	push ebx
	push esi
	add esp,-28
	push 983103
	push 0
	push 0
	call @OpenSCManagerA
	mov esi,eax
?live16389@32: ; ESI = scHandle
	test esi,esi
	jne       short @12
?live16389@48: ; 
	xor eax,eax
	jmp short @13
?live16389@64: ; ESI = scHandle
@12:
	push 983551
	push offset s@+42
	push esi
	call @OpenServiceA
	mov ebx,eax
?live16389@80: ; EBX = srvHandle, ESI = scHandle
	test ebx,ebx
	je        short @14
	push esp
	push 1
	push ebx
	call @ControlService
	push ebx
	call @DeleteService
@14:
	push ebx
	call @CloseServiceHandle
?live16389@144: ; ESI = scHandle
	push esi
	call @CloseServiceHandle
?live16389@160: ; 
	mov al,1
@15:
@13:
	add esp,28
	pop esi
	pop ebx
	ret 
@@DeleteDriverService$qv	endp
@DeleteDriverService$qv	ends
_TEXT	ends
_TEXT	segment dword public use32 'CODE'
@OpenDriver$qv	segment virtual
	align	2
@@OpenDriver$qv	proc	near
?live16390@0:
@16:
	push ebx
	call @@BuildDriverService$qv
	test al,al
	jne       short @17
	xor eax,eax
@21:
	pop ebx
	ret 
@17:
	push 0
	push 0
	push 3
	push 0
	push 0
	push -1073741824
	push offset s@+50
	call @CreateFileA
	mov ebx,eax
	mov dword ptr [_DriverHandle],ebx
?live16390@64: ; EBX = @temp0
	cmp ebx,-1
	jne       short @19
?live16390@80: ; 
	xor eax,eax
@22:
	pop ebx
	ret 
@19:
	mov al,1
@20:
@18:
	pop ebx
	ret 
@@OpenDriver$qv	endp
@OpenDriver$qv	ends
_TEXT	ends
_TEXT	segment dword public use32 'CODE'
@CloseDriver$qv	segment virtual
	align	2
@@CloseDriver$qv	proc	near
?live16391@0:
@23:
	mov eax,dword ptr [_DriverHandle]
	push eax
	call @CloseHandle
	call @@DeleteDriverService$qv
	test al,al
	jne       short @24
	xor eax,eax
@27:
	ret 
@24:
	mov al,1
@26:
@25:
	ret 
@@CloseDriver$qv	endp
@CloseDriver$qv	ends
_TEXT	ends
_BSS	segment dword public use32 'BSS'
_OSVersion	label	byte
	db	1	dup(?)
	align	4
_Ring3ProcName	label	byte
	db	8	dup(?)
_BSS	ends
_DATA	segment dword public use32 'DATA'
@_$DCCF$@OpenWinRing$qv	segment virtual
	align	2
@@_$DCCF$@OpenWinRing$qv	label	dword
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-4
	dd	0
@_$DCCF$@OpenWinRing$qv	ends
_DATA	ends
_DATA	segment dword public use32 'DATA'
@_$ECTDF$@OpenWinRing$qv	segment virtual
	align	2
@@_$ECTDF$@OpenWinRing$qv	label	dword
	dd	0
	dd	-40
	dw	0
	dw	5
	dd	0
	dd	@@_$DCCF$@OpenWinRing$qv
@_$ECTDF$@OpenWinRing$qv	ends
_DATA	ends
_TEXT	segment dword public use32 'CODE'
@OpenWinRing$qv	segment virtual
	align	2
@@OpenWinRing$qv	proc	near
?live16392@0:
@28:
	push ebp
	mov ebp,esp
	add esp,-40
	mov eax,offset @@_$ECTDF$@OpenWinRing$qv
	push ebx
	call @__InitExceptBlockLDTC
	call @GetVersion
	mov ebx,eax
	and bl,-1
	mov byte ptr [_OSVersion],bl
?live16392@32: ; EBX = @temp0
	cmp bl,4
	je        short @29
?live16392@48: ; 
	call @@OpenDriver$qv
	test al,al
	jne       short @30
	mov word ptr [ebp-24],8
	mov edx,offset s@+62
	lea eax,dword ptr [ebp-4]
	call @@System@AnsiString@$bctr$qqrpxc
	inc dword ptr [ebp-12]
	mov eax,dword ptr [eax]
	call @@Dialogs@ShowMessage$qqrx17System@AnsiString
	dec dword ptr [ebp-12]
	lea eax,dword ptr [ebp-4]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
	call @@CloseDriver$qv
	mov ecx,dword ptr [@Forms@Application]
	mov eax,dword ptr [ecx]
	call @@Forms@TApplication@Terminate$qqrv
@30:
@29:
	mov edx,dword ptr [ebp-40]
	mov dword ptr fs:[0],edx
@31:
	pop ebx
	mov esp,ebp
	pop ebp
	ret 
@@OpenWinRing$qv	endp
@OpenWinRing$qv	ends
_TEXT	ends
_DATA	segment dword public use32 'DATA'
@_$DCEF$@CloseWinRing$qv	segment virtual
	align	2
@@_$DCEF$@CloseWinRing$qv	label	dword
	dd	@@$xt$17System@AnsiString
	dd	4
	dd	-4
	dd	0
@_$DCEF$@CloseWinRing$qv	ends
_DATA	ends
_DATA	segment dword public use32 'DATA'
@_$ECTFF$@CloseWinRing$qv	segment virtual
	align	2
@@_$ECTFF$@CloseWinRing$qv	label	dword
	dd	0
	dd	-40
	dw	0
	dw	5
	dd	0
	dd	@@_$DCEF$@CloseWinRing$qv
@_$ECTFF$@CloseWinRing$qv	ends
_DATA	ends
_TEXT	segment dword public use32 'CODE'
@CloseWinRing$qv	segment virtual
	align	2
@@CloseWinRing$qv	proc	near
?live16395@0:
@32:
	push ebp
	mov ebp,esp
	add esp,-40
	mov eax,offset @@_$ECTFF$@CloseWinRing$qv
	call @__InitExceptBlockLDTC
	cmp byte ptr [_OSVersion],4
	je        short @33
	call @@CloseDriver$qv
	test al,al
	jne       short @34
	mov word ptr [ebp-24],8
	mov edx,offset s@+82
	lea eax,dword ptr [ebp-4]
	call @@System@AnsiString@$bctr$qqrpxc
	inc dword ptr [ebp-12]
	mov eax,dword ptr [eax]
	call @@Dialogs@ShowMessage$qqrx17System@AnsiString
	dec dword ptr [ebp-12]
	lea eax,dword ptr [ebp-4]
	mov edx,2
	call @@System@AnsiString@$bdtr$qqrv
@34:
@33:
	mov ecx,dword ptr [ebp-40]
	mov dword ptr fs:[0],ecx
@35:
	mov esp,ebp
	pop ebp
	ret 
@@CloseWinRing$qv	endp
@CloseWinRing$qv	ends
_TEXT	ends
_TEXT	segment dword public use32 'CODE'
@SaveAllReg$qqrv	segment virtual
	align	2
@@SaveAllReg$qqrv	proc	near
?live16398@0:
	push ebx
	push esi
	push edi
@36:
	push	 eax
	mov	 eax, offset _Ring+4
	mov	 [eax][04], ebx
	mov	 [eax][08], ecx
	mov	 [eax][12], edx
	mov	 [eax][16], esi
	mov	 [eax][20], edi
	mov	 [eax][24], ebp
	mov	 ebx, eax
	pop	 eax
	mov	 [ebx], eax
@37:
	pop edi
	pop esi
	pop ebx
	ret 
@@SaveAllReg$qqrv	endp
@SaveAllReg$qqrv	ends
_TEXT	ends
_TEXT	segment dword public use32 'CODE'
@Ring0Proc$qqrv	segment virtual
	align	2
@@Ring0Proc$qqrv	proc	near
?live16399@0:
	push ecx
@38:
	call @@SaveAllReg$qqrv
 	mov	 dword ptr [esp+0], offset ADJRing0
	mov eax,dword ptr [esp]
	mov dword ptr [_Ring],eax
	push 0
	push offset _retbyte
	push 32
	push offset _Ring
	push 32
	push offset _Ring
	push 2238052
	mov edx,dword ptr [_DriverHandle]
	push edx
	call @DeviceIoControl
	jmp @39

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -