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

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


  Mostrar Mensajes
Páginas: 1 ... 26 27 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 ... 68
401  Programación / ASM / Re: [ASM]Algoritmo de Ordenacion Quicksort en: 26 Junio 2009, 10:47 am
Basado en el Ordenamiento por Selección

hice un codigo para ordenar bytes :P

Este metodo tambien sirve para hacer un orden alfabetico ya que los caracteres ascii estan en orden alfabetico :P
Código
  1. include 'win32ax.inc'
  2.  
  3. .data
  4. cc db '774422990',0
  5. .code
  6. start:
  7. invoke lstrlen,cc
  8. stdcall Ordenar,cc,eax
  9. invoke MessageBox,0,cc,0,0
  10. invoke ExitProcess,0
  11.  
  12. proc Ordenar,cNumer,cCantidad
  13. pushad
  14. pushf
  15. mov edi,[cCantidad]
  16. mov ebx,[cNumer]
  17. dec ebx
  18. inc edi
  19. .bucle:
  20. dec edi
  21. inc ebx
  22. stdcall Menor,ebx,edi
  23. mov cl,byte[ebx]
  24. mov byte[ebx],al
  25. mov byte[edx],cl
  26. cmp edi,1
  27. jne .bucle
  28. popf
  29. popad
  30. ret
  31. endp
  32. ;Función que retorna el byte menor en al y su posicion en edx
  33. proc Menor,cNumer,cCantidad
  34. push ecx
  35. mov eax,[cNumer]
  36. mov edx,eax
  37. mov ch,byte[eax]
  38. dec eax
  39. .bucle:
  40. dec [cCantidad]
  41. inc eax
  42. .if byte[eax] < ch
  43. mov ch,byte[eax]
  44. mov edx,eax
  45. .endif
  46. cmp [cCantidad] ,0
  47. jne .bucle
  48. mov eax, [cNumer]
  49. mov al,ch
  50. pop ecx
  51. ret
  52. endp
  53.  
  54. .end start                                                            
402  Programación / ASM / Re: [Duda]Problema de tamaños en: 25 Junio 2009, 22:24 pm
así lo hago yo !!! ;D
jaja :xD

403  Programación / ASM / Re: Recopilación de mis codigos. en: 25 Junio 2009, 06:44 am
Código
  1. include 'win32ax.inc'
  2. .data
  3. cBuffer db 'Hola',0
  4. cClave db 'Hola',0
  5. s db 257 dup(0)
  6.  
  7. .code
  8. start:
  9. stdcall Len,cClave
  10. mov ebx,eax
  11. stdcall Len,cBuffer
  12. stdcall RC4,cBuffer,cClave,eax,ebx
  13. invoke MessageBox,0,cBuffer,0,0
  14. invoke ExitProcess,0
  15. proc RC4,pBuffer,pPassword,pTamñoBuffer,pTamPass
  16. pushad
  17. dec [pTamñoBuffer]
  18. ;   For i = 0 To 255
  19. ; DoEvents
  20. ; s(i) = i
  21. ;   Next i
  22. mov eax,s
  23. mov byte[eax],0
  24. inc eax
  25. mov ecx,256
  26. .bucle1_:
  27. mov bl,byte[eax-1]
  28. inc bl
  29. mov  byte[eax] ,bl
  30. inc eax
  31. loop .bucle1_
  32.  
  33. ;    For i = 0 To 255
  34. ;        DoEvents
  35. ;        j = (j + s(i) + Key(i Mod Len(sKey))) Mod 256
  36. ;        tmp = s(i)
  37. ;        s(i) = s(j)
  38. ;        s(j) = tmp
  39. ;    Next i
  40. ;j = ebx
  41. ;ja = esi
  42. ;I = edi
  43. xor ebx,ebx
  44. mov edi,-1
  45. .bucle2_:
  46. inc edi
  47. xor esi,esi
  48. mov esi,ebx
  49. movzx eax,byte[s+edi]
  50. add esi,eax
  51. stdcall lMod,edi,[pTamPass]
  52. mov ecx,[pPassword]
  53. movzx eax,byte[ecx+eax]
  54. add esi,eax
  55. stdcall lMod,esi,256
  56. mov ebx, eax
  57. mov eax,s
  58. mov cl,byte[eax+ebx] ; s(j)
  59. mov ch,byte[eax+edi] ; s(i)
  60. mov byte[eax+edi],cl
  61. mov byte[eax+ebx],ch
  62. cmp edi,255
  63. jne .bucle2_
  64. inc edi
  65.  
  66.  
  67. ;   For l = 0 To UBound(Buffer)
  68. ;       DoEvents
  69. ;       i = (i + 1) Mod 256
  70. ;       j = (j + s(i)) Mod 256
  71. ;       tmp = s(i)
  72. ;       s(i) = s(j)
  73. ;       s(j) = tmp
  74. ;       Buffer(l) = Buffer(l) Xor (s((s(i) + s(j)) Mod 256))
  75. ;   Next l
  76. xor esi,esi  ;esi = l
  77. dec esi ; esi = -1
  78. .bucle3_:
  79. inc esi
  80. mov eax,edi
  81. inc eax
  82. stdcall lMod,eax,256
  83. mov edi,eax
  84. mov eax,ebx
  85. xor ecx,ecx
  86. movzx ecx,byte[s+edi]
  87. add eax,ecx
  88. stdcall lMod,eax,256
  89. mov ebx,eax
  90. mov eax,s
  91. mov cl,byte[eax+ebx] ; s(j)
  92. mov ch,byte[eax+edi] ; s(i)
  93. mov byte[eax+edi],cl
  94. mov byte[eax+ebx],ch
  95. mov eax,[pBuffer]
  96. add cl,ch
  97. movzx eax,cl
  98. add eax,s
  99. movzx eax,byte[eax]
  100. stdcall lMod,eax,256
  101.  
  102. mov edx,[pBuffer]
  103. xor byte[edx+esi],al
  104.  
  105. cmp esi,[pTamñoBuffer]
  106. jne .bucle3_
  107. popad
  108. ret
  109. endp
  110. invoke ExitProcess,0
  111. proc lMod,c1,c2
  112. push edx
  113. xor edx,edx
  114. mov eax,[c1]
  115. idiv [c2]
  116. push edx
  117. pop eax
  118. pop edx
  119. ret
  120. endp
  121.  
  122. proc Len,cCadena   ;Funcion que mide la cadena
  123. push ecx edi
  124. mov ecx,-1
  125. mov edi,[cCadena]
  126. mov al,0
  127. repnz scasb
  128. mov eax,ecx
  129. not eax
  130. dec eax
  131. pop edi ecx
  132. ret
  133. endp
  134. .end start
404  Programación / ASM / Re: [Duda]Problema de tamaños en: 25 Junio 2009, 06:33 am
Ya solucione el error terminando el algoritmo de cifrado :P
Código
  1. include 'win32ax.inc'
  2. .data
  3. cBuffer db 'Hello world',0
  4. cPassword db 'Password',0
  5.  
  6.  
  7. .code
  8. start:
  9. stdcall Len,cPassword
  10. mov ebx,eax
  11. stdcall Len,cBuffer
  12. stdcall RC4,cBuffer,cPassword,eax,ebx
  13. invoke MessageBox,0,cBuffer,0,0
  14. invoke ExitProcess,0
  15. proc RC4,pBuffer,pPassword,pTamñoBuffer,pTamPass
  16. locals
  17. s rb MAX_PATH
  18. endl
  19. pushad
  20. dec [pTamñoBuffer]
  21. ;   For i = 0 To 255
  22. ; DoEvents
  23. ; s(i) = i
  24. ;   Next i
  25. lea eax,[s]
  26. mov byte[eax],0
  27. inc eax
  28. mov ecx,256
  29. .bucle1_:
  30. mov bl,byte[eax-1]
  31. inc bl
  32. mov  byte[eax] ,bl
  33. inc eax
  34. loop .bucle1_
  35.  
  36. ;    For i = 0 To 255
  37. ;        DoEvents
  38. ;        j = (j + s(i) + Key(i Mod Len(sKey))) Mod 256
  39. ;        tmp = s(i)
  40. ;        s(i) = s(j)
  41. ;        s(j) = tmp
  42. ;    Next i
  43. ;j = ebx
  44. ;ja = esi
  45. ;I = edi
  46. xor ebx,ebx
  47. mov edi,-1
  48. .bucle2_:
  49. inc edi
  50. xor esi,esi
  51. mov esi,ebx
  52. movzx eax,byte[s+edi]
  53. add esi,eax
  54. stdcall lMod,edi,[pTamPass]
  55. mov ecx,[pPassword]
  56. movzx eax,byte[ecx+eax]
  57. add esi,eax
  58. stdcall lMod,esi,256
  59. mov ebx, eax
  60. lea eax,[s]
  61. mov cl,byte[eax+ebx] ; s(j)
  62. mov ch,byte[eax+edi] ; s(i)
  63. mov byte[eax+edi],cl
  64. mov byte[eax+ebx],ch
  65. cmp edi,255
  66. jne .bucle2_
  67. inc edi
  68.  
  69.  
  70. ;   For l = 0 To UBound(Buffer)
  71. ;       DoEvents
  72. ;       i = (i + 1) Mod 256
  73. ;       j = (j + s(i)) Mod 256
  74. ;       tmp = s(i)
  75. ;       s(i) = s(j)
  76. ;       s(j) = tmp
  77. ;       Buffer(l) = Buffer(l) Xor (s((s(i) + s(j)) Mod 256))
  78. ;   Next l
  79. xor esi,esi  ;esi = l
  80. dec esi ; esi = -1
  81. .bucle3_:
  82. inc esi
  83. mov eax,edi
  84. inc eax
  85. stdcall lMod,eax,256
  86. mov edi,eax
  87. mov eax,ebx
  88. xor ecx,ecx
  89. movzx ecx,byte[s+edi]
  90. add eax,ecx
  91. stdcall lMod,eax,256
  92. mov ebx,eax
  93. lea eax,[s]
  94. mov cl,byte[eax+ebx] ; s(j)
  95. mov ch,byte[eax+edi] ; s(i)
  96. mov byte[eax+edi],cl
  97. mov byte[eax+ebx],ch
  98. mov eax,[pBuffer]
  99. add cl,ch
  100. movzx eax,cl
  101. lea edx,[s]
  102. add eax,edx
  103. movzx eax,byte[eax]
  104. stdcall lMod,eax,256
  105.  
  106. mov edx,[pBuffer]
  107. xor byte[edx+esi],al
  108.  
  109. cmp esi,[pTamñoBuffer]
  110. jne .bucle3_
  111. popad
  112. ret
  113. endp
  114.  
  115. proc lMod,c1,c2
  116. push edx
  117. xor edx,edx
  118. mov eax,[c1]
  119. idiv [c2]
  120. push edx
  121. pop eax
  122. pop edx
  123. ret
  124. endp
  125.  
  126. proc Len,cCadena
  127. push ecx edi
  128. mov ecx,-1
  129. mov edi,[cCadena]
  130. mov al,0
  131. repnz scasb
  132. mov eax,ecx
  133. not eax
  134. dec eax
  135. pop edi ecx
  136. ret
  137. endp
  138. .end start
405  Programación / ASM / [Duda]Problema de tamaños en: 25 Junio 2009, 06:13 am
Hola,

pasando el algoritmo de RC4 a asm tengo el siguiente problema y es que al hacer un xor a un byte el otro operando ( o como se diga :xD ) no puede ser un dword haber si alguien me ayuda a solucionar el problema :P

Código
  1.  
  2. include 'win32ax.inc'
  3. .data
  4. cBuffer db 'Hola',0
  5. cClave db 'Hola',0
  6. s db 257 dup(0)
  7. b rb 20
  8. largo dd ?
  9. .code
  10. start:
  11. stdcall Len,cBuffer
  12. dec eax
  13. push eax
  14. pop [largo]
  15. ;   For i = 0 To 255
  16. ; DoEvents
  17. ; s(i) = i
  18. ;   Next i
  19. mov eax,s
  20. mov byte[eax],0
  21. inc eax
  22. mov ecx,256
  23. .bucle1_:
  24. mov bl,byte[eax-1]
  25. inc bl
  26. mov  byte[eax] ,bl
  27. inc eax
  28. loop .bucle1_
  29.  
  30. ;    For i = 0 To 255
  31. ;        DoEvents
  32. ;        j = (j + s(i) + Key(i Mod Len(sKey))) Mod 256
  33. ;        tmp = s(i)
  34. ;        s(i) = s(j)
  35. ;        s(j) = tmp
  36. ;    Next i
  37. ;j = ebx
  38. ;ja = esi
  39. ;I = edi
  40. xor ebx,ebx
  41. mov edi,-1
  42. .bucle2_:
  43. inc edi
  44. xor esi,esi
  45. mov esi,ebx
  46. movzx eax,byte[s+edi]
  47. add esi,eax
  48. stdcall lMod,edi,<stdcall Len,cClave>
  49. movzx eax,byte[cClave+eax]
  50. add esi,eax
  51. stdcall lMod,esi,256
  52. mov ebx, eax
  53. mov eax,s
  54. mov cl,byte[eax+ebx] ; s(j)
  55. mov ch,byte[eax+edi] ; s(i)
  56. mov byte[eax+edi],cl
  57. mov byte[eax+ebx],ch
  58. cmp edi,255
  59. jne .bucle2_
  60. inc edi
  61.  
  62.  
  63. ;   For l = 0 To UBound(Buffer)
  64. ;       DoEvents
  65. ;       i = (i + 1) Mod 256
  66. ;       j = (j + s(i)) Mod 256
  67. ;       tmp = s(i)
  68. ;       s(i) = s(j)
  69. ;       s(j) = tmp
  70. ;       Buffer(l) = Buffer(l) Xor (s((s(i) + s(j)) Mod 256))
  71. ;   Next l
  72. xor esi,esi  ;esi = l
  73. dec esi ; esi = -1
  74. .bucle3_:
  75. inc esi
  76. mov eax,edi
  77. inc eax
  78. stdcall lMod,eax,256
  79. mov edi,eax
  80. mov eax,ebx
  81. xor ecx,ecx
  82. movzx ecx,byte[s+edi]
  83. add eax,ecx
  84. stdcall lMod,eax,256
  85. mov ebx,eax
  86. mov eax,s
  87. mov cl,byte[eax+ebx] ; s(j)
  88. mov ch,byte[eax+edi] ; s(i)
  89. mov byte[eax+edi],cl
  90. mov byte[eax+ebx],ch
  91. mov eax,cBuffer
  92. add cl,ch
  93. movzx eax,cl
  94. add eax,s
  95. stdcall lMod,eax,256
  96. mov edx,cBuffer
  97. xor byte[edx+esi],eax      ; EL Problema esta aqui
  98.  
  99. cmp esi,[largo]
  100. jne .bucle3_
  101.  
  102.  
  103. invoke ExitProcess,0
  104. proc lMod,c1,c2
  105. push edx
  106. xor edx,edx
  107. mov eax,[c1]
  108. idiv [c2]
  109. push edx
  110. pop eax
  111. pop edx
  112. ret
  113. endp
  114.  
  115. proc Len,cCadena   ;Funcion que mide la cadena
  116. push ecx edi
  117. mov ecx,-1
  118. mov edi,[cCadena]
  119. mov al,0
  120. repnz scasb
  121. mov eax,ecx
  122. not eax
  123. dec eax
  124. pop edi ecx
  125. ret
  126. endp
  127. .end start
  128.  
406  Programación / ASM / Re: [ASM]Algoritmo de Ordenacion Quicksort en: 24 Junio 2009, 06:09 am
Por que el gracias con cara triste ???

Lo que me gustaria ver es el algoritmo RC4 en ASM , talves lo haga yo :P
407  Programación / ASM / Re: [ASM]Algoritmo de Ordenacion Quicksort en: 24 Junio 2009, 04:31 am
Muy buen code , para que sea compatible con byte y word se podria usar cbw y cwd :P solo es una idea para alguien que lo quiera usar.

Por si alguien no conoce de que trata el algoritmo
http://es.wikipedia.org/wiki/Quicksort
408  Programación / ASM / Re: Codigos de Yuri Grille en: 22 Junio 2009, 23:06 pm
A que te refieres cuando dices >

"De ese manera lo hago yo :P" ?

Que de esa manera yo invierto las cadenas :xD
409  Foros Generales / Sugerencias y dudas sobre el Foro / Re: borrar todos mis temas publicados en: 22 Junio 2009, 06:19 am
ya que esta el tema...¿en el perfil hay un boton para borrarse la cuenta? creo que eso es medio "peligroso"...
para moderadores... pero los usuarios sin ningún privilegio no lo ven

Entonces tendre privilegios de mas por que si lo veo :xD
410  Foros Generales / Sugerencias y dudas sobre el Foro / Re: analisis y diseno de malware en: 21 Junio 2009, 23:29 pm
Y MITM me dijo a mi que ownearon el foro :xD Yo le eh dicho que la mariguana hace mal :xD
Páginas: 1 ... 26 27 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 ... 68
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines