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

 

 


Tema destacado: Estamos en la red social de Mastodon


  Mostrar Mensajes
Páginas: 1 ... 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 [357] 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 ... 381
3561  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 21:36 pm
Al final, por supuesto, si queres usa App Verifier para comprobarlo.

"Este es el Cuerpo" = 17 caracteres
17+3=20, 19 caracteres + 0 terminador.

strcpy "Este es el" 10 caracteres
strcat " 56 Cuerpo" 10 caracteres

No solo agregas 56 sino un espacio justo despues del numero.
3562  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 21:14 pm
Global and Local Functions

The global and local functions are supported for porting from 16-bit code, or for maintaining source code compatibility with 16-bit Windows. Starting with 32-bit Windows, the global and local functions are implemented as wrapper functions that call the corresponding heap functions using a handle to the process's default heap. Therefore, the global and local functions have greater overhead than other memory management functions.

The heap functions provide more features and control than the global and local functions. New applications should use the heap functions unless documentation specifically states that a global or local function should be used. For example, some Windows functions allocate memory that must be freed with LocalFree, and the global functions are still used with Dynamic Data Exchange (DDE), the clipboard functions, and OLE data objects. For a complete list of global and local functions, see the table in Memory Management Functions.

Windows memory management does not provide a separate local heap and global heap, as 16-bit Windows does. As a result, the global and local families of functions are equivalent and choosing between them is a matter of personal preference. Note that the change from a 16-bit segmented memory model to a 32-bit virtual memory model has made some of the related global and local functions and their options unnecessary or meaningless. For example, there are no longer near and far pointers, because both local and global allocations return 32-bit virtual addresses.

Memory objects allocated by GlobalAlloc and LocalAlloc are in private, committed pages with read/write access that cannot be accessed by other processes. Memory allocated by using GlobalAlloc with GMEM_DDESHARE is not actually shared globally as it is in 16-bit Windows. This value has no effect and is available only for compatibility. Applications requiring shared memory for other purposes must use file-mapping objects. Multiple processes can map a view of the same file-mapping object to provide named shared memory. For more information, see File Mapping.

PD. YST: te falto un reservar un byte para el cero terminador de cadena.
3563  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 20:18 pm
Para eso esta la memoria dinamica, se puede usar HeapAlloc/HeapFree por ejemplo.
3564  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 17:42 pm
Si, me referia a eso exactamente, era redundante.
3565  Programación / ASM / Re: Llamadas al sistema en: 30 Junio 2009, 15:29 pm
Efectivamente la mayoria de las funciones que nombras son de la API de Windows, no asi open, seek y read que son de C/C++, y las podras encontrar todas documentadas en la MSDN. Para las de C/C++ podes usar las que esten implementadas en Kernel32 (como lseek, lopen, lread) o las de la Run Time de VC++ (MSVCRT) aunque en ese caso me parece que vas a tener que crear tu propio include y libreria de importacion.
3566  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 14:58 pm
¿Para que la introducir Datos al codigo? En fin, todo sea por la redundancia.
3567  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 12:05 pm
Para que un digito se convierta en caracter tenes que sumarle el codigo ASCII de 0 (48), este es un ejemplo basado en el otro:

Código
  1. mov [cuerpo], 'H'
  2. mov [cuerpo+1], 'o'
  3. mov [cuerpo+2], 'l'
  4. mov [cuerpo+3], 'a'
  5. mov eax, 5
  6. add eax, '0'
  7. mov [cuerpo+4], al
  8. mov [cuerpo+5], 0

Para reservar memoria en tiempo de ensamblaje (?) podes hacer esto:

Código
  1. .data
  2. una_cadena db 128 dup(0)

El resultado es 128 bytes en la sección de datos cuyo valor es 0.
3568  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 09:54 am
De nadas  ::)
3569  Programación / ASM / Re: Empezando con ASM en: 30 Junio 2009, 09:41 am
En este caso no podrias excepto que no te importara sobreescribir la memoria que le sigue (en este caso titulo) debido a que no reservaste suficiente espacio para la nueva cadena. Lo que podes hacer sin problema es esto:

Código
  1. mov [cuerpo], 'H'
  2. mov [cuerpo+1], 'o'
  3. mov [cuerpo+2], 'l'
  4. mov [cuerpo+3], 'a'
  5. mov [cuerpo+4], 0

Por cierto pone un ret o un ExitProcess despues del MessageBox (y cerra con comillas - " - el include).
3570  Programación / ASM / MOVIDO: hola soy nueva en esto en: 21 Junio 2009, 09:37 am
El tema ha sido movido a Seguridad.

http://foro.elhacker.net/index.php?topic=258742.0
Páginas: 1 ... 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 [357] 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 ... 381
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines