优化安装量检测

This commit is contained in:
gfdgd xi 2023-11-11 10:04:00 +08:00
parent 0c2f37c187
commit 1a786145fb
4 changed files with 107 additions and 25 deletions

View File

@ -1,5 +1,11 @@
#!/usr/bin/env python3
import os
import sys
import json
import base64
import requests
print(requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9JbnN0YWxsLnBocD9WZXJzaW9uPQ==").decode("utf-8") + sys.argv[1]).text)
# 读取版本号
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
with open(f"{programPath}/information.json") as file:
version = json.loads(file.read())["Version"]
print(requests.get(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9JbnN0YWxsLnBocD9WZXJzaW9uPQ==").decode("utf-8") + version).text)

View File

@ -2,27 +2,27 @@ mov ax,0xb800
mov es,ax
; 清屏
mov cx,80*25
clean:
mov di,cx
add di,di
mov byte [es:di],''
add di,1
mov byte [es:di],0x0F
loop clean
;clean:
; mov di,cx
; add di,di
; mov byte [es:di],''
; add di,1
; mov byte [es:di],0x0F
; loop clean
; 显示上方白条
; 移除(0,0)的S字符
mov byte [es:0x00],''
mov cx,80*2-1
mov di,0
headtitle:
mov di,cx
mov byte [es:di],0xF0
; 写入空字符
add di,di
mov byte [es:di],''
;inc cx
;sub cx,1
loop headtitle
;mov byte [es:0x00],''
;mov cx,80*2-1
;mov di,0
;headtitle:
; mov di,cx
; mov byte [es:di],0xF0
; ; 写入空字符
; add di,di
; mov byte [es:di],''
; ;inc cx
; ;sub cx,1
; loop headtitle
mov di,0
mov cx,80*2-1
@ -141,6 +141,19 @@ showCenterText:
showCenterTextEnd:
mov ax,[cs:0x100]
mov dx,[cs:0x102]
mov bx,16
div bx
mov ds,ax
mov es,ax
xor di,di
mov si,1
;xor ds,ds
;mov bx,512
xor bx,bx
call read_hard_disk_0
get_data:
mov di,80*2*25-2
@ -222,14 +235,77 @@ bcd_to_ascii:
poweroff:
;poweroff:
; 跳过关机
jmp near end
; 关机
mov ax,5307H ; 高级电源管理功能,设置电源状态
mov bx,0001H ; 设备ID1所有设备
mov cx,0003H ; 状态3表示关机
int 15h
; mov ax,5307H ; 高级电源管理功能,设置电源状态
; mov bx,0001H ; 设备ID1所有设备
; mov cx,0003H ; 状态3表示关机
; int 15h
read_hard_disk_0: ; 从硬盘读取一个逻辑扇区
; 输入DI:SI=起始逻辑扇区号
; DS:BX=目标缓冲区地址
push ax
push bx
push cx
push dx
mov dx,0x1f2
mov al,1
out dx,al ; 读取的扇区数
inc dx ; 0x1f3
mov ax,si
out dx,al ; LBA地址7~0
inc dx ; 0x1f4
mov al,ah
out dx,al ; LBA地址15~8
inc dx ; 0x1f5
mov ax,di
out dx,al ; LBA地址23~16
inc dx ; 0x1f6
mov al,0xe0 ; LBA28模式主盘
or al,ah ; LBA地址27~24
out dx,al
inc dx ; 0x1f7
mov al,0x20 ; 读命令
out dx,al
.waits:
in al,dx ; 此时 dx 为 0x1f7此时为命令端口也是状态窗口
and al,0x88
cmp al,0x08
jnz .waits
; 内部操作期间,会将 0x1f7 端口第 7 位设置为“1”准备就绪后会将此位清零并将第 3 位设为 1
mov cx,256 ; 总计要读取的/字/数
mov dx,0x1f0
.readw:
in ax,dx
mov [bx],ax
add bx,2
loop .readw
pop dx
pop cx
pop bx
pop ax
end:
times 510-($-$$) db 0
db 0x55,0xaa
; 数据区
showText_data:
db 'A', 0x0A
db 'B', 0x0A
db 0x03
db 0x55, 0xab

Binary file not shown.

Binary file not shown.