elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: 1 2 [3]
21  Programación / ASM / Re: Ventana en ASM en: 20 Diciembre 2009, 20:21 pm
Libs.inc es esto:

Código
  1. library kernel32,'KERNEL32.DLL',U_KERNEL32,\
  2. ntdll,'NTDLL.DLL',U_NTDLL,\
  3. user32,'USER32.DLL',U_USER32,\
  4. gdi32,'GDI32.DLL',U_GDI32,\
  5. dwm,'DWMAPI.DLL',U_DWM,\
  6. shell32,'SHELL32.DLL',U_SHELL32,\
  7. advapi32,'ADVAPI32.DLL',U_ADVAPI32,\
  8. ws2_32,'WS2_32.DLL',U_WS2_32,\
  9. comctl32,'COMCTL32.DLL',U_COMCTL32,\
  10. msvcrt,'MSVCRT.DLL',U_MSVCRT,\
  11. msimg32,'MSIMG32.DLL',U_MSIMG32,\
  12. ole32,'OLE32.DLL',U_OLE32,\
  13. oleaut32,'OLEAUT32.DLL',U_OLE32
  14.  
  15. include 'API/KERNEL32.INC'
  16. include 'API/NTDLL.INC'
  17. include 'API/USER32.INC'
  18. include 'API/GDI32.INC'
  19. include 'API/DWM.INC'
  20. include 'API/SHELL32.INC'
  21. include 'API/ADVAPI32.INC'
  22. include 'API/WS2_32.INC'
  23. include 'API/COMCTL32.INC'
  24. include 'API/MSIMG32.INC'
  25. include 'API/MSVCRT.INC'
  26. include 'API/OLE32.INC'

Ya voy entendiendo un poco sobre el ret.. tambien pude usar la funcion WinExec con algunas propiedades y eso.. ahora voy a ver como me va con ShellExecute porque no tube suerte con CreateProcess..

EAX_

Edito

Bueno, con ShellExecute me fue bien.. ahora, queria hacer una pregunta. Cómo podría yo obtener la letra de la unidad donde esta instalado windows? Me refiero a %HomeDrive% o %SystemRoot%.

EAX_
22  Programación / ASM / Re: Ventana en ASM en: 19 Diciembre 2009, 19:57 pm
Gracias por responder, cuando tenga tiempo voy a leer lo que me mandaste y ahora voy a tratar de agregar esa funcion que me dijiste para ver si sale algo..

EAX_

EI: juntando mensajes.

Ufff.. despues de varios intentos y acordandome de algunas cosas que me decia un amigo que me ayuda con esto.. pude abrir CMD.. ahora, no sé si sobra algo o si está mal porque todavia no entiendo bien a la pila.. creo que puse algo de más..

Código
  1. WindowProc:
  2.        mov     EAX,DWORD PTR SS: ESP+8
  3.        cmp     EAX,WM_LBUTTONDOWN
  4.        je      .lbdwn
  5.        cmp     EAX,WM_DESTROY
  6.        je      .wm_destroy
  7.        jmp     [DefWindowProc]
  8.        .lbdwn:
  9.        push    SW_SHOWNORMAL
  10.        push    _cmd
  11.        call    [WinExec]
  12.        retn    16                   ; Al quitarlo se cierra el programa y se abre cmd
  13.        .wm_destroy:
  14.        or      [bools],1
  15.        retn    16
  16.  
  17.        section '.data' writable readable
  18.  
  19. _cmd            TCHAR 'C:\Windows\system32\cmd.exe',0
  20.  

Ese retn 16 todavia no lo entiendo bien.. si pudieras explicarme que hace te lo agradeceria.. creo que tiene que ver algo con los push, pero no recuerdo bien..

EAX_

PD: Perdón por el multipost..
23  Programación / ASM / Ventana en ASM en: 19 Diciembre 2009, 19:32 pm
Hola.. bueno les cuento.. estoy tratando de entender el lenguaje ASM, con ayuda de un amigo y leyendo un poco he conseguido crear un programa que muestra un msgbox al inicio, se crea una ventana y al clickarla sale otro msgbox.. necesito un poco de ayuda para poder hacer un boton que haga alguna acción (por ejemplo ejecutar CMD) o algo así.

 Buehh este es el code..

Código
  1. hInstance equ 0x00400000
  2. format PE GUI 4.0 at hInstance as 'exe'
  3. entry codee
  4. include 'WIN32A.INC'
  5.  
  6. section '.bss' readable writeable
  7. msg             MSG
  8. bools           db ? ; [1]Exit
  9.  
  10. section '.text' code readable executable
  11.  
  12. codee:
  13.        push    MB_ICONEXCLAMATION
  14.        push    _msgb0
  15.        push    _msgb1
  16.        push    0
  17.        call    [MessageBox]
  18.        push    _classname
  19.        push    0
  20.        push    0
  21.        call    [CreateMutex]
  22.        call    [GetLastError]
  23.        TEST    EAX,EAX
  24.        jnz     .end
  25.        push    BLACK_BRUSH
  26.        call    [GetStockObject]
  27.        mov     [wc.hbrBackground],EAX
  28.        push    IDC_ARROW
  29.        push    0
  30.        call    [LoadCursor]
  31.        mov     [wc.hCursor],EAX
  32.        push    IDI_APPLICATION
  33.        push    0
  34.        call    [LoadIcon]
  35.        mov     [wc.hIcon],EAX
  36.        push    wc
  37.        call    [RegisterClass]
  38.        push    0
  39.        push    [wc.hInstance]
  40.        push    0
  41.        push    0
  42.        push    300
  43.        push    500
  44.        push    CW_USEDEFAULT
  45.        push    CW_USEDEFAULT
  46.        push    WS_VISIBLE+WS_CAPTION+WS_SYSMENU+WS_MAXIMIZEBOX
  47.        push    _title
  48.        push    _classname
  49.        push    0
  50.        call    [CreateWindowEx]
  51.        jmp     .jump0
  52.        .jump:
  53.        push    msg
  54.        call    [TranslateMessage]
  55.        push    msg
  56.        call    [DispatchMessage]
  57.        test    [bools],1
  58.        jnz     .end
  59.  
  60.        .jump0:
  61.        push    0
  62.        push    0
  63.        push    0
  64.        push    msg
  65.        call    [GetMessage]
  66.        cmp     EAX,1
  67.        je      .jump
  68. .end:
  69.        ret
  70.  
  71. WindowProc:
  72.        mov     EAX,DWORD PTR SS: ESP+8
  73.        cmp     EAX,WM_LBUTTONDOWN
  74.        je      .lbdwn
  75.        cmp     EAX,WM_DESTROY
  76.        je      .wm_destroy
  77.        jmp     [DefWindowProc]
  78.        .lbdwn:
  79.        push    0
  80.        push    _titlebox
  81.        push    _msgboxcnt
  82.        push    0
  83.        call    [MessageBox]
  84.        retn    16
  85.        .wm_destroy:
  86.        or      [bools],1
  87.        retn    16
  88.  
  89.  
  90. section '.data' writable readable
  91.  
  92. _msgb0          TCHAR 'ALERT',0
  93. _msgb1          TCHAR 'Test program, use under your own risk',0
  94. _text1          TCHAR 'Testing this program fucking',0
  95. _msgboxcnt      TCHAR 'Do not click my program fucking',0
  96. _titlebox       TCHAR 'WARNING',0
  97. _title          TCHAR 'Program fucking',0
  98. _classname      TCHAR 'MyFuckingProgram'
  99. wc              WNDCLASS 0,WindowProc,0,0,hInstance,0,0,0,0,_classname
  100.  
  101. data import
  102. U_KERNEL32     equ 1
  103. U_NTDLL       equ 0
  104. U_USER32       equ 1
  105. U_GDI32       equ 1
  106. U_DWM         equ 0
  107. U_SHELL32     equ 0
  108. U_ADVAPI32     equ 0
  109. U_WS2_32       equ 0
  110. U_COMCTL32     equ 0
  111. U_MSIMG32     equ 0
  112. U_MSVCRT       equ 0
  113. U_OLE32       equ 1
  114. include 'LIBS.INC'
  115. end data

Si me pudieran explicar o darme algun texto donde se explique el funcionamiento de la pila les agradeceria tambien..


EAX_

Edito:

Se me olvidaba.. para programar uso FASM y me ayudo con OllyDbg para tratar de entender bien..
Páginas: 1 2 [3]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines