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


  Mostrar Mensajes
Páginas: 1 ... 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 [857] 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 ... 1254
8561  Informática / Software / Re: programa de inquilinos en: 11 Agosto 2013, 17:13 pm
Me uno a la petición
8562  Programación / Scripting / MOVIDO: [+] Skull Bat to Exe Compiler & Source Code!! |By-Skull| en: 11 Agosto 2013, 12:41 pm
El tema ha sido movido a Programación Visual Basic.

http://foro.elhacker.net/index.php?topic=215046.0
8563  Programación / Scripting / Re: EXPERTO EN .BAT FAVOR LEER EL MENSAJE en: 11 Agosto 2013, 10:44 am
mi pregunta es como con .bat puedo extraer un archivo .rar gracias.

Con cualquier compresor por línea de comandos que soporte archivos RAR, como WinRAR, 7Zip, etc...


-> http://en.helpdoc-online.com/winrar_4/source/html/helpsimplecommandlineextracting.htm

-> http://sevenzip.sourceforge.jp/chm/cmdline/commands/extract.htm


Saludos
8564  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 10 Agosto 2013, 22:55 pm
Una Class para manipular el archivo Hosts:

Código
  1. #Region " Hosts Helper "
  2.  
  3. Public Class Hosts_Helper
  4.  
  5.  
  6.    ' [ Hosts Helper ]
  7.    '
  8.    ' // By Elektro H@cker
  9.    '
  10.    ' Examples:
  11.    '
  12.    ' MsgBox(Hosts_Helper.HOSTS_Exists)
  13.    ' Hosts_Helper.Add("www.youtube.com", "231.7.66.33")
  14.    ' Hosts_Helper.Block("www.youtube.com")
  15.    ' MsgBox(Hosts_Helper.IsAdded("www.youtube.com"))
  16.    ' MsgBox(Hosts_Helper.IsBlocked("www.youtube.com"))
  17.    ' Hosts_Helper.Remove("www.youtube.com")
  18.    ' Hosts_Helper.Clean_Hosts_File()
  19.  
  20.  
  21.    Shared ReadOnly HOSTS As String = _
  22.    IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "Drivers\etc\hosts")
  23.  
  24.  
  25.    ''' <summary>
  26.    ''' Adds a new Block mapping into the Hosts file.
  27.    ''' </summary>
  28.    Public Shared Sub Block(ByVal URL As String)
  29.  
  30.        Dim Entry As String = String.Format("::1 {0}", URL)
  31.  
  32.        If HOSTS_Exists() AndAlso IsBlocked(URL) Then
  33.  
  34.            Throw New Exception(String.Format("""{0}"" is already blocked.", URL))
  35.            Exit Sub
  36.  
  37.        ElseIf HOSTS_Exists() AndAlso IsAdded(URL) Then
  38.  
  39.            Remove(URL)
  40.  
  41.        End If
  42.  
  43.        Try
  44.            IO.File.AppendAllText(HOSTS, (Environment.NewLine & Entry), System.Text.Encoding.Default)
  45.        Catch ex As Exception
  46.            Throw New Exception(ex.Message)
  47.        End Try
  48.  
  49.    End Sub
  50.  
  51.  
  52.    ''' <summary>
  53.    ''' Adds a new mapping into Hosts file.
  54.    ''' </summary>
  55.    Public Shared Sub Add(ByVal URL As String, ByVal IP_Address As String)
  56.  
  57.        Dim Entry As String = String.Format("{0} {1}", IP_Address, URL)
  58.  
  59.        If HOSTS_Exists() AndAlso (IsAdded(URL) OrElse IsBlocked(URL)) Then
  60.            Throw New Exception(String.Format("""{0}"" is already mapped.", URL))
  61.            Exit Sub
  62.  
  63.        ElseIf Not Validate_IP(IP_Address) Then
  64.            Throw New Exception(String.Format("""{0}"" is not a valid IP adress.", IP_Address))
  65.            Exit Sub
  66.        End If
  67.  
  68.        Try
  69.            IO.File.AppendAllText(HOSTS, (Environment.NewLine & Entry), System.Text.Encoding.Default)
  70.        Catch ex As Exception
  71.            Throw New Exception(ex.Message)
  72.        End Try
  73.  
  74.    End Sub
  75.  
  76.  
  77.    ''' <summary>
  78.    ''' Removes a blocked or an added URL from the Hosts file.
  79.    ''' </summary>
  80.    Public Shared Sub Remove(ByVal URL As String)
  81.  
  82.        If Not HOSTS_Exists() Then
  83.            Throw New Exception("HOSTS File does not exists.")
  84.            Exit Sub
  85.        ElseIf HOSTS_Exists() And Not (IsAdded(URL) OrElse IsBlocked(URL)) Then
  86.            Throw New Exception(String.Format("""{0}"" is not added yet.", URL))
  87.            Exit Sub
  88.        End If
  89.  
  90.        Try
  91.  
  92.            Dim Content As String = _
  93.                System.Text.RegularExpressions.Regex.Replace(IO.File.ReadAllText(HOSTS).ToLower, _
  94.                String.Format("(\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}|::1)(\s+|\t+){0}", URL.ToLower), String.Empty)
  95.  
  96.            IO.File.WriteAllText(HOSTS, Content, System.Text.Encoding.Default)
  97.  
  98.        Catch ex As Exception
  99.            Throw New Exception(ex.Message)
  100.        End Try
  101.  
  102.    End Sub
  103.  
  104.  
  105.    ''' <summary>
  106.    ''' Checks if an URL is already added into the Hosts file.
  107.    ''' </summary>
  108.    Public Shared Function IsAdded(ByVal URL As String) As Boolean
  109.  
  110.        Return If(Not HOSTS_Exists(), False, _
  111.                  System.Text.RegularExpressions.Regex.IsMatch( _
  112.                  System.Text.RegularExpressions.Regex.Replace(IO.File.ReadAllText(HOSTS).ToLower, "\s+|\t+", ";"), _
  113.                  String.Format(";[^\#]?\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}};{0}", URL.ToLower)))
  114.  
  115.    End Function
  116.  
  117.  
  118.    ''' <summary>
  119.    ''' Checks if an URL is already blocked into the Hosts file.
  120.    ''' </summary>
  121.    Public Shared Function IsBlocked(ByVal URL As String) As Boolean
  122.  
  123.        Return If(Not HOSTS_Exists(), False, _
  124.                  System.Text.RegularExpressions.Regex.IsMatch( _
  125.                  System.Text.RegularExpressions.Regex.Replace(IO.File.ReadAllText(HOSTS).ToLower, "\s+|\t+", String.Empty), _
  126.                  String.Format("[^\#](127.0.0.1|::1){0}", URL.ToLower)))
  127.  
  128.    End Function
  129.  
  130.  
  131.    ''' <summary>
  132.    ''' Checks if the Hosts file exists.
  133.    ''' </summary>
  134.    Public Shared Function HOSTS_Exists() As Boolean
  135.        Return IO.File.Exists(HOSTS)
  136.    End Function
  137.  
  138.  
  139.    ''' <summary>
  140.    ''' Cleans all the mappings inside the Hosts file.
  141.    ''' </summary>
  142.    Public Shared Sub Clean_Hosts_File()
  143.        Try
  144.            IO.File.WriteAllText(HOSTS, String.Empty)
  145.        Catch ex As Exception
  146.            MsgBox(ex.Message)
  147.        End Try
  148.    End Sub
  149.  
  150.  
  151.    ' Validates an IP adress.
  152.    Private Shared Function Validate_IP(ByVal IP_Address As String) As Boolean
  153.        Dim IP As System.Net.IPAddress = Nothing
  154.        Return System.Net.IPAddress.TryParse(IP_Address, IP)
  155.    End Function
  156.  
  157. End Class
  158.  
  159. #End Region
8565  Programación / .NET (C#, VB.NET, ASP) / Re: Cambiar una página por otra Visual Basic en: 10 Agosto 2013, 22:55 pm
Quiero que los cambios sean permanentes en la PC

es tán sencillo como añadir una entrada el archivo HOSTS. http://msdn.microsoft.com/en-us/library/ff749174.aspx

Acabo de codear una Class para manipular el archivo Hosts, puedes agregar un nuevo mapeo, bloquear diréctamente una url, eliminar un mapeo ...sólamente lo he testeado lo necesario.

Aquí tienes ;):

Código
  1. #Region " Hosts Helper "
  2.  
  3. Public Class Hosts_Helper
  4.  
  5.  
  6.    ' [ Hosts Helper ]
  7.    '
  8.    ' // By Elektro H@cker
  9.    '
  10.    ' Examples:
  11.    '
  12.    ' MsgBox(Hosts_Helper.HOSTS_Exists)
  13.    ' Hosts_Helper.Add("www.youtube.com", "231.7.66.33")
  14.    ' Hosts_Helper.Block("www.youtube.com")
  15.    ' MsgBox(Hosts_Helper.IsAdded("www.youtube.com"))
  16.    ' MsgBox(Hosts_Helper.IsBlocked("www.youtube.com"))
  17.    ' Hosts_Helper.Remove("www.youtube.com")
  18.    ' Hosts_Helper.Clean_Hosts_File()
  19.  
  20.  
  21.    Shared ReadOnly HOSTS As String = _
  22.    IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "Drivers\etc\hosts")
  23.  
  24.  
  25.    ''' <summary>
  26.    ''' Adds a new Block mapping into the Hosts file.
  27.    ''' </summary>
  28.    Public Shared Sub Block(ByVal URL As String)
  29.  
  30.        Dim Entry As String = String.Format("::1 {0}", URL)
  31.  
  32.        If HOSTS_Exists() AndAlso IsBlocked(URL) Then
  33.  
  34.            Throw New Exception(String.Format("""{0}"" is already blocked.", URL))
  35.            Exit Sub
  36.  
  37.        ElseIf HOSTS_Exists() AndAlso IsAdded(URL) Then
  38.  
  39.            Remove(URL)
  40.  
  41.        End If
  42.  
  43.        Try
  44.            IO.File.AppendAllText(HOSTS, (Environment.NewLine & Entry), System.Text.Encoding.Default)
  45.        Catch ex As Exception
  46.            Throw New Exception(ex.Message)
  47.        End Try
  48.  
  49.    End Sub
  50.  
  51.  
  52.    ''' <summary>
  53.    ''' Adds a new mapping into Hosts file.
  54.    ''' </summary>
  55.    Public Shared Sub Add(ByVal URL As String, ByVal IP_Address As String)
  56.  
  57.        Dim Entry As String = String.Format("{0} {1}", IP_Address, URL)
  58.  
  59.        If HOSTS_Exists() AndAlso (IsAdded(URL) OrElse IsBlocked(URL)) Then
  60.            Throw New Exception(String.Format("""{0}"" is already mapped.", URL))
  61.            Exit Sub
  62.  
  63.        ElseIf Not Validate_IP(IP_Address) Then
  64.            Throw New Exception(String.Format("""{0}"" is not a valid IP adress.", IP_Address))
  65.            Exit Sub
  66.        End If
  67.  
  68.        Try
  69.            IO.File.AppendAllText(HOSTS, (Environment.NewLine & Entry), System.Text.Encoding.Default)
  70.        Catch ex As Exception
  71.            Throw New Exception(ex.Message)
  72.        End Try
  73.  
  74.    End Sub
  75.  
  76.  
  77.    ''' <summary>
  78.    ''' Removes a blocked or an added URL from the Hosts file.
  79.    ''' </summary>
  80.    Public Shared Sub Remove(ByVal URL As String)
  81.  
  82.        If Not HOSTS_Exists() Then
  83.            Throw New Exception("HOSTS File does not exists.")
  84.            Exit Sub
  85.        ElseIf HOSTS_Exists() And Not (IsAdded(URL) OrElse IsBlocked(URL)) Then
  86.            Throw New Exception(String.Format("""{0}"" is not added yet.", URL))
  87.            Exit Sub
  88.        End If
  89.  
  90.        Try
  91.  
  92.            Dim Content As String = _
  93.                System.Text.RegularExpressions.Regex.Replace(IO.File.ReadAllText(HOSTS).ToLower, _
  94.                String.Format("(\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}|::1)(\s+|\t+){0}", URL.ToLower), String.Empty)
  95.  
  96.            IO.File.WriteAllText(HOSTS, Content, System.Text.Encoding.Default)
  97.  
  98.        Catch ex As Exception
  99.            Throw New Exception(ex.Message)
  100.        End Try
  101.  
  102.    End Sub
  103.  
  104.  
  105.    ''' <summary>
  106.    ''' Checks if an URL is already added into the Hosts file.
  107.    ''' </summary>
  108.    Public Shared Function IsAdded(ByVal URL As String) As Boolean
  109.  
  110.        Return If(Not HOSTS_Exists(), False, _
  111.                  System.Text.RegularExpressions.Regex.IsMatch( _
  112.                  System.Text.RegularExpressions.Regex.Replace(IO.File.ReadAllText(HOSTS).ToLower, "\s+|\t+", ";"), _
  113.                  String.Format(";[^\#]?\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}}\.\d{{1,3}};{0}", URL.ToLower)))
  114.  
  115.    End Function
  116.  
  117.  
  118.    ''' <summary>
  119.    ''' Checks if an URL is already blocked into the Hosts file.
  120.    ''' </summary>
  121.    Public Shared Function IsBlocked(ByVal URL As String) As Boolean
  122.  
  123.        Return If(Not HOSTS_Exists(), False, _
  124.                  System.Text.RegularExpressions.Regex.IsMatch( _
  125.                  System.Text.RegularExpressions.Regex.Replace(IO.File.ReadAllText(HOSTS).ToLower, "\s+|\t+", String.Empty), _
  126.                  String.Format("[^\#](127.0.0.1|::1){0}", URL.ToLower)))
  127.  
  128.    End Function
  129.  
  130.  
  131.    ''' <summary>
  132.    ''' Checks if the Hosts file exists.
  133.    ''' </summary>
  134.    Public Shared Function HOSTS_Exists() As Boolean
  135.        Return IO.File.Exists(HOSTS)
  136.    End Function
  137.  
  138.  
  139.    ''' <summary>
  140.    ''' Cleans all the mappings inside the Hosts file.
  141.    ''' </summary>
  142.    Public Shared Sub Clean_Hosts_File()
  143.        Try
  144.            IO.File.WriteAllText(HOSTS, String.Empty)
  145.        Catch ex As Exception
  146.            MsgBox(ex.Message)
  147.        End Try
  148.    End Sub
  149.  
  150.  
  151.    ' Validates an IP adress.
  152.    Private Shared Function Validate_IP(ByVal IP_Address As String) As Boolean
  153.        Dim IP As System.Net.IPAddress = Nothing
  154.        Return System.Net.IPAddress.TryParse(IP_Address, IP)
  155.    End Function
  156.  
  157. End Class
  158.  
  159. #End Region

De nada  :P
8566  Programación / Scripting / Re: wget duda batch en: 10 Agosto 2013, 20:38 pm
elektro no me sirve ese codigo por que ocupa logiar a un ftp si podrias ayudarme con este gracias o si alguien se anima gracias

¿Porque no te sirve?, si solo tienes que modificar el nombre del archivo, y la dirección FTP añadiendo el user y el pass como lo haces en el segundo ejemplo... :-/

Como ya te digo solo tienes que hacer eso xD, pero bueno, te doy una solución alternativa, si dices que es un archivo nulo entonces puedes checkar el tamaño del archivo descargado (en bytes):
Código
  1. For /F %%S in ("xd.bat") do (
  2.  
  3.    If %~zS EQU 0 then (
  4.        Goto:...
  5.    ) ELSE (
  6.        REM Hacer cosas con el archivo...
  7.    )
  8.  
  9. )

Saludos
8567  Sistemas Operativos / Windows / Re: CHKDSK me ha borrado todo AYUDAA en: 10 Agosto 2013, 13:19 pm
yo no lo creo. en más de 300 veces que lo he usado en todo tipo de discos, no ha pasado nada.

Si, he pasado el chkdsk y me ha borrado todo....

Doy fé de que un simple escaneo con CHKDSK (activando las opciones de reparación automática) eliminará cualquier archivo que no se pueda reconstruir, lo sé por propia experiencia, CHKDSK es una mierd@ de sistema del que no hay que fiarse ni un pelo, espero que en Windows 8 no siga eliminando archivos sin más.

Saludos!
8568  Informática / Hardware / Re: Ralentización máxima en la velocidad de transfernecia de un HDD en: 10 Agosto 2013, 10:56 am
Con respecto al tema del cable, este que usas lo trajo la fuente o tu se lo añadiste con una extensión o algo así?

lo trajo la fuente

El único inconveniente seria si usas discos con conexión IDE.

son todos SATA

Prueba conectado los discos en las diferentes conexiones a ver que tal te va, esos problemas puedes venir por esos Quick Format que has hecho uno tras otro...

Eso ya lo probé, varias veces xD, pero los parones en el SO no dejan de cesar... ahora mismo acabo de tener uno de unos 20 segundos, suceden sobretodo cuando tengo Firefox corriendo, es cuando más se notan y suceden con más frecuencia, pero también suceden cuando quieren dejando el SO en "Standby" sin hacer prácticamente nada.
Soy una persona que intenta probar todas las posibilidades así que ya he probado a desactivar todas las extensiones de Firefox, el plugin de AdobeFlash, e incluso a reinstalarlo eliminando mi perfil de Firefox ...pero nada, no creo que sea problema del Firefox.  

Sé que en un formateo rápido no se borra todo, pero no entiendo que tipo de conflicto puede llevar a que un disco con un formato rápido NTFS pueda ser el causante de esto, no entiendo la relación que puede haber, si el espacio "vacío" de los datos formateados luego se vuelven a reescribir cuando es necesario por el SO, por otro lado también leí hace unos años que en los formateos "normales" el disco pierde un considerable procentaje de vida, por eso las dos veces le he dado un formato rápido, pero aún así tendré en cuenta lo que me has dicho para la próxima vez que tenga que reinstalar Windows, porque ya me estoy cansando mucho de estos parones... cuando eso pase le haré un formateo lento a ver que pasa.

Saludos!
8569  Programación / .NET (C#, VB.NET, ASP) / Re: Cambiar una página por otra Visual Basic en: 10 Agosto 2013, 10:18 am
¿Puedes ser más específico?, ¿Pretendes hacerlo en tiempo de ejecución en un WebBrowser Control?, ¿O pretendes que los cambios sean permanentes en el PC con cualquier navegador?.

Para lo segundo es tán sencillo como añadir una entrada el archivo HOSTS. http://msdn.microsoft.com/en-us/library/ff749174.aspx

EDITO: Y para lo primero puedes checkar la url del control para modificarla por la que quieras.

Código
  1.    Private Sub WebBrowser1_Navigated(sender As Object, e As WebBrowserNavigatedEventArgs) _
  2.    Handles WebBrowser1.Navigated
  3.  
  4.            Select Case True
  5.  
  6.                Case sender.url.ToString.ToLower.StartsWith("http://www.google")
  7.                    sender.navigate("youtube.com")
  8.  
  9.                Case Else
  10.                    ' MsgBox(sender.url.ToString.ToLower)
  11.  
  12.            End Select
  13.  
  14.    End Sub

Saludos

8570  Programación / .NET (C#, VB.NET, ASP) / Re: Detectar tipo de teclado en: 10 Agosto 2013, 09:54 am
Siento decirte que según mis informaciones es símplemente imposible hacerlo en VBNET (al menos usando un hook de bajo nivel como haces),
es más, si quisieras hacerlo en otro lenguaje necesitarías pasar a un siguiente nivel muy superior de experiencia para escribir el hook, inyectarlo, hacerlo compatible con 64 bits, y bypassear UAC.

Intenté solucionar el mismo problema, pero mis capacidades para esto son igual de limitadas e inexpertas, te cito la respuesta a mi problema por parte de un Dios de la programación, para que lo entiendas mejor:

Cita de: Hans Passant
You can never write a correct low-level keyboard hook that translates virtual keys to typing keys. The keyboard state and the active keyboard layout are properties of the process that owns the foreground window. Never of the process that implements the hook.

In particular the keyboard state will be wrong, you don't know if the logical state of the keyboard for the process has the shift, alt, control and Windows key active. That state is recorded when the program receives a keyboard event. Particular to a keyboard layout for languages that use diacritics are the state of the dead keys, the ones you type to get the next typed letter to have an accent. This keyboard state is a per-process state and cannot be retrieved from another process. It is only discoverable within the process itself, GetKeyboardState() function. Much the same for the active keyboard layout, GetKeyboardLayout() function. The language bar allows processes to use different layouts.

It can only ever work 100% correctly when you use a WH_KEYBOARD hook. It requires a DLL that can be injected into other processes. The 3rd argument of SetWindowsHookEx(). Which ensures that GetKeyboardState and GetKeyboardLayout return accurate information. You cannot write such a DLL in VB.NET, the process you inject won't have the CLR loaded to execute managed code. A language like C, C++ or Delphi is required, languages that have very modest runtime support requirements. This is usually where the project peters out. Not just because of the runtime injection problem, debugging such code and dealing with the bitness of a process on a 64-bit operating system as well as UAC are major headaches.

You can limp along somewhat by using GetAsyncKeyState() to get the state of the modifier keys. There is no solution for dead keys other than an injected DLL. This is not a helpful answer, it merely explains why you can never make it work completely reliably in vb.net.

The mapping of Keys.Oemtilde to a typing key is the job of the keyboard layout. Different keyboards produce different letters for that key. The underlying winapi function is ToUnicodeEx(). Note how it requires the keyboard state and layout as I described.

Si quieres leer el resto: http://stackoverflow.com/questions/16893190/issue-with-the-keys-enumeration-and-a-low-level-keyboard-hook#comment24389665_16900034

EDITO: y esto por otra parte para aclarártelo aún más:

Citar
A global WH_KEYBOARD hook however executes in teh context of the app. that is recieving the keyboard message so your code has to be injected into every running process. This is NOT a good idea IMHO.

Saludos
Páginas: 1 ... 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 [857] 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 ... 1254
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines