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

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


  Mostrar Mensajes
Páginas: 1 ... 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 [43] 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 ... 68
421  Programación / ASM / Re: Pequeño codigo para comparar strings... en: 15 Junio 2009, 01:37 am
bueno, hay tienen el code, al que no le guste algo de el code :-(, que lo cambie. Lo de usar unos registros en puesto de otros es cuestión de gustos, yo si tengo registros sin usar no usare la pila, y siempre suelo dejar para los últimos edi y esi. lo de ah y al da lo mismo porque un caracter nunca superara el tamaño de 1 byte al menos con ascii.


Saludos

No te pongas sensible :xD . No es por usar los registro seguramente que lo dijo seguro se refiere a usar cmpsb.
422  Programación / ASM / Re: Pequeño codigo para comparar strings... en: 15 Junio 2009, 00:46 am
si usara esi y edi tendría que añadir 2 push y 2 pop para conservar los registros. De todas maneras, si quieres puedes quitar un test si le pones ax.

Saludos

PD:Con or 0x20 lo pasarías a minúsculas
Con Pushad no :P talves unos pop mas pero ahorrarias unops push tambien :P
423  Programación / ASM / Re: [ASM]Syscall no me funciona + fallo de segmentacion en: 14 Junio 2009, 18:21 pm
Toma documentación sobre las syscalls

http://sourceforge.net/project/downloading.php?group_id=173983&filename=lscr-160307.tar.gz&a=60287788
424  Programación / ASM / Re: [ASM]Syscall no me funciona + fallo de segmentacion en: 14 Junio 2009, 09:14 am
Luego lo veo bien ( Cuando me pase a linux que estoy en win ) , pero veo un error que es
Código
  1. segment readable executable

Hay no le das la propiedad de writeable para poder escribir en las variables.
425  Programación / Programación Visual Basic / Crear .lib en Visual basic 6 en: 14 Junio 2009, 09:02 am
Hola,

Mi pregunta es la  siguiente , alguien sabe si se pueden crear .lib en Visual basic ?

Saludos
426  Programación / ASM / Re: Recopilación de mis codigos. en: 13 Junio 2009, 04:26 am
Código
  1. include 'win32ax.inc'
  2. .data
  3. buffer rb 41
  4. var0 db "12345",0
  5. .code
  6. start:
  7. invoke lstrlen,var0
  8.  
  9. stdcall  SHA1Hash ,var0 ,eax,buffer
  10.  
  11.  
  12.    invoke MessageBox,0,buffer,buffer,0
  13.  leave
  14. ret
  15.  ;Descripción: Saca el hash sha1 de un dato
  16. ; by YST
  17. proc SHA1Hash ,pbData,dwDataLen,cBuffer
  18. locals
  19. hProv dd ?
  20. PROV_RSA_FULL = 1
  21.  CALG_SHA = 0x00008004
  22.  hHash dd ?
  23.  cBuf rb 40
  24.  dwSigLen dd ?
  25. endl
  26. pushad
  27. invoke CryptAcquireContext,addr hProv,0,0,PROV_RSA_FULL,0
  28. .if [hProv] = 0
  29. invoke CryptAcquireContext,addr hProv,0,0,PROV_RSA_FULL,8h
  30. .endif
  31.  
  32. invoke CryptCreateHash,[hProv],CALG_SHA, 0, 0, addr hHash
  33. invoke CryptHashData,[hHash], [pbData],[dwDataLen]   , 0
  34.  
  35.   invoke CryptGetHashParam,[hHash], 2, 0,addr dwSigLen, 0
  36.    .if [dwSigLen] <> 0
  37. invoke CryptGetHashParam,[hHash], 2, addr cBuf,addr dwSigLen, 0
  38. .endif
  39.  
  40. invoke CryptDestroyHash,[hHash]
  41. invoke CryptReleaseContext,[hProv], 0
  42. stdcall StringToHex,addr cBuf,20,[cBuffer]
  43. popad
  44. ret
  45. endp
  46. ;Descripción: Convierte un dato a hexadecimal
  47. ; by YST
  48. proc StringToHex,cPuntero,cCantidad,cBuffer
  49. pushad
  50. mov esi,[cPuntero]
  51.  
  52. mov edi,[cBuffer]
  53. .bucle:
  54. cmp  [cCantidad],0
  55. je .salir
  56. xor edx,edx
  57. movzx eax,byte[esi]
  58. mov ebx,16
  59. div ebx
  60. mov bl, byte[numeros+eax]
  61. mov byte[edi],bl
  62. mov bl, byte[numeros+edx]
  63. mov byte[edi+1],bl
  64. add edi,2
  65. inc esi
  66. dec  [cCantidad]
  67. jmp  .bucle
  68. .salir:
  69. popad
  70. ret
  71. numeros db '0123456789ABCDEF',0  
  72. endp
  73. .end start
  74.  
427  Programación / ASM / Re: Pequeño codigo para comparar strings... en: 13 Junio 2009, 02:22 am
otra opción:
Código
  1. proc comparar ,SRC,DST ;Funcion que compara
  2. push edi ecx esi
  3. mov ecx,-1
  4. mov edi,[SRC]
  5. mov al,0
  6. repnz scasb
  7. mov eax,ecx
  8. not eax
  9. mov ecx,eax
  10. mov esi,[SRC]
  11. mov edi,[DST]
  12. repz cmpsb
  13. mov eax,1
  14. jnz Next
  15. dec eax
  16. Next:
  17. pop esi ecx edi
  18. ret
  19. endp
428  Programación / ASM / Re: Te creamos tu función. en: 13 Junio 2009, 02:19 am
El que se quiera perjudicar que se perjudique , este post lo hice para yo practicar mi ASM y aprobbechar de ayudar.

Saludos
429  Programación / ASM / Re: Recopilación de mis codigos. en: 12 Junio 2009, 23:58 pm
Código
  1. proc HexToString,cPuntero,cCantidad,cBuffer
  2. pushad
  3. mov edi,[cPuntero]
  4. mov esi,[cBuffer]
  5. .bucle:
  6. cmp [cCantidad] ,0
  7. je .salir
  8. movzx eax,byte[edi]
  9. xor edx,edx
  10. mov ebx,16
  11. div ebx
  12. mov ecx,edx
  13. .if byte[edi] >= 'A'
  14. add ecx,9
  15. .endif
  16. xor edx,edx
  17. mov eax,16
  18. mul ecx
  19. mov ecx,eax
  20. movzx eax,byte[edi+1]
  21. xor edx,edx
  22. mov ebx,16
  23. div ebx
  24. .if byte[edi+1] >= 'A'
  25. add edx,9
  26. .endif
  27. add ecx,edx
  28. mov byte[esi],cl
  29. inc esi
  30. add edi,2
  31. dec [cCantidad]
  32. jmp  .bucle
  33. .salir :
  34. popad
  35. ret
  36. endp
430  Programación / ASM / Re: Recopilación de mis codigos. en: 12 Junio 2009, 22:08 pm
Código
  1. ;Descripción: Convierte un dato a hexadecimal
  2. ; by YST
  3. proc StringToHex,cPuntero,cCantidad,cBuffer
  4. pushad
  5. mov esi,[cPuntero]
  6.  
  7. mov edi,[cBuffer]
  8. .bucle:
  9. cmp  [cCantidad],0
  10. je .salir
  11. xor edx,edx
  12. movzx eax,byte[esi]
  13. mov ebx,16
  14. div ebx
  15. mov bl, byte[numeros+eax]
  16. mov byte[edi],bl
  17. mov bl, byte[numeros+edx]
  18. mov byte[edi+1],bl
  19. add edi,2
  20. inc esi
  21. dec  [cCantidad]
  22. jmp  .bucle
  23. .salir:
  24. popad
  25. ret
  26. numeros db '0123456789ABCDEF',0  
  27. endp            
Páginas: 1 ... 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 [43] 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 ... 68
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines