Foro de elhacker.net

Programación => ASM => Mensaje iniciado por: jJPHyES en 29 Mayo 2018, 19:46 pm



Título: Ayuda con esta aplicación en ensamblador
Publicado por: jJPHyES en 29 Mayo 2018, 19:46 pm
Resulta que esta aplicación hecha en ensamblador hace algunas llamadas, muestra un mensaje de texto utilizando la API MessageBox y puede detectar si hay algún depurador ejecutándolo.

El problema es a la hora de compilarlo con masm que arroja demasiados errores, y talvez haya cometido algún error decidmelo.

Código
  1. .386
  2. .model flat, stdcall
  3. option casemap:none
  4.  
  5. include windows.inc
  6. include user32.inc
  7. include kernel32.inc
  8.  
  9. includelib user32.lib
  10. includelib kernel32.lib
  11.  
  12. .data
  13.  
  14. MsgBoxTitulo db "¡Importante! - Cristo te ama (:", 0
  15. MsgBoxMensaje db "Lista de archivos:", 13, 10, 13, 10, "- Dedicatoria.txt", 13, 10, "- Instrucciones.txt", 13, 10, "Contactarme.txt", 13, 10, "Archivos *.reg&.exe", 13, 10, 13, 10, "Autor: jJPHyES|CrackSLatinoS.", 13, 10, "Fecha: Martes 29 de Mayo, del 2018.", 13, 10, "Que Dios te bendiga, protega y acompañe.", 0
  16. MsgBoxIsDT db "¡Depurador detectado!", 0
  17. MsgBoxIsDM db "Deberías salir de vuestro depurador...", 0
  18.  
  19. .code
  20.  
  21. progasm01:
  22.          mov eax, [fs+0x18]
  23.          mov eax, [eax+0x30]
  24.          movzx eax, byte [eax+0x2]
  25.          cmp eax, TRUE
  26.          je isdebugpreasmd
  27.  
  28.          push 0
  29.          call FreeConsole, 0
  30.          push 0
  31.          push offset MsgBoxTitulo
  32.          push offset MsgBoxMensaje
  33.          call MessageBox
  34.          xor eax, eax
  35.          xor ebx, ebx
  36.          xor ecx, ecx
  37.          push 0
  38.          call ExitProcess, 0
  39.  
  40.          isdebugpreasmd:
  41.          push 0
  42.          push offset MsgBoxIsDT
  43.          push offset MsgBoxIsDM
  44.          call MessageBox
  45.  
  46.          end isdebugpreasmd
  47.  
  48. end progasm01

Editado: Que Dios te bendiga, protega y acompañe.


Título: Re: Ayuda con esta aplicación en ensamblador
Publicado por: MCKSys Argentina en 29 Mayo 2018, 21:53 pm
Hola!

Revisa las correcciones:

Código
  1. .code
  2.  
  3. progasm01:
  4. ASSUME fs:NOTHING
  5. mov eax, [fs:018h]
  6. mov eax, [eax+030h]
  7. movzx eax, byte ptr [eax+02h]
  8. cmp eax, TRUE
  9. je isdebugpreasmd
  10.  
  11. push 0
  12. call FreeConsole
  13. push 0
  14. push offset MsgBoxTitulo
  15. push offset MsgBoxMensaje
  16. call MessageBox
  17. xor eax, eax
  18. xor ebx, ebx
  19. xor ecx, ecx
  20. push 0
  21. call ExitProcess
  22.  
  23. isdebugpreasmd:
  24. push 0
  25. push offset MsgBoxIsDT
  26. push offset MsgBoxIsDM
  27. call MessageBox
  28.  
  29. end isdebugpreasmd
  30.  
  31. end progasm01

Saludos!


Título: Re: Ayuda con esta aplicación en ensamblador
Publicado por: jJPHyES en 30 Mayo 2018, 06:22 am
Hola!

Revisa las correcciones:

Código
  1. .code
  2.  
  3. progasm01:
  4. ASSUME fs:NOTHING
  5. mov eax, [fs:018h]
  6. mov eax, [eax+030h]
  7. movzx eax, byte ptr [eax+02h]
  8. cmp eax, TRUE
  9. je isdebugpreasmd
  10.  
  11. push 0
  12. call FreeConsole
  13. push 0
  14. push offset MsgBoxTitulo
  15. push offset MsgBoxMensaje
  16. call MessageBox
  17. xor eax, eax
  18. xor ebx, ebx
  19. xor ecx, ecx
  20. push 0
  21. call ExitProcess
  22.  
  23. isdebugpreasmd:
  24. push 0
  25. push offset MsgBoxIsDT
  26. push offset MsgBoxIsDM
  27. call MessageBox
  28.  
  29. end isdebugpreasmd
  30.  
  31. end progasm01

Saludos!

Gracias @MCKSysArgentina.

Que Dios te bendiga.