assembly cipher text
- Include Irvine32.inc
- KEY = 215
- BUFMAX = 128
- .data
- sPrompt byte "Enter origin text : ",0
- sEncrypt byte "Cipher text : ",0
- sDecrypt byte "Decrypted : ",0
- buffer byte BUFMAX + 1 DUP(0)
- bufSize dword ?
- .code
- main proc
- mov edx, offset sPrompt
- call writestring
- call InputString
- mov edx, offset sEncrypt
- call writestring
- call TranBuffer
- call DisplayMsg
- mov edx, offset sDecrypt
- call writestring
- call TranBuffer
- call DisplayMsg
- exit
- main endp
- ;---------------------
- InputString proc
- pushad
- mov ecx, BUFMAX
- mov edx, offset buffer ; point to buffer
- call readstring
- mov bufSize, eax
- popad
- ret
- InputString endp
- ;---------------------
- DisplayMsg proc
- pushad
- mov edx, offset buffer
- call writestring
- call crlf
- popad
- ret
- DIsplayMsg endp
- ;---------------------
- TranBuffer proc
- pushad
- mov ecx, bufSize
- mov esi, 0
- L1:
- xor buffer[esi], KEY
- inc esi
- loop L1
- popad
- ret
- TranBuffer endp
- end main
😺😺😺😺😸
留言
張貼留言