From 3d141c39c82284a3c4d039595b56943b40ab3bb9 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Mon, 9 May 2016 13:06:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E6=8A=A4=E6=93=8D=E4=BD=9C=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=EF=BC=885=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 22_day/Makefile | 19 ++++++++++++++++++- 22_day/console.c | 2 ++ 22_day/crack3.nas | 16 ++++++++++++++++ 22_day/crack4.nas | 6 ++++++ 22_day/crack5.nas | 5 +++++ 22_day/crack6.nas | 6 ++++++ 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 22_day/crack3.nas create mode 100644 22_day/crack4.nas create mode 100644 22_day/crack5.nas create mode 100644 22_day/crack6.nas diff --git a/22_day/Makefile b/22_day/Makefile index 13e8023..479f271 100644 --- a/22_day/Makefile +++ b/22_day/Makefile @@ -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 # 其他指令 diff --git a/22_day/console.c b/22_day/console.c index c2f8619..18a49de 100644 --- a/22_day/console.c +++ b/22_day/console.c @@ -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; } diff --git a/22_day/crack3.nas b/22_day/crack3.nas new file mode 100644 index 0000000..990f86d --- /dev/null +++ b/22_day/crack3.nas @@ -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 diff --git a/22_day/crack4.nas b/22_day/crack4.nas new file mode 100644 index 0000000..823cef7 --- /dev/null +++ b/22_day/crack4.nas @@ -0,0 +1,6 @@ +[INSTRSET "i486p"] +[BITS 32] + CLI +fin: + HLT + JMP fin diff --git a/22_day/crack5.nas b/22_day/crack5.nas new file mode 100644 index 0000000..584964c --- /dev/null +++ b/22_day/crack5.nas @@ -0,0 +1,5 @@ +[INSTRSET "i486p"] +[BITS 32] + CALL 2*8:0xac1 + MOV EDX,4 + INT 0x40 diff --git a/22_day/crack6.nas b/22_day/crack6.nas new file mode 100644 index 0000000..2923b28 --- /dev/null +++ b/22_day/crack6.nas @@ -0,0 +1,6 @@ +[INSTRSET "i486p"] +[BITS 32] + MOV EDX,123456789 + INT 0x40 + MOV EDX,4 + INT 0x40