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

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [FUNCION] Autoit CMD Prompt
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [FUNCION] Autoit CMD Prompt  (Leído 2,624 veces)
79137913


Desconectado Desconectado

Mensajes: 1.169


4 Esquinas


Ver Perfil WWW
[FUNCION] Autoit CMD Prompt
« en: 2 Diciembre 2013, 15:32 pm »

HOLA!!!

Jugando con autoit cree esta pequeña suite de funciones para trabajar con CMD:
Código
  1. ;Creado por 79137913
  2. Global $cmdpid
  3. Global $cmdresponse
  4.  
  5. ;~ _iniciarCMD()
  6. ;~ _sendCMDCommand("ping 127.0.0.1",2)
  7. ;~ MsgBox(0,"",$cmdresponse)
  8. ;~ _sendCMDCommand("cd ..",1)
  9. ;~ MsgBox(0,"",$cmdresponse)
  10. ;~ _sendCMDCommand("cd ..",1)
  11. ;~ MsgBox(0,"",$cmdresponse)
  12. ;~ _CerrarCMD()
  13. func _SendCMDCommand($command,$timeoutlimit);Envia un comando CMD y devuelve la respuesta, timeout es en segundos
  14.    StdinWrite($cmdpid,$command)
  15.    StdinWrite($cmdpid,@CRLF)
  16. ;StdinWrite($cmdpid)
  17.    Local $data
  18. Local $response
  19. Local $timeout
  20. $data = ""
  21.    While True
  22.    sleep(100)
  23.        $data &= StdoutRead($cmdpid)
  24.        If $data <> "" Then
  25. $response=$response & $data
  26. $data=""
  27. $timeout=0
  28. $timeout=$timeout+1
  29. if $timeout=$timeoutlimit*10 then ExitLoop
  30.    WEnd
  31.    $cmdresponse = $response
  32. func _CerrarCMD();Cerrar CMD
  33.   StdinWrite($cmdpid)
  34. Func _IniciarCMD();Inicializar CMD
  35.    $cmdpid = Run("C:\Windows\system32\cmd.exe",@SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)

GRACIAS POR LEER!!!


« Última modificación: 2 Diciembre 2013, 16:34 pm por 79137913 » En línea

"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*
Danyfirex


Desconectado Desconectado

Mensajes: 493


My Dear Mizuho


Ver Perfil
Re: [FUNCION] Autoit CMD Prompt
« Respuesta #1 en: 2 Diciembre 2013, 16:14 pm »

Gracias por la función es muy útil.  no uses Dim ;)

saludos


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Prompt parpadeante al arrancar desde CD
Hardware
BUSINA49SS 6 4,579 Último mensaje 3 Junio 2010, 22:05 pm
por Aprendiz-Oscuro
Debugger del prompt de Windows 7 64 bits
ASM
DA KILLER 3 10,590 Último mensaje 26 Octubre 2010, 19:25 pm
por Eternal Idol
Download Funcion [autoit]
Scripting
Danyfirex 0 2,032 Último mensaje 17 Diciembre 2012, 16:04 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