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


Tema destacado: Introducción a la Factorización De Semiprimos (RSA)


  Mostrar Mensajes
Páginas: 1 ... 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 [866] 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 ... 1254
8651  Programación / .NET (C#, VB.NET, ASP) / Re: Microsoft.Jet.OLEDB.4.0 en: 30 Julio 2013, 21:40 pm
Prueba a registrar las dll.

-> regsvr32

8652  Programación / .NET (C#, VB.NET, ASP) / Re: Recibir comandos en el formulario por línea de comando en: 29 Julio 2013, 19:56 pm
Los argumentos los puedes encontrar almacenados aquí: My.Application.CommandLineArgs

Ejemplo:
Código
  1.    ' Loop through all the command line arguments given.
  2.    For I As Integer = 0 To My.Application.CommandLineArgs.Count - 1
  3.        ' If an argument equals "/m"
  4.        If My.Application.CommandLineArgs.Item(I).ToLower = "/m" Then
  5.            MsgBox("You have used /m")
  6.        Else ' If it doesn't equal "/m"
  7.            MsgBox("Incorrect CMD Argument.")
  8.        End If
  9.    Next

Si estás usando un WinForm y quieres recibir argumentos puedes hacer dos cosas:
1. Setear el proyecto como "ConsoleApp", lo cual adjuntará una molesta ventana del a CMD cada vez que inicies tu app.
2. Adjuntar una instancia de la consola manualmente si tu proyecto es llamado desde la CMD.

Código
  1.    Declare Function AttachConsole Lib "kernel32.dll" (ByVal dwProcessId As Int32) As Boolean
  2.    Declare Function FreeConsole Lib "kernel32.dll" () As Boolean
  3.  
  4.    AttachConsole(-1) ' Attach the console
  5.    System.Console.Writeline("I am writing from a WinForm to the console!")
  6.    FreeConsole() ' Desattach the console

Para saber si tu aplicación se ha llamado desde la consola puedes hacer esto:

Código
  1. #Region " App Is Launched From CMD? "
  2.  
  3.    ' [ App Is Launched From CMD? Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples:
  8.    ' MsgBox(App_Is_Launched_From_CMD)
  9.    ' If App_Is_Launched_From_CMD() Then Console.WriteLine("Help for this application: ...")
  10.  
  11.    Declare Function AttachConsole Lib "kernel32.dll" (ByVal dwProcessId As Int32) As Boolean
  12.    Declare Function FreeConsole Lib "kernel32.dll" () As Boolean
  13.  
  14.    Private Function App_Is_Launched_From_CMD() As Boolean
  15.        If AttachConsole(-1) Then
  16.            FreeConsole()
  17.            Return True
  18.        Else
  19.            Return False
  20.        End If
  21.    End Function
  22.  
  23. #End Region

Saludos...
8653  Programación / .NET (C#, VB.NET, ASP) / Re: Localizar pixel de cierto color dentro de la pantalla en: 28 Julio 2013, 15:11 pm
creo que electro ya hizo "algo asi" , cuanto tenga en tiempo hago lo mismo en delphi.

Hola Doddy,
si, creo que te refieres a esto: [SOURCE] Color.NET Autor: EleKtro H@cker

Un saludo!
8654  Programación / .NET (C#, VB.NET, ASP) / Re: Localizar pixel de cierto color dentro de la pantalla en: 27 Julio 2013, 19:37 pm
Si me dieseis algún ejemplo o Snippet de como hacerlo os lo agradecería.


¿Quieres un masaje también nukes?,
todos los dias con el mismo cuento de copiar y pegar, lee un poco para variar:



1er Método:

-> Bitmap Class: Bitmap Constructor(Screen.Bounds) + GetPixel function(Color.FromArgb)



2do Método:

-> Bitmap Class: Bitmap Constructor(Screen.Bounds) + BitmapData(Bitmap.LockBits + Bitmap.UnlockBits)

8655  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 27 Julio 2013, 11:07 am
Comprobar si un archivo es un archivo de registro válido (version 5.0)

Código
  1. #Region " Is Registry File "
  2.  
  3.    ' [ Is Registry File Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(IsRegFile("C:\RegistryFile.reg"))
  9.  
  10.    ' IsRegistryFile
  11.    Private Function IsRegFile(ByVal RegistryFile As String) As Boolean
  12.  
  13.        Dim Regedit_Signature As String = "windows registry editor version 5.00"
  14.        Return IO.File.ReadAllText(RegistryFile).ToLower.Trim.StartsWith(Regedit_Signature)
  15.  
  16.    End Function
  17.  
  18. #End Region





El núcleo de mi programa REG2BAT, mejorado para soportar caracteres inválidos por Batch (para escaparlos)

Código
  1.    #Region " Reg2Bat "
  2.  
  3.       ' [ Reg2Bat Function ]
  4.       '
  5.       ' // By Elektro H@cker
  6.       '
  7.       ' Examples :
  8.       ' MsgBox(Reg2Bat("C:\Registry.reg"))
  9.  
  10.    Public Enum REG2BAT_Format As Int16
  11.        BINARY = 1
  12.        DWORD = 2
  13.        QWORD = 3
  14.        EXPAND_SZ = 4
  15.        MULTI_SZ = 5
  16.        REG_SZ = 0
  17.    End Enum
  18.  
  19.    ' Reg2Bat
  20.    Private Function Reg2Bat(ByVal Reg_File As String) As String
  21.  
  22.        ' Source Input
  23.        ' Join he lines, delete the Regedit linebreaks characters: "\  ", and then split the lines.
  24.        Dim RegFile() As String = Split( _
  25.                                  String.Join("@@@Reg2Bat@@@", IO.File.ReadAllLines(Reg_File)) _
  26.                                  .Replace("\@@@Reg2Bat@@@  ", "") _
  27.                                  .Replace("@@@Reg2Bat@@@", Environment.NewLine), _
  28.                                  Environment.NewLine)
  29.  
  30.        Dim RegLine As String = String.Empty ' Where the Regedit Line will be stored.
  31.        Dim RegKey As String = String.Empty ' Where the Regedit Key will be stored.
  32.        Dim RegVal As String = String.Empty ' Where the Regedit Value will be stored.
  33.        Dim RegData As String = String.Empty ' Where the Regedit Data will be stored.
  34.  
  35.        Dim Batch_Commands As String = String.Empty ' Where the decoded Regedit strings will be stored.
  36.  
  37.        Batch_Commands &= ":: Converted with REG2BAT by Elektro H@cker"
  38.        Batch_Commands &= Environment.NewLine & Environment.NewLine
  39.        Batch_Commands &= "@Echo OFF"
  40.        Batch_Commands &= Environment.NewLine & Environment.NewLine
  41.  
  42.        ' Start reading the Regedit File
  43.        For X As Int64 = 0 To RegFile.LongLength - 1
  44.  
  45.            RegLine = RegFile(X).Trim
  46.  
  47.            Select Case True
  48.  
  49.                Case RegLine.StartsWith(";") ' Comment line
  50.  
  51.                    Batch_Commands &= Environment.NewLine
  52.                    Batch_Commands &= String.Format("REM {0}", RegLine.Substring(1, RegLine.Length - 1).Trim)
  53.                    Batch_Commands &= Environment.NewLine
  54.  
  55.                Case RegLine.StartsWith("[-") ' Key to delete
  56.  
  57.                    RegKey = RegLine.Substring(2, RegLine.Length - 3).Trim
  58.                    Batch_Commands &= String.Format("REG DELETE ""{0}"" /F", RegKey)
  59.                    Batch_Commands &= Environment.NewLine
  60.  
  61.                Case RegLine.StartsWith("[") ' Key to add
  62.  
  63.                    RegKey = RegLine.Substring(1, RegLine.Length - 2).Trim
  64.                    Batch_Commands &= String.Format("REG ADD ""{0}"" /F", RegKey)
  65.                    Batch_Commands &= Environment.NewLine
  66.  
  67.                Case RegLine.StartsWith("@=") ' Default Value to add
  68.  
  69.                    RegData = Split(RegLine, "@=", , CompareMethod.Text).Last
  70.                    Batch_Commands &= String.Format("REG ADD ""{0}"" /V  """" /D {1} /F", RegKey, RegData)
  71.                    Batch_Commands &= Environment.NewLine
  72.  
  73.                Case RegLine.StartsWith("""") _
  74.                AndAlso RegLine.Split("=").Last = "-"  ' Value to delete
  75.  
  76.                    RegVal = RegLine.Substring(1, RegLine.Length - 4)
  77.                    Batch_Commands &= String.Format("REG DELETE ""{0}"" /V ""{1}"" /F", RegKey, RegVal)
  78.                    Batch_Commands &= Environment.NewLine
  79.  
  80.                Case RegLine.StartsWith("""") ' Value to add
  81.  
  82.                    ' Check data type:
  83.                    Select Case RegLine.Split("=")(1).Split(":")(0).ToLower
  84.  
  85.                        Case "hex" ' Binary
  86.  
  87.                            RegVal = Format_Regedit_String(Get_Regedit_Value(RegLine, REG2BAT_Format.BINARY))
  88.                            RegData = Get_Regedit_Data(RegLine, REG2BAT_Format.BINARY)
  89.                            Batch_Commands &= String.Format("REG ADD ""{0}"" /V ""{1}"" /T ""REG_BINARY"" /D ""{2}"" /F", RegKey, RegVal, RegData)
  90.                            Batch_Commands &= Environment.NewLine
  91.  
  92.                        Case "dword" ' DWORD (32 bit)
  93.  
  94.                            RegVal = Format_Regedit_String(Get_Regedit_Value(RegLine, REG2BAT_Format.DWORD))
  95.                            RegData = Get_Regedit_Data(RegLine, REG2BAT_Format.DWORD)
  96.                            Batch_Commands &= String.Format("REG ADD ""{0}"" /V ""{1}"" /T ""REG_DWORD"" /D ""{2}"" /F", RegKey, RegVal, RegData)
  97.                            Batch_Commands &= Environment.NewLine
  98.  
  99.                        Case "hex(b)" ' QWORD (64 bIT)
  100.  
  101.                            RegVal = Format_Regedit_String(Get_Regedit_Value(RegLine, REG2BAT_Format.QWORD))
  102.                            RegData = Get_Regedit_Data(RegLine, REG2BAT_Format.QWORD)
  103.                            Batch_Commands &= String.Format("REG ADD ""{0}"" /V ""{1}"" /T ""REG_QWORD"" /D ""{2}"" /F", RegKey, RegVal, RegData)
  104.                            Batch_Commands &= Environment.NewLine
  105.  
  106.                        Case "hex(2)"  ' EXPAND SZ
  107.  
  108.                            RegVal = Format_Regedit_String(Get_Regedit_Value(RegLine, REG2BAT_Format.EXPAND_SZ))
  109.                            RegData = Format_Regedit_String(Get_Regedit_Data(RegLine, REG2BAT_Format.EXPAND_SZ))
  110.                            Batch_Commands &= String.Format("REG ADD ""{0}"" /V ""{1}"" /T ""REG_EXPAND_SZ"" /D ""{2}"" /F", RegKey, RegVal, RegData)
  111.                            Batch_Commands &= Environment.NewLine
  112.  
  113.                        Case "hex(7)" ' MULTI SZ
  114.  
  115.                            RegVal = Format_Regedit_String(Get_Regedit_Value(RegLine, REG2BAT_Format.MULTI_SZ))
  116.                            RegData = Format_Regedit_String(Get_Regedit_Data(RegLine, REG2BAT_Format.MULTI_SZ))
  117.                            Batch_Commands &= String.Format("REG ADD ""{0}"" /V ""{1}"" /T ""REG_MULTI_SZ"" /D ""{2}"" /F", RegKey, RegVal, RegData)
  118.                            Batch_Commands &= Environment.NewLine
  119.  
  120.                        Case Else ' REG SZ
  121.  
  122.                            RegVal = Format_Regedit_String(Get_Regedit_Value(RegLine, REG2BAT_Format.REG_SZ))
  123.                            RegData = Format_Regedit_String(Get_Regedit_Data(RegLine, REG2BAT_Format.REG_SZ))
  124.                            Batch_Commands &= String.Format("REG ADD ""{0}"" /V ""{1}"" /T ""REG_SZ"" /D ""{2}"" /F", RegKey, RegVal, RegData)
  125.                            Batch_Commands &= Environment.NewLine
  126.  
  127.                    End Select
  128.  
  129.            End Select
  130.  
  131.        Next
  132.  
  133.        Return Batch_Commands
  134.  
  135.    End Function
  136.  
  137.    ' Get Regedit Value
  138.    Private Function Get_Regedit_Value(ByVal Line As String, ByVal REG2BAT_Format As REG2BAT_Format) As String
  139.  
  140.        Dim str As String = Nothing
  141.  
  142.        Select Case REG2BAT_Format
  143.  
  144.            Case REG2BAT_Format.BINARY : str = Split(Line, "=hex:", , CompareMethod.Text).First
  145.            Case REG2BAT_Format.DWORD : str = Split(Line, "=dword:", , CompareMethod.Text).First
  146.            Case REG2BAT_Format.QWORD : str = Split(Line, "=hex(b):", , CompareMethod.Text).First
  147.            Case REG2BAT_Format.EXPAND_SZ : str = Split(Line, "=Hex(2):", , CompareMethod.Text).First
  148.            Case REG2BAT_Format.MULTI_SZ : str = Split(Line, "=Hex(7):", , CompareMethod.Text).First
  149.            Case REG2BAT_Format.REG_SZ : str = Split(Line, """=""", , CompareMethod.Text).First
  150.            Case Else : Return Nothing
  151.  
  152.        End Select
  153.  
  154.        If str.StartsWith("""") Then str = str.Substring(1, str.Length - 1)
  155.        If str.EndsWith("""") Then str = str.Substring(0, str.Length - 1)
  156.        Return str
  157.  
  158.    End Function
  159.  
  160.    ' Get Regedit Data
  161.    Private Function Get_Regedit_Data(ByVal Line As String, ByVal REG2BAT_Format As REG2BAT_Format) As String
  162.  
  163.        Dim Data As String = Nothing
  164.  
  165.        Select Case REG2BAT_Format
  166.  
  167.            Case REG2BAT_Format.BINARY
  168.                Return Split(Line, (Split(Line, "=hex:", , CompareMethod.Text).First & "=hex:"), , CompareMethod.Text).Last.Replace(",", "")
  169.  
  170.            Case REG2BAT_Format.DWORD
  171.                Return "0x" & Split(Line, (Split(Line, "=dword:", , CompareMethod.Text).First & "=dword:"), , CompareMethod.Text).Last.Replace(",", "")
  172.  
  173.            Case REG2BAT_Format.QWORD
  174.                Line = StrReverse(Split(Line, (Split(Line, "=hex(b):", , CompareMethod.Text).First & "=hex(b):"), , CompareMethod.Text).Last.Replace(",", ""))
  175.                For Each [byte] In Line.Split(",") : Data &= StrReverse([byte]) : Next
  176.                Return Data
  177.  
  178.            Case REG2BAT_Format.EXPAND_SZ
  179.                Line = Split(Line, (Split(Line, "=Hex(2):", , CompareMethod.Text).First & "=hex(2):"), , CompareMethod.Text).Last.Replace(",00", "").Replace("00,", "")
  180.                For Each [byte] In Line.Split(",") : Data &= Chr(Val("&H" & [byte])) : Next
  181.                Return Data.Replace("""", "\""")
  182.  
  183.            Case REG2BAT_Format.MULTI_SZ
  184.  
  185.                Line = Split(Line, (Split(Line, "=Hex(7):", , CompareMethod.Text)(0) & "=hex(7):"), , CompareMethod.Text).Last.Replace(",00,00,00", ",\0").Replace(",00", "").Replace("00,", "")
  186.  
  187.                For Each [byte] In Line.Split(",")
  188.  
  189.                    If [byte] = "\0" Then
  190.                        Data &= "\0" ' Line separator for multiline.
  191.                    Else
  192.                        Data &= Chr(Val("&H" & [byte]))
  193.                    End If
  194.  
  195.                Next
  196.  
  197.                Return Data.Replace("""", "\""")
  198.  
  199.            Case REG2BAT_Format.REG_SZ
  200.                Data = Split(Line, (Split(Line, """=""", , CompareMethod.Text)(0) & """="""), , CompareMethod.Text).Last
  201.                Data = Data.Substring(0, Data.Length - 1)
  202.                Return Data
  203.  
  204.            Case Else
  205.                Return Nothing
  206.  
  207.        End Select
  208.  
  209.    End Function
  210.  
  211.    ' Format Regedit String
  212.    Private Function Format_Regedit_String(ByVal str As String) As String
  213.  
  214.        str = str.Replace("%", "%%")
  215.        If Not str.Contains("""") Then Return str
  216.  
  217.        str = str.Replace("\""", """")
  218.  
  219.        Dim strArray() As String = str.Split("""")
  220.  
  221.        For num As Long = 1 To strArray.Length - 1 Step 2
  222.  
  223.            strArray(num) = strArray(num).Replace("^", "^^") ' This replace need to be THE FIRST.
  224.            strArray(num) = strArray(num).Replace("<", "^<")
  225.            strArray(num) = strArray(num).Replace(">", "^>")
  226.            strArray(num) = strArray(num).Replace("|", "^|")
  227.            strArray(num) = strArray(num).Replace("&", "^&")
  228.            ' strArray(num) = strArray(num).Replace("\", "\\")
  229.  
  230.        Next
  231.  
  232.        Return String.Join("\""", strArray)
  233.  
  234.    End Function
  235.  
  236.    #End Region
8656  Programación / .NET (C#, VB.NET, ASP) / Re: Cifrar de forma segura una Pass en el Source en: 26 Julio 2013, 19:19 pm
De alguna forma todo lo que se compila se debe poder descompilar para ser procesado por el engine del framework, sinó la app no se podría leer/ejecutar.
PD: Iba a pasarte un enlace sobre esto, era muy interesante, pero hace ya tiempo que me documenté y no recuerdo el enlace.

Lo que comentas del .NET Reflector, es inevitable, .NET Reflector no es un super programa que craquea las aplicaciones, no, es solo es una GUI para el reflector, otro ejemplo será el "simple assembly Explorer", deberías leer sobre el término "Reflection" para entenderlo mejor.

Con esto te quiero decir que... como es inevitable yo no perdería mucho el tiempo a la hora de buscar la protección perfecta, porque no existe, el mejor cracker siempre va a poder averiguar tus credenciales si se propone el reto.

No soy un experto en el tema de la ingenieria inversa, pero aquí va mi consejo:

Si estás tán convencido de querer usar tus credenciales pues, lo que te recomiendo es que añadas una protección mínima dentro del proyecto para las credenciales, por ejemplo usar algún tipo de hash como MD5 para tu contraseña, y luego, después de esa protección mínima, usar algún software profesional para proteger tu proyecto como por ejemplo "Crypto Obfuscator" o "Smart Assembly", por más códigos que encuentres con intención de hacer copy&paste para proteger tu app ninguno va a ser tán eficaz como este tipo de aplicaciones profesionales, que además de ofuscar, encriptan y comprimen, todo a niveles extremos ...tanto que si no lo usas bien podrías corromper el executable (pero siempre puedes volver a intentarlo usando niveles más bajos de protección :P).

Saludos...
8657  Programación / .NET (C#, VB.NET, ASP) / VisualStudio me ha creado la misma GUID para 2 aplicaciones distintas! en: 26 Julio 2013, 19:04 pm
Hola.

He hecho dos aplicaciones distintas, las dos son single-instance, y a la hora de intentar ejecutarlas al mismo tiempo no he podido.

No quería creermelo pero lo que sucedia parecia ser muy obvio así que lo primero que se me ha ocurrido es ir a las propiedades de los proyectos para comprobar si las GUIDS eran iguales, y ...efectívamente!! las dos aplicaciones tenian la misma GUID, toma ya!



¿Como es esto posible?

Las dos aplicaciones han sido creadas desde cero, quiero decir que no he copiado archivos sueltos de un proyecto a otro, y además son diferentes en todo menos en los recursos de imágenes utilizados, algunas subrutinas, y el nombre de la Class principal.

No entiendo como ha pasado esto.

Me gustaría que alguien me explicase que motivos pueden causar que VS use la misma GUID para dos aplicaciones complétamente distintas.

Un saludo!
8658  Programación / .NET (C#, VB.NET, ASP) / Re: Comprimir proceso en la RAM en: 26 Julio 2013, 01:22 am
tengo pensado hacer que cada 200 contactos la app se renicie y libere la memoria acumulada y siga con el proceso. :P

. . .

Parece que lo que te digan no sirve para nada, déjate de chorradas de reiniciar procesos o comprimir kiwis en la RAM,
lee de nuevo el comentario de Kubox, porque como último recurso no necesitas más, lee acerca de la class "GC" (garbage collector) http://msdn.microsoft.com/en-us/library/system.gc%28v=vs.80%29.aspx

...Encima ayer te pasé un código por privado, por skype, incluso te di instrucciones, era un snippet, y era muy eficaz, ¿Lo has intentado usar?.

Saludos...
8659  Programación / Scripting / Re: alguna forma de reconocer sistema operativo en: 26 Julio 2013, 01:15 am
Código
  1. wmic os get name | More 1+

PD: Para separar el nombre puedes aprender a hacerlo tu mismo con Variable Substring o  For /F, es fácil.

Saludos
8660  Programación / .NET (C#, VB.NET, ASP) / Re: Buscando un Identificador para cada CPU en: 25 Julio 2013, 18:46 pm
Gracias EleKtro, però cual es de los 400 que listas???

En el primer post, tienes un link de descarga con todos los snippets, en la carpeta "Hardware" están esos dos que te dije

Citar
400 Snippets: http://elektrostudios.tk/Snippets.zip
(Incluye todos los snippets publicados por mi en este hilo.)
Páginas: 1 ... 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 [866] 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 ... 1254
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines