保护操作系统(5)

This commit is contained in:
Yourtion
2016-05-09 13:06:58 +08:00
parent c53ce4a594
commit 3d141c39c8
6 changed files with 53 additions and 1 deletions

View File

@@ -76,8 +76,21 @@ crack1.hrb : crack1.bim Makefile
crack2.hrb : crack2.nas Makefile
$(NASK) crack2.nas crack2.hrb crack2.lst
crack3.hrb : crack3.nas Makefile
$(NASK) crack3.nas crack3.hrb crack3.lst
crack4.hrb : crack4.nas Makefile
$(NASK) crack4.nas crack4.hrb crack4.lst
crack5.hrb : crack5.nas Makefile
$(NASK) crack5.nas crack5.hrb crack5.lst
crack6.hrb : crack6.nas Makefile
$(NASK) crack6.nas crack6.hrb crack6.lst
haribote.img : ipl10.bin haribote.sys Makefile \
hello.hrb hello2.hrb a.hrb hello3.hrb crack1.hrb crack2.hrb
hello.hrb hello2.hrb a.hrb hello3.hrb crack1.hrb crack2.hrb crack3.hrb \
crack4.hrb crack5.hrb crack6.hrb
$(EDIMG) imgin:../z_tools/fdimg0at.tek \
wbinimg src:ipl10.bin len:512 from:0 to:0 \
copy from:haribote.sys to:@: \
@@ -89,6 +102,10 @@ haribote.img : ipl10.bin haribote.sys Makefile \
copy from:hello3.hrb to:@: \
copy from:crack1.hrb to:@: \
copy from:crack2.hrb to:@: \
copy from:crack3.hrb to:@: \
copy from:crack4.hrb to:@: \
copy from:crack5.hrb to:@: \
copy from:crack6.hrb to:@: \
imgout:haribote.img
# 其他指令

View File

@@ -320,6 +320,8 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
cons_putstr1(cons, (char *) ebx + cs_base, ecx);
} else if (edx == 4) {
return &(task->tss.esp0);
} else if (edx == 123456789) {
*((char *) 0x00102600) = 0;
}
return 0;
}

16
22_day/crack3.nas Normal file
View File

@@ -0,0 +1,16 @@
[INSTRSET "i486p"]
[BITS 32]
MOV AL,0x34
OUT 0x43,AL
MOV AL,0xff
OUT 0x40,AL
MOV AL,0xff
OUT 0x40,AL
; 上述代码的功能与下面代码相当
; io_out8(PIT_CTRL, 0x34);
; io_out8(PIT_CNT0, 0xff);
; io_out8(PIT_CNT0, 0xff);
MOV EDX,4
INT 0x40

6
22_day/crack4.nas Normal file
View File

@@ -0,0 +1,6 @@
[INSTRSET "i486p"]
[BITS 32]
CLI
fin:
HLT
JMP fin

5
22_day/crack5.nas Normal file
View File

@@ -0,0 +1,5 @@
[INSTRSET "i486p"]
[BITS 32]
CALL 2*8:0xac1
MOV EDX,4
INT 0x40

6
22_day/crack6.nas Normal file
View File

@@ -0,0 +1,6 @@
[INSTRSET "i486p"]
[BITS 32]
MOV EDX,123456789
INT 0x40
MOV EDX,4
INT 0x40