j***@yahoo.com
2007-02-14 13:30:29 UTC
hi to everyone,
i'm posting here in hope to find help for my troubles in tracing the
code line by line...i cannot go on finding the exact string that this
program requires...i want to track line by line but my problem is,i
dont know how to follow the codes...i only understand few instructions
and though i am familiar with all the instructions,i dont know how to
understand it if it in a code being applied...please help me by
commenting the codes...or if you can do better,please?i beg you
guys...more power to you all!
i just want some sample how to trace...
;-------------------------------------------------------------------------------------
.model tiny
.code
org 100h
START:
jmp begin
data1 DB 0A3H, 0A1H, 8FH, 0E9H, 8CH, 0ABH, 0DAH, 0A9H
DB 95H, 0BAH, 0DAH, 0A7H, 8EH, 0EEH, 88H, 0A7H
data2 DB 9DH, 0A6H, 8EH, 0EFH, 0DBH, 0EFH, 0DAH, 87H
DB 0DAH, 0A6H, 95H, 0BEH, 9FH, 0EEH, 83H, 0A1H
data3 DB 8FH, 0E9H, 96H, 0A2H, 0DAH, 0BEH, 9BH, 0BDH
DB 89H, 0EEH, 8EH, 0A6H, 9FH, 0EEH, 8EH, 0ABH
data4 DB 99H, 0A6H, 94H, 0A7H, 99H, 0AFH, 96H, 0EEH
DB 9FH, 0B6H, 9BH, 0A3H, 0D4H, 0E0H, 0D4H, 0EAH
data5 DB 15 DUP(24H)
data6 DB "Enter the password: $"
data7 DB "Don't push it...exciting...$"
BEGIN:
LEA DX, data6
MOV AH, 9
INT 21H
XOR SI, SI
INPUT:
MOV AH, 1
INT 21H
CMP AL, 0DH ;what is the need for checking the carriage return?
JZ PROCESS
MOV BYTE PTR [data5 + SI], AL
INC SI
CMP SI, 0AH ;what is line feed needed for?
JZ WHAT_THE
JMP INPUT
PROCESS:
CLD ;string is done forward (why?)
LEA SI, data1
MOV DI, SI
LEA CX, data5
SUB CX, SI
SHR CX, 1
CONVERT: ;what is this routine is for?
LODSW
XOR AX, 0CEFAH
STOSW
LOOP CONVERT
MOV AL, 0
LEA BX, data5
SUB BX, 2
XLAT
MOV DL, AL
LEA SI, BYEBYE
SUB SI, 0BH
PUSH SI
MOV DI, SI
MOV CX, 000AH
DECODE: what is this routine decoding?how?
LODSB
XOR AL, DL
STOSB
LOOP DECODE
MOV CX, 000AH
POP SI
LEA DI, data5
REPE CMPSB
JNE WHAT_THE
LEA DX, data1
MOV AH, 9
INT 21H
JMP BYEBYE
WHAT_THE:
LEA DX, data7
MOV AH,9
INT 21H
JMP BYEBYE
DB 64H, 41H, 46H, 40H, 0EH, 1DH, 14H, 1FH, 18H,0AH, 00H
BYEBYE: ;exit to DOS
MOV AX, 4C00H
INT 21H
END START
;-----------------------------------------------------------------------------
i'm posting here in hope to find help for my troubles in tracing the
code line by line...i cannot go on finding the exact string that this
program requires...i want to track line by line but my problem is,i
dont know how to follow the codes...i only understand few instructions
and though i am familiar with all the instructions,i dont know how to
understand it if it in a code being applied...please help me by
commenting the codes...or if you can do better,please?i beg you
guys...more power to you all!
i just want some sample how to trace...
;-------------------------------------------------------------------------------------
.model tiny
.code
org 100h
START:
jmp begin
data1 DB 0A3H, 0A1H, 8FH, 0E9H, 8CH, 0ABH, 0DAH, 0A9H
DB 95H, 0BAH, 0DAH, 0A7H, 8EH, 0EEH, 88H, 0A7H
data2 DB 9DH, 0A6H, 8EH, 0EFH, 0DBH, 0EFH, 0DAH, 87H
DB 0DAH, 0A6H, 95H, 0BEH, 9FH, 0EEH, 83H, 0A1H
data3 DB 8FH, 0E9H, 96H, 0A2H, 0DAH, 0BEH, 9BH, 0BDH
DB 89H, 0EEH, 8EH, 0A6H, 9FH, 0EEH, 8EH, 0ABH
data4 DB 99H, 0A6H, 94H, 0A7H, 99H, 0AFH, 96H, 0EEH
DB 9FH, 0B6H, 9BH, 0A3H, 0D4H, 0E0H, 0D4H, 0EAH
data5 DB 15 DUP(24H)
data6 DB "Enter the password: $"
data7 DB "Don't push it...exciting...$"
BEGIN:
LEA DX, data6
MOV AH, 9
INT 21H
XOR SI, SI
INPUT:
MOV AH, 1
INT 21H
CMP AL, 0DH ;what is the need for checking the carriage return?
JZ PROCESS
MOV BYTE PTR [data5 + SI], AL
INC SI
CMP SI, 0AH ;what is line feed needed for?
JZ WHAT_THE
JMP INPUT
PROCESS:
CLD ;string is done forward (why?)
LEA SI, data1
MOV DI, SI
LEA CX, data5
SUB CX, SI
SHR CX, 1
CONVERT: ;what is this routine is for?
LODSW
XOR AX, 0CEFAH
STOSW
LOOP CONVERT
MOV AL, 0
LEA BX, data5
SUB BX, 2
XLAT
MOV DL, AL
LEA SI, BYEBYE
SUB SI, 0BH
PUSH SI
MOV DI, SI
MOV CX, 000AH
DECODE: what is this routine decoding?how?
LODSB
XOR AL, DL
STOSB
LOOP DECODE
MOV CX, 000AH
POP SI
LEA DI, data5
REPE CMPSB
JNE WHAT_THE
LEA DX, data1
MOV AH, 9
INT 21H
JMP BYEBYE
WHAT_THE:
LEA DX, data7
MOV AH,9
INT 21H
JMP BYEBYE
DB 64H, 41H, 46H, 40H, 0EH, 1DH, 14H, 1FH, 18H,0AH, 00H
BYEBYE: ;exit to DOS
MOV AX, 4C00H
INT 21H
END START
;-----------------------------------------------------------------------------