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

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  Download Funcion [autoit]
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Download Funcion [autoit]  (Leído 2,033 veces)
Danyfirex


Desconectado Desconectado

Mensajes: 493


My Dear Mizuho


Ver Perfil
Download Funcion [autoit]
« en: 17 Diciembre 2012, 16:04 pm »

Bueno aquí les dejo la versión en Autoit de la que hice en delphi.

Código:
#cs -------------------------------------------------------
AutoIt Version: 3.3.8.1
Traducido Por..........: Pink
Agradecimientos........: monoceres
Version Delphi por........:  Pink
Script Function...: Download
Uso..............:Download($urlfile,$pathtosave)
#ce -------------------------------------------------------

Download("http://whitehat.su/Anotador.exe","C:\file.exe")
Func Download($Url,$path)
local $bytes = DllStructCreate("byte[512]")
local $Address= DllCall("Kernel32.dll", "ptr", "GetProcAddress", "ptr",GetModuleHandle("urlmon.dll"), "str", "URLDownloadToFileW")
$Address= $Address[0]
Local $Bufferurl = DllStructCreate("wchar url[" & StringLen($Url) +1 & "]")
Local $Bufferpath = DllStructCreate("wchar path[" & StringLen($path) +1  & "]")
    DllStructSetData($Bufferurl, "url", $Url)
    DllStructSetData($Bufferpath, "path", $path)

Local $Opcode
$Opcode &= "0x"
$Opcode &= "33DB"
$Opcode &= "68" & SwapEndian(0)
$Opcode &= "68" & SwapEndian(0)
$Opcode &= "68" & SwapEndian(DllStructGetPtr($Bufferpath, 1))
$Opcode &= "68" & SwapEndian(DllStructGetPtr($Bufferurl, 1))
$Opcode &= "68" & SwapEndian(0)
$Opcode &= "B8" & SwapEndian($Address)
$Opcode &= "FFD0"
$Opcode &= "53"
$Opcode &= "58"
$Opcode &= "C3"
DllStructSetData($bytes, 1, $Opcode)
Local $Ret = DllCall("user32.dll", "int", "CallWindowProc", "ptr", DllStructGetPtr($bytes), "int", 0, "int", 0, "int", 0, "int", 0)
EndFunc

Func GetModuleHandle($sModuleName)
Local $sModuleNameType = "wstr"
If $sModuleName = "" Then
  $sModuleName = 0
  $sModuleNameType = "ptr"
EndIf
Local $aResult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", $sModuleNameType, $sModuleName)
If @error Then Return SetError(@error, @extended, 0)
Return $aResult[0]
EndFunc ;==>GetModuleHandle WinAPI

Func SwapEndian($hex)
    Return Hex(Binary($hex))
EndFunc   ;==>SwapEndian


Saludos


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Autoit] Loop
Scripting
mubimeiquer 2 5,415 Último mensaje 13 Febrero 2009, 16:36 pm
por gna08
[Perl] Funcion download()
Scripting
BigBear 0 1,288 Último mensaje 13 Octubre 2011, 17:14 pm
por BigBear
[FUNCION] Autoit CMD Prompt
Scripting
79137913 1 2,624 Último mensaje 2 Diciembre 2013, 16:14 pm
por Danyfirex
[FUNCION] Autoit MELT
Scripting
79137913 0 1,842 Último mensaje 10 Diciembre 2013, 14:57 pm
por 79137913
[FUNCION] Autoit TCP File Send
Scripting
79137913 0 1,850 Último mensaje 10 Diciembre 2013, 15:02 pm
por 79137913
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines