Last active
November 2, 2015 21:56
-
-
Save comtom/d7729d772c3c442cdec5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
format PE | |
entry main | |
section '.text' code readable executable | |
main: | |
push label_input | |
push _format_output | |
call [printf] | |
add esp, 8 | |
push buffer | |
push _format_input | |
call [scanf] | |
add esp, 8 | |
xor ebx, ebx | |
mov ebx, buffer | |
procesa: | |
movzx eax, byte[ebx] | |
cmp eax, 0 | |
je termina | |
cmp al, $41 | |
jl guardachar | |
cmp al, $5b | |
jl mayus | |
cmp al, $61 | |
jl guardachar | |
cmp al, $7b | |
jl minus | |
mayus: | |
cmp al, $4d ; caracteres >=M, no es necesaria mas magia | |
jg resta | |
sub al, $d | |
sub al, $40 | |
add al, $5a | |
jmp guardachar | |
minus: | |
cmp al, $6d ; caracteres >=m, no es necesaria mas magia | |
jg resta | |
sub al, $d | |
sub al, $60 | |
add al, $7a | |
jmp guardachar | |
resta: | |
; resta 13 | |
sub al, $D | |
jmp guardachar | |
guardachar: | |
; guardo en memoria | |
mov [ebx], al | |
add ebx, 1 | |
jmp procesa | |
termina: | |
push buffer | |
push _format_output | |
call [printf] | |
add esp, 8 | |
push buffer | |
push _format_input | |
call [scanf] | |
add esp, 8 | |
ret | |
section '.data' data readable writeable | |
string rb 128 | |
_format_input db "%s",0 | |
_format_output db "%s",10,0 | |
buffer dq ? | |
label_input db "Ingrese frase a encriptar:",10,0 | |
section '.idata' data import readable | |
include "macro\import32.inc" | |
library msvcrt, "MSVCRT.DLL" | |
import msvcrt,\ | |
printf ,'printf',\ | |
scanf ,'scanf',\ | |
exit ,'exit' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment