Skip to content

Instantly share code, notes, and snippets.

@comtom
Created November 3, 2015 17:41
Show Gist options
  • Save comtom/26730aa76c64ae0096b2 to your computer and use it in GitHub Desktop.
Save comtom/26730aa76c64ae0096b2 to your computer and use it in GitHub Desktop.
format PE
entry main
section '.text' code readable executable
main:
push str_intro
push format_output
call [printf]
add esp,8
push str_input
push format_input
call [scanf]
add esp,8
mov esi,str_input
_bucle:
cmp byte[esi],0
je _fin
movzx eax,byte[esi]
;la muerte
lea ecx, [8 * eax +contadores]
add byte[ecx], 1d
;¿byte[contadores+al*8]?
add esi,1
jmp _bucle
_fin:
;; TODO
;; ver cual es el mas grande en el arreglo
;; mostrar el char
push num
push format_output
call [printf]
add esp,8
push num
push format_input
call [scanf]
add esp, 8
push 0
call [exit]
ret
section '.data' data readable writeable
contadores rb 256
str_input dd ?
num dd ?
format_input db "%s",0
format_output db "%s",10,0
str_intro db "Ingrese la string:",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