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

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


  Mostrar Mensajes
Páginas: 1 ... 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 59 60 61 ... 68
451  Programación / ASM / Re: Recopilación de mis codigos. en: 1 Junio 2009, 00:26 am
Código
  1. proc LenUnicode,cCadena
  2. mov ebx,[cCadena]
  3. mov eax,0
  4. .bucle:
  5. inc eax
  6. cmp byte[ebx+eax*2],0
  7. jne  .bucle
  8. pop ebx
  9. ret
  10. endp
452  Programación / ASM / Re: Recopilación de mis codigos. en: 1 Junio 2009, 00:19 am
Código
  1. include 'win32ax.inc'
  2.  
  3. .data
  4. xD db '[soy una cadena.]',0
  5. .code
  6. start:
  7. stdcall EncriptacionChangeCase,xD,0
  8. invoke MessageBox,0,xD,0,0
  9. invoke ExitProcess,0
  10. ;Función que transforma las miniscula a mayusculas y viceversa
  11. ; cCadena = Puntero de cadena a cifrar
  12. ; cTTamaño = Tamaño de cadena a enbcriptar si este es 0 se medira la cadena automaticamente (fin de cadena de caracter nulo )
  13. ;  By YST
  14. proc EncriptacionChangeCase,cCadena,cTamaño
  15. push ebx
  16. xor ebx,ebx
  17. cmp [cTamaño],0
  18. je .contar
  19. mov ebx,[cTamaño]
  20. jmp .Start
  21. .contar:
  22. mov ebx,0
  23. mov eax,[cCadena]
  24. .len:
  25. inc ebx
  26. inc eax
  27. cmp byte[eax],0
  28. jne .len
  29. .Start:
  30. mov eax, [cCadena]
  31. dec eax
  32. inc ebx
  33. .bucle:
  34. dec ebx
  35. inc eax
  36. cmp ebx,0
  37. je .salir
  38. cmp byte[eax],'A'
  39. jb .bucle
  40. cmp byte[eax],91
  41. jge .revisar
  42. jmp .seguir
  43. jmp .bucle
  44. .seguir:
  45. cmp byte[eax],"Z"
  46. jbe .Mayuscula
  47. cmp byte[eax],"z"
  48. jbe .Miniscula
  49. jmp .bucle
  50. .salir :
  51. xor ebx,ebx
  52. mov ebx,0
  53. mov eax,[cCadena]
  54. pop ebx
  55. ret
  56. .revisar:
  57. cmp byte[eax],96
  58. jg .seguir
  59. jbe .bucle
  60. .Mayuscula:         ;Si es Mayuscula la pasamos a miniscula
  61. add byte[eax],0x20
  62. jmp .bucle
  63. .Miniscula:         ;Si es miniscula la pasamos a Mayuscula
  64. sub byte[eax],0x20
  65. jmp .bucle
  66. xor ebx,ebx
  67. mov ebx,0
  68. mov eax,[cCadena]
  69. endp
  70.  
  71. .end start
453  Programación / ASM / Re: Recopilación de mis codigos. en: 1 Junio 2009, 00:14 am
Código
  1. include 'win32ax.inc'
  2. .data
  3. Separador db "/()·/", 0
  4. Cadena db 'Soy/()·/una/()·/cadena',0
  5. Cantidad dd ?
  6. buffer rb MAX_PATH
  7. .code
  8. start:
  9. stdcall Split,Cadena,Separador,buffer
  10. mov [Cantidad],eax
  11. stdcall Len,Separador
  12. mov ebx,eax
  13. mov ecx,[Cantidad]
  14. inc ecx
  15. mov esi,buffer
  16. .bucle:
  17. push ecx
  18. invoke MessageBox,0,esi,esi,0
  19. stdcall Len,esi
  20. add esi,eax
  21. add esi,ebx
  22. pop ecx
  23. loop .bucle
  24. invoke ExitProcess,0
  25. ; cCadena(in) = Cadena a partir
  26. ; cSeparador(in) = Separador que se usara para partir la cadena
  27. ; cBuffer(out) = A donde se guardara la cadena partida
  28. ; Retorna la cantidad de separadores encontrados
  29. proc Split,cCadena,cSeparador,cBuffer
  30. push edi esi ecx  ebx
  31. xor ebx,ebx
  32. stdcall copy,[cBuffer],[cCadena]
  33. stdcall Len,[cSeparador]
  34. mov edi,eax
  35. mov  esi,[cBuffer]
  36. dec  esi
  37. .bucle:
  38. inc esi
  39. cmp byte[esi],0
  40. je .salir
  41. mov cl,byte[esi+edi]
  42. mov byte[esi+edi],0
  43. stdcall comparar,esi,[cSeparador]
  44. mov byte[esi+edi],cl
  45. cmp eax,0
  46. jne .bucle
  47. inc ebx
  48. mov byte[esi],0
  49. add esi,edi
  50. jmp .bucle
  51. .salir:
  52. mov eax,ebx
  53. pop ebx ecx esi edi
  54. ret
  55. endp
  56.  
  57. proc comparar ,SRC,DST ;Funcion que compara
  58. push edi ecx esi
  59. mov ecx,-1
  60. mov edi,[SRC]
  61. mov al,0
  62. repnz scasb
  63. mov eax,ecx
  64. not eax
  65. mov ecx,eax
  66. mov esi,[SRC]
  67. mov edi,[DST]
  68. repz cmpsb
  69. mov eax,1
  70. jnz Next
  71. dec eax
  72. Next:
  73. pop esi ecx edi
  74. ret
  75. endp
  76. proc Len,cCadena   ;Funcion que mide la cadena
  77. push ecx edi
  78. mov ecx,-1
  79. mov edi,[cCadena]
  80. mov al,0
  81. repnz scasb
  82. mov eax,ecx
  83. not eax
  84. dec eax
  85. pop edi ecx
  86. ret
  87. endp
  88. proc copy,cDestino,cCadena    ;funcion que copia una cadena
  89. push ecx edi esi
  90. stdcall Len,[cCadena]
  91. add eax,2
  92. mov ecx,eax
  93. mov esi,[cCadena]
  94. mov edi,[cDestino]
  95. rep movsb
  96. pop esi edi ecx
  97. ret
  98. endp
  99. .end start
454  Programación / ASM / Re: Recopilación de mis codigos. en: 1 Junio 2009, 00:06 am
Código
  1. format pe console
  2. espacio equ 13,10,0
  3. include 'win32ax.inc'
  4. .data
  5. RutaLib   rb MAX_PATH
  6. RutaINC   rb MAX_PATH
  7. .code
  8. start:
  9. invoke printf,"Ingrese la ruta de la libreria:"
  10. invoke printf,espacio
  11. invoke scanf,"%s",RutaLib
  12. invoke printf,"Ingrese la ruta de la donde se generara el include:"
  13. invoke printf,espacio
  14. invoke scanf,"%s",RutaINC
  15. stdcall CrearImport,RutaLib,RutaINC
  16. invoke ExitProcess,0
  17. proc CrearImport,NombreLIB,NombreImport
  18. locals
  19. DirPEHeader dd ?
  20. PunteroPEHeader dd ?
  21. RVAofExportDirectory   dd ?
  22. NumberOfNames dd ?
  23. AddressOfNames dd ?
  24. Funcion dd ?
  25. HFile dd ?
  26. Nosirve dd ?
  27. Largo dd ?
  28. LibHandle dd ?
  29. endl
  30. push ebx  edx  edi  ecx
  31.    invoke LoadLibrary, [NombreLIB]
  32.    mov [LibHandle],eax
  33. cmp eax,NULL
  34. je .Error
  35. push dword[eax + 03Ch]
  36. pop  [DirPEHeader]
  37. push [DirPEHeader]
  38. pop [PunteroPEHeader]
  39. add  [PunteroPEHeader],eax
  40. mov ebx,[PunteroPEHeader]
  41. cmp word[ebx],"PE"
  42. jne .Error
  43. push dword[ebx+078h]
  44. pop [RVAofExportDirectory]
  45. mov ebx, [RVAofExportDirectory]
  46. add ebx,eax
  47. push dword[ebx+018h]
  48. pop [NumberOfNames]
  49. mov edx,[NumberOfNames]
  50. push dword[ebx+20h]
  51. pop [AddressOfNames]
  52. mov ebx,[NumberOfNames]
  53. mov        edi, [AddressOfNames]
  54.    add        edi,[LibHandle]
  55.  
  56.  
  57.  
  58.               invoke CreateFileA, [NombreImport], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0
  59.                mov [HFile], eax
  60.                invoke lstrlen,"import "
  61.            invoke WriteFile, [HFile], "import ",eax,addr Nosirve, NULL
  62.                 invoke lstrlen,[NombreLIB]
  63.                 sub eax,4
  64.                invoke WriteFile, [HFile], [NombreLIB],eax,addr Nosirve, NULL
  65.                invoke WriteFile,[HFile] , ",\",2,addr Nosirve, NULL
  66.                             invoke WriteFile, [HFile], espacio,2,addr Nosirve, NULL
  67.  
  68. .bucle:
  69. dec ebx
  70. mov        eax, [edi + ebx * 4]
  71. add eax,[LibHandle]
  72. mov [Funcion],eax
  73.        invoke lstrlen, [Funcion]
  74.                invoke WriteFile, [HFile], [Funcion],eax,addr Nosirve, NULL
  75.                invoke WriteFile, [HFile],",",1,addr Nosirve, NULL
  76.  
  77.                              invoke WriteFile, [HFile],"'",1,addr Nosirve, NULL
  78.                                      invoke lstrlen, [Funcion]
  79.                invoke WriteFile, [HFile], [Funcion],eax,addr Nosirve, NULL
  80.                .if ebx = 0
  81.                      invoke WriteFile, [HFile],"'",1,addr Nosirve, NULL
  82.                .else
  83.                  invoke WriteFile, [HFile],"',\",3,addr Nosirve, NULL
  84.              invoke WriteFile, [HFile], espacio,2,addr Nosirve, NULL
  85.              .endif
  86.  cmp ebx,0
  87.  jne .bucle
  88.  
  89.            invoke CloseHandle, [HFile]
  90.            invoke system,"cls"
  91.            invoke printf,"Extraida las funciones de: "
  92.            invoke printf,RutaLib
  93.            invoke printf,espacio
  94.            invoke printf,espacio
  95.            invoke printf,"El include ah sido generado en : "
  96.             invoke printf,RutaINC
  97.                      invoke printf,espacio
  98.            invoke printf,espacio
  99.            invoke printf,"Con "
  100.               invoke printf,"%d",[NumberOfNames]
  101.               invoke printf," funciones extraidas."
  102.                invoke printf,espacio
  103.                  invoke system,"pause"
  104. pop  ecx edi edx ebx
  105. ret
  106. .Error:
  107.      invoke system,"cls"
  108.            invoke printf,"Ocurrio un error durante la extracciòn."
  109.                        invoke printf,espacio
  110.               invoke system,"pause"
  111. ret
  112. endp
  113. .end start    
  114.  

PD: En este codigose necesita agregar alguna apis a la win32ax.
455  Programación / ASM / Re: Recopilación de mis codigos. en: 1 Junio 2009, 00:00 am
Código
  1. include 'win32ax.inc'
  2.  
  3. .code
  4. start:
  5.  
  6. stdcall CapetaVaciaOUnidad,"F:"
  7.  
  8. .if eax = TRUE
  9. invoke MessageBox,0,"La carpeta esta vacia",0,0
  10. .else
  11. invoke MessageBox,0,"La carpeta no esta vacia",0,0
  12. .endif
  13.  
  14. invoke ExitProcess,0
  15.  
  16. proc CapetaVaciaOUnidad,ruta
  17. locals
  18. Find  WIN32_FIND_DATA    ?
  19. HandleBusqueda dd ?
  20. Ruta dd ?
  21. endl
  22.  
  23. push ebx
  24.  
  25. invoke GlobalAlloc,GPTR,MAX_PATH+1
  26. mov [Ruta],eax
  27. stdcall Concat,[ruta],"\*", [Ruta]
  28. invoke FindFirstFile,[Ruta] , addr Find
  29. mov [HandleBusqueda],eax
  30. invoke FindNextFile ,eax, addr Find
  31. invoke lstrcpy,[Ruta],addr Find.cFileName
  32. mov ebx,[Ruta]
  33.  
  34. .if word[ebx] = ".."
  35. invoke FindNextFile, [HandleBusqueda], addr Find
  36. .endif
  37. invoke lstrcpy,[Ruta],addr Find.cFileName
  38. mov ebx,[Ruta]
  39. .if word[ebx] = ".."
  40.  
  41. invoke GlobalFree,[Ruta]
  42. mov eax,TRUE
  43. .else
  44. .if dword[ebx] = "RECY"
  45. .if dword[ebx+4] = "CLER"
  46. invoke GlobalFree,[Ruta]
  47. mov eax,TRUE
  48. .endif
  49. .else
  50. invoke GlobalFree,[Ruta]
  51. mov eax,FALSE
  52. .endif
  53. .endif
  54. .endif
  55. pop ebx
  56.  
  57. ret
  58. endp
  59.  
  60. proc Concat uses esi edi, @AdrSrc1, @AdrSrc2, @AdrDest
  61.  
  62.    mov esi,[@AdrSrc1]
  63.    mov edi,[@AdrDest]
  64.  
  65. .concat_src1:
  66.    movsb
  67.    cmp byte[esi],0
  68.    jne .concat_src1
  69.  
  70.    mov esi,[@AdrSrc2]
  71.  
  72. .concat_src2:
  73.    movsb
  74.    cmp byte[esi],0
  75.    jne .concat_src2
  76.  
  77.    movsb
  78.  
  79.    ret
  80. endp
  81. .end start
456  Programación / ASM / Re: Recopilación de mis codigos. en: 31 Mayo 2009, 23:58 pm
Código
  1. include 'win32ax.inc'
  2. .data
  3. buffer rb 100
  4. .code
  5. start:
  6. stdcall StrReverse,kk,buffer
  7. invoke MessageBox,0,buffer,kk,0
  8. leave
  9. ret
  10. kk: db  "Estoy cifrado",0
  11. proc StrReverse,cCadena,cBuffer
  12. push ebx esi edi eax ecx
  13. mov ebx, [cCadena]
  14. mov esi,[cBuffer]
  15. stdcall Len,ebx
  16. mov ecx,eax
  17. mov al,byte[ebx]
  18. dec ecx
  19. mov edi,0
  20. .bucle:
  21. mov ah,byte[ebx+ecx]
  22. mov byte[esi+edi],ah
  23. inc edi
  24. dec ecx
  25. jecxz .salir
  26. jmp .bucle
  27. .salir:
  28. mov byte[esi+edi],al
  29. mov byte[esi+edi+1],0
  30. pop ecx eax edi esi ebx
  31. ret
  32. endp
  33. proc Len , SRC
  34. push ecx edi
  35. mov ecx,-1
  36. mov edi,[SRC]
  37. mov al,0
  38. repnz scasb
  39. mov eax,ecx
  40. not eax
  41. dec eax
  42. pop edi ecx
  43. ret
  44. endp
  45. .end start
457  Programación / ASM / Re: Recopilación de mis codigos. en: 31 Mayo 2009, 23:51 pm
Código
  1. proc Zerar,Puntero,Cantidad
  2.  
  3.    push ecx
  4.    push ebx
  5.  
  6.              mov ecx,[Cantidad]
  7.                 mov ebx,[Puntero]
  8.                .bucle:
  9.  
  10.                mov byte[ebx+ecx],0
  11.                loop .bucle
  12.                mov byte[ebx],0
  13.                pop ebx
  14.                pop ecx
  15.                ret
  16. endp
458  Programación / ASM / Re: Recopilación de mis codigos. en: 31 Mayo 2009, 23:47 pm
Código
  1. antiemulator:
  2. push ebx ecx
  3. invoke GetTickCount
  4. mov ebx,eax
  5. mov eax,2
  6. mov ecx,250
  7. mul ecx
  8. invoke SleepEx,eax,FALSE ; 250 * 2= 500 ( para confundir un poco el antivirus )
  9. invoke GetTickCount
  10. sub eax,ebx
  11. cmp eax,500
  12. jl .si
  13. mov eax,FALSE
  14. pop ecx ebx
  15. ret
  16. .si:
  17. pop ecx ebx
  18. mov eax,TRUE
  19. ret
459  Programación / ASM / Re: Recopilación de mis codigos. en: 31 Mayo 2009, 23:42 pm
Código
  1. include 'win32ax.inc'
  2. .code
  3. start:
  4. invoke LoadLibrary,"user32.dll"
  5. stdcall  GetAddressFunction,eax,"MessageBoxA"
  6. stdcall eax,0,0,0,0
  7. invoke ExitProcess,0
  8. proc GetAddressFunction,pMZ,pApi
  9. ;EDI = MZ
  10. ;Expot data = EBX
  11. ;Esi = Cantidad de funciones
  12. ;edx = AddressOfNames
  13. ;ECX = Propositos generales
  14. mov edi, [pMZ]
  15. mov ebx,[edi+0x3c]
  16. mov ebx,[ebx+edi+0x78]
  17. add ebx,edi
  18. mov esi,[0x18+ebx]
  19. mov edx, [0x20+ebx]
  20. add edx,edi
  21. .bucle:
  22. dec esi
  23. cmp esi,0
  24. je .error
  25. mov eax,esi
  26. rol eax,2   ;Multiplicamos esi por 4
  27. mov eax,[edx + eax]
  28. add eax,edi
  29. stdcall comparar,[pApi],eax
  30. xor eax,0
  31. jnz  .bucle
  32. mov eax,[0x24+ebx]
  33. add eax,edi
  34. movzx ecx, word[eax + 2*esi]
  35. mov eax, [ebx + 0x1c]
  36. add eax,edi
  37. mov eax, [eax + 4 * ecx]
  38. add eax, edi
  39. .salir:
  40. ret
  41. .error:
  42. xor eax,eax
  43. jmp .salir
  44. endp
  45. proc comparar ,SRC,DST
  46. push edi ecx esi
  47. mov ecx,-1
  48. mov edi,[SRC]
  49. mov al,0
  50. repnz scasb
  51. mov eax,ecx
  52. not eax
  53. mov ecx,eax
  54. mov esi,[SRC]
  55. mov edi,[DST]
  56. repz cmpsb
  57. mov eax,1
  58. jnz Next
  59. dec eax
  60. Next:
  61. pop esi ecx edi
  62. ret
  63. endp
  64. .end start
460  Programación / ASM / Re: Recopilación de mis codigos. en: 31 Mayo 2009, 23:17 pm
Código
  1. include 'win32ax.inc'
  2. .code
  3. start:
  4. stdcall cInstr,"98y4ct2y3Hola83925832c","Hola"
  5. .if eax = FALSE
  6. invoke MessageBox,0,"No esta.",0,0
  7. .else
  8. invoke MessageBox,0,eax,0,0
  9. .endif
  10. invoke ExitProcess,0
  11. ;////////////////////////////////////////////////////////////////////////////////////////////////////
  12. ;//Descripción: Funcion que ve si la segunda cadena se encuentra dentro de la primera             //
  13. ;//c1 = Cadena                                                                                   //
  14. ;//c2 = Cadena que se buscara en c1                                                             //
  15. ;// Retorna:                                                                                   //
  16. ;// Si no se encuentra o hay error retorna FALSE , en el caso de que se encuentre devuelve eax//
  17. ;// apuntandoa la posicion de c1 donde se encontro c2                                        //
  18. ;// by YST                                                                                  //
  19. ;////////////////////////////////////////////////////////////////////////////////////////////
  20. proc cInstr,c1,c2
  21. push edi esi ebx ecx  edx
  22. stdcall Len,[c2]
  23. mov edi,eax
  24. stdcall Len,[c1]
  25. mov esi,eax
  26. cmp edi,esi
  27. jg .Falso
  28. mov edx,[c1]
  29. mov ebx,[c2]
  30. dec edx
  31. inc esi
  32. .bucle:
  33. dec esi
  34. inc edx
  35. mov cl,byte[edx+edi]
  36. mov byte[edx+edi],0
  37. stdcall comparar,edx,[c2]
  38. mov byte[edx+edi],cl
  39. .if eax = 0
  40. mov eax,edx
  41. jmp .salir
  42. .endif
  43. cmp esi,0
  44. jne .bucle
  45. .Falso:
  46. mov eax,FALSE
  47. .salir:
  48. pop edx ecx ebx esi edi
  49. ret
  50. endp
  51. proc comparar ,SRC,DST ;Funcion que compara
  52. push edi ecx esi
  53. mov ecx,-1
  54. mov edi,[SRC]
  55. mov al,0
  56. repnz scasb
  57. mov eax,ecx
  58. not eax
  59. mov ecx,eax
  60. mov esi,[SRC]
  61. mov edi,[DST]
  62. repz cmpsb
  63. mov eax,1
  64. jnz Next
  65. dec eax
  66. Next:
  67. pop esi ecx edi
  68. ret
  69. endp
  70. proc Len,cCadena   ;Funcion que mide la cadena
  71. push ecx edi
  72. mov ecx,-1
  73. mov edi,[cCadena]
  74. mov al,0
  75. repnz scasb
  76. mov eax,ecx
  77. not eax
  78. dec eax
  79. pop edi ecx
  80. ret
  81. endp
  82. .end start
Páginas: 1 ... 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 59 60 61 ... 68
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines