Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > MSDOS Programmer > Re: please comm...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 12 Topic 436 of 494
Post > Topic >>

Re: please comment each line

by "santosh" <santosh.k83@[EMAIL PROTECTED] > Feb 14, 2007 at 11:12 AM

Herbert Kleebauer wrote:
> jella_flores@[EMAIL PROTECTED]
 wrote:
>
> > 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...
>
> You better ask in alt.lang.asm or comp.lang.asm.x86 where such
> programs have been discussed a few days ago. But you can tell
> your teacher, he will not get a good grade for this program
> (at least if it was written in assembler and not in a HLL).
> Here a maybe better understandable disassembly:
>
>
>
>         key1=$cefa
>         key2='.'
>
>         @[EMAIL PROTECTED]
>         br.w    begin
>
>         ; encrypted message
> dat:    dc.b    'Y' ^ key1 &$ff
>         dc.b    'o' ^ key1 >>8
>         dc.b    'u' ^ key1 &$ff
>         dc.b    "'" ^ key1 >>8
>         dc.b    'v' ^ key1 &$ff
>         dc.b    'e' ^ key1 >>8
>         dc.b    ' ' ^ key1 &$ff
>         dc.b    'g' ^ key1 >>8
>         dc.b    'o' ^ key1 &$ff
>         dc.b    't' ^ key1 >>8
>         dc.b    ' ' ^ key1 &$ff
>         dc.b    'i' ^ key1 >>8
>         dc.b    't' ^ key1 &$ff
>         dc.b    ' ' ^ key1 >>8
>         dc.b    'r' ^ key1 &$ff
>         dc.b    'i' ^ key1 >>8
>         dc.b    'g' ^ key1 &$ff
>         dc.b    'h' ^ key1 >>8
>         dc.b    't' ^ key1 &$ff
>         dc.b    '!' ^ key1 >>8
>         dc.b    '!' ^ key1 &$ff
>         dc.b    '!' ^ key1 >>8
>         dc.b    ' ' ^ key1 &$ff
>         dc.b    'I' ^ key1 >>8
>         dc.b    ' ' ^ key1 &$ff
>         dc.b    'h' ^ key1 >>8
>         dc.b    'o' ^ key1 &$ff
>         dc.b    'p' ^ key1 >>8
>         dc.b    'e' ^ key1 &$ff
>         dc.b    ' ' ^ key1 >>8
>         dc.b    'y' ^ key1 &$ff
>         dc.b    'o' ^ key1 >>8
>         dc.b    'u' ^ key1 &$ff
>         dc.b    "'" ^ key1 >>8
>         dc.b    'l' ^ key1 &$ff
>         dc.b    'l' ^ key1 >>8
>         dc.b    ' ' ^ key1 &$ff
>         dc.b    'p' ^ key1 >>8
>         dc.b    'a' ^ key1 &$ff
>         dc.b    's' ^ key1 >>8
>         dc.b    's' ^ key1 &$ff
>         dc.b    ' ' ^ key1 >>8
>         dc.b    't' ^ key1 &$ff
>         dc.b    'h' ^ key1 >>8
>         dc.b    'e' ^ key1 &$ff
>         dc.b    ' ' ^ key1 >>8
>         dc.b    't' ^ key1 &$ff
>         dc.b    'e' ^ key1 >>8
>         dc.b    'c' ^ key1 &$ff
>         dc.b    'h' ^ key1 >>8
>         dc.b    'n' ^ key1 &$ff
>         dc.b    'i' ^ key1 >>8
>         dc.b    'c' ^ key1 &$ff
>         dc.b    'a' ^ key1 >>8
>         dc.b    'l' ^ key1 &$ff
>         dc.b    ' ' ^ key1 >>8
>         dc.b    'e' ^ key1 &$ff
>         dc.b    'x' ^ key1 >>8
>         dc.b    'a' ^ key1 &$ff
>         dc.b    'm' ^ key1 >>8
>         dc.b    '.' ^ key1 &$ff
>         dc.b    '.' ^ key1 >>8
> dat62:  dc.b    key2^ key1 &$ff
>         dc.b    '$' ^ key1 >>8
> dat_end:
>
> inbuf:   blk.b  15,$24                           ; 15 byte input buffer
> msg1:    dc.b    "Enter the password: $"
> msg2:    dc.b    "Don't push it...exciting...$"
>
> begin:  move.w  #msg1,r1
>         move.b  #9,m0           ; print message1
>         trap    #$21
>
>         eor.w   r5,r5
> input:  move.b  #1,m0
>         trap    #$21
>         cmp.b   #13,r0          ; <RETURN>?
>         beq.b   process         ; yes, then exit input routine
>         move.b  r0,inbuf(r5.w)  ; store in input buffer
>         inc.w   r5
>         cmpq.w  #10,r5          ; 10 bytes read?
>         beq.b   wrong           ; yes, that's too much
>         br.b    input           ; read next character
>
> process:bclr.w  #10,sr          ; clear direction flag
>         move.w  #dat,r5         ; pointer to dat
>         move.w  r5,r6           ; pointer to dat
>         move.w  #dat_end,r2
>         sub.w   r5,r2           ; size of encrypted data in byte
>         lsr.w   #1,r2           ; size of encrypted data in word
>
>    _10: move.w  (r5.w)+-,r0     ; read next word from data
>         eor.w   #key1,r0        ; decrypt it
>         move.w  r0,(r6.w)+-{s1} ; store it back
>         dbf.w   r2,_10          ; loop until complete data processed
>
>         move.b  #0,r0
>         move.w  #dat_end,r3
>         subq.w  #2,r3           ; pointer to dat62
>         move.b  (r3.w,r0.b),r0  ; dat62 = key2
>         move.b  r0,r1           ; dat62
>
>         move.w  #pass_end,r5
>         subq.w  #pass_length,r5  ; pointer to pass
>         move.w  r5,-(sp)
>         move.w  r5,r6
>         move.w  #10,r2          ; prozess pass0 - pass9
>
>    _20: move.b  (r5.w)+-,r0     ; get next byte of pass
>         eor.b   r1,r0           ; eor it with dat62
>         move.b  r0,(r6.w)+-{s1} ; store it back
>         dbf.w   r2,_20          ; loop until dat62 processed
>
>         move.w  #10,r2          ; compare 10 bytes
>         move.w  (sp)+,r5        ; pointer to pass
>         move.w  #inbuf,r6       ; pointer to input input string
>
>         repeq_r2 cmp.b (r6.w)+-{s1},(r5.w)+-  ; compare
>         bne.b   wrong           ; strings not equal
>         move.w  #dat,r1         ; decrypted text
>         move.b  #$09,m0         ; print it
>         trap    #$21
>         br.b    byebye          ; exit
>         nop
>
> wrong:  move.w  #msg2,r1
>         move.b  #$09,m0         ; print message2
>         trap    #$21
>         br.b    byebye          ; exit
>         nop
>
> pass:   dc.b    'J' ^ key2
>         dc.b    'o' ^ key2
>         dc.b    'h' ^ key2
>         dc.b    'n' ^ key2
>         dc.b    ' ' ^ key2
>         dc.b    '3' ^ key2
>         dc.b    ':' ^ key2
>         dc.b    '1' ^ key2
>         dc.b    '6' ^ key2
>         dc.b    '$' ^ key2
>         dc.b    0
> pass_end:
> pass_length=pass_end-pass
>
> byebye: move.w  #$4c00,r0
>         trap    #$21

Good luck to jella deciphering this one!




 12 Posts in Topic:
please comment each line
jella_flores@[EMAIL PROTE  2007-02-14 05:30:29 
Re: please comment each line
Herbert Kleebauer <kle  2007-02-14 18:06:18 
Re: please comment each line
"santosh" <s  2007-02-14 11:12:55 
Re: please comment each line
Herbert Kleebauer <kle  2007-02-15 11:07:48 
Re: please comment each line
Betov <betov@[EMAIL PR  2007-02-15 10:55:26 
Re: please comment each line
Herbert Kleebauer <kle  2007-02-15 13:51:21 
Re: please comment each line
Betov <betov@[EMAIL PR  2007-02-15 13:45:50 
Re: please comment each line
//\\\\o//\\\\annabee <  2007-02-15 16:43:39 
Re: please comment each line
Frank Kotler <fbkotler  2007-02-15 13:41:48 
Re: please comment each line
Herbert Kleebauer <kle  2007-02-15 15:51:09 
Re: please comment each line
Frank Kotler <fbkotler  2007-02-15 16:31:32 
Re: please comment each line
"Evenbit" <n  2007-02-15 02:41:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 22:54:42 CDT 2008.