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


  Mostrar Mensajes
Páginas: 1 ... 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 [880] 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 ... 1254
8791  Programación / .NET (C#, VB.NET, ASP) / Re: [Duda] ¿Qué cifrado es? en: 7 Julio 2013, 23:23 pm
1) Puedes decirme cómo has encontrado eso de "crypto obfuscator"? Quiero saber cómo, no puedo poner un tema por cada cosa que quiera descifrar :D

La aplicaicón "de4dot" puede detectar el tipo de ofuscación, usa el switch "-d" de esta manera:

Código:
de3dot -d "archivo"

3) ¿Cómo has descifrado el base64? Yo lo descifro y me da una cadena muy rara, ¿es puro base64 o hay más?

Te refieres al archivo, o a la cadena en Base64 de la Class que he comentado?

Imagino que te refieres al archivo de imágen, pues siento desilusionarte pero no lo he llegado a desproteger (por eso no tenía ni p**a idea de lo que era el otro archivo), tampoco me esmeré mucho en intentarlo, símplemente he llegado a la deducción de que como el programa tiene una sola imágen, pues por regla de trés el recurso de 23 kb debe ser esa imágen (por el peso del archivo y el tamaño de la imágen, y porque un programador que se toma tantas molestias también se habrá tomado la molestia de optimizar el peso de la imágen), y el otro recurso (el de 600 kb) debe ser lo que se inyecta.

5) Cómo has descifrado esa clase? Qué archivo es?

El como ya lo expliqué, lo desofuscas con el "Simple Assembly Explorer" (click derecho>desofuscar), y luego el exe desofuscado lo abres (y decompilas) donde quieras, por ejemplo en el reflector.

No recuerdo el nombre del archivo, ya eliminé la solución entera.

EDITO: Es la class que mas pesa, si las ordenas en el explorer por tamaño, la primera es.

Un saludo!
8792  Seguridad Informática / Seguridad / Re: Protección contra intrusos (DDOS) en: 7 Julio 2013, 23:03 pm
Muchas gracias por compartir tu experiencia Kub0x.

saludos!
8793  Programación / Desarrollo Web / Trucos básicos para salir en las primera páginas en el búscador de Google? en: 7 Julio 2013, 22:59 pm
¿Alguien me puede introducir en el tema?

Estoy recien empezando con una web que trata sobre un pequeño negocio, y bueno... quiero salir en el buscador de Google para captar clientes.

La web tiene un nombre muy particular, son dos palabras claves juntas, no se si eso puede ayudar. (Prefiero no decir el nombre de la web)

Si me pueden dar algún enlace de referencia para estudiar sobre los trucos básicos (y no tán básicos)...


Y si pudieran decirme si algo de esto es una buena idea para salir en el buscador de Google:

· Crear miles de dominios .TK (puedo hacerlo de hasta 12 meses de duración) con palabras clave para que salgan en google y así redireccionarlos a mi web principal.

· Añadir algún tipo de botón de esos de google, para votar por la web. (Ni idea de en que zona de Google se consigue ese script ni como se llama el maldito susodicho xD).

· Poner un Header en el Body con palabras clave (Uno de mis hermanos me dijo este truco, y lleva 30 años diseñando webs, aunque no recuerdo lo que me dijo exáctamente ni tmapoco puedo preguntarle).

No se me ocurre nada más, soy un completo newbie en el tema de administrar una web.

EDITO: He visto que en la página principal de ElHacker.net hay un botón de Google Plus, pero solo tiene "862" votos. En una web que tiene miles de visitas cada día, y sólo consigue esos pocos votos... me parece muy extraño! me gustaría saber desde cuando lleva ese botón ahi, para hacerme una idea de cuantas personas podrían votarme a lo largo de un año entero (con muy, muy pocas visitas al día)

Gracias por leer,
Saludos!
8794  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 7 Julio 2013, 21:53 pm
Validar una fecha:

Código
  1. #Region " Validate Date "
  2.  
  3.    ' [ Validate Date Function ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    ' MsgBox(Validate_Date("29-02-2013")) ' Result: False
  10.    ' MsgBox(Validate_Date("29-02-2016")) ' Result: True
  11.    ' MsgBox(Validate_Date("01/01/2014")) ' Result: True
  12.  
  13.    Private Function Validate_Date(ByVal [Date] As String) As Boolean
  14.        Return Date.TryParse([Date], New Date)
  15.    End Function
  16.  
  17. #End Region

PD: @Novlucker, sé que es muy cortito, pero útil para quien no sepa! :P
8795  Programación / .NET (C#, VB.NET, ASP) / Re: Validar fecha en C Sharp en: 7 Julio 2013, 21:20 pm
¿hay una manera mejor para lograr lo mismo?

Sí, se puede mejorar mucho.

1 - Puedes evitar la declaración de todas las variables (Ya que solo le das uso una única vez, para eso es mejor "usar" diréctamente en 1 paso, en lugar de los 3 pasos que dás: "declarar variable + almacenar contenido en variable + usar variable").
2 - En lugar de una comparación me parece más correcto añadir un control de errores (Un Try/Catch por si en un futuro quieres añadir aún más tipos de excepciones, en lugar de añadir más If's).
3 - Para la organización de los elementos del string debes usar "String.Format": http://msdn.microsoft.com/en-us/library/system.string.format.aspx
4 - Para el formato de la fecha es tán simple como usar el método "ToString" con el formato adecuado ("D"): http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx .
5 - Para el formato del string resultante, puedes usar la función "ToTitleCase", y hacer un pequeñísimo ajuste añadiendo un "Replace" para modificar "De" por "de".
En fin... en general se puede simplificar bastante el code.

Aquí tienes, en VB:

Código
  1. Imports System.Globalization
  2.  
  3. Module Module1
  4.  
  5.    Sub Main(args As String())
  6.        ValidarFecha()
  7.        Console.ReadLine()
  8.    End Sub
  9.  
  10.    Private Sub ValidarFecha()
  11.  
  12.        Console.Write("Ingrese una fecha(ej. 07-07-2013)....:")
  13.  
  14.        Try
  15.  
  16.            Console.WriteLine(CultureInfo.CurrentCulture.TextInfo.ToTitleCase( _
  17.                              String.Format("Ingresó: {0}", _
  18.                              Date.Parse(Console.ReadLine).ToString("D"))).Replace("De", "de"))
  19.  
  20.        Catch ' ex As Exception
  21.            Console.WriteLine("No es una fecha valida...")
  22.        End Try
  23.  
  24.    End Sub
  25.  
  26. End Module


En C#:
(Este me ha costado un poquito, he tenido que usar convertidor online, hacer algunas correcciones manuales, y ajustar las indentaciones innecesarias)

Código
  1.    using System;
  2.    using System.Globalization;
  3.  
  4.    static class Module1 {
  5.  
  6.       public static void Main(string[] args) {
  7.           ValidarFecha();
  8.           Console.ReadLine();
  9.       }
  10.  
  11.       private static void ValidarFecha() {
  12.  
  13.           Console.WriteLine("Ingrese una fecha (ej. 07-07-2013)...:");
  14.  
  15.           try {
  16.  
  17.               Console.WriteLine(CultureInfo.CurrentCulture.TextInfo.ToTitleCase(
  18.                                 string.Format("Ingresó: {0}",
  19.                                 DateTime.Parse(Console.ReadLine()).ToString("D"))).Replace("De", "de"));
  20.  
  21.           } catch {
  22.  
  23.               Console.WriteLine("No es una fecha valida...");
  24.  
  25.           } // Try
  26.  
  27.       } // ValidarFecha
  28.  
  29.    } // Module1


Saludos!
8796  Seguridad Informática / Seguridad / Protección contra ataques (DDOS) en: 7 Julio 2013, 19:54 pm
No se nada acerca de esto, pero me están ayudando a crear una web y...bueno, necesito protección.

La verdad es que no necesito "caching" ni porquerías, yo solo quiero que si un intruso accede muchas veces seguidas con la misma ip en un intervalo muy corto de tiempo, pues hacerle un baneo temporal a esa IP. (Si alguien puede dar información sobre como hacer esto lo agradecería)

Pero claro...si ese intruso usa bots (proxies) pues entonces el baneo temporal va a dar igual y en ese caso lo mejor sería bloquear la página temporálmente como hace Cloudfare, ¿no?.

¿Quizás CloudFare se puede configurar de alguna manera para que si solo se detecta un usuario que intenta hacer DDOS repetídamente, entonces banear a esa ip, pero si en cambio se detectan muchas ips (bots) en un intervalo corto de tiempo, entonces bloquear la web?, si algún servicio ofrece ese razonamiento de lógica...sería genial.

Mi favorito es CloudFare (tampoco conozco otros) http://www.cloudflare.com/
Comentarios: http://www.forbes.com/sites/eliseackerman/2012/02/29/how-cloudflares-free-ddos-protection-service-is-disrupting-the-multibillion-dollar-computer-security-and-content-delivery-markets/2/

8797  Programación / Programación General / Re: crear un script necesito algún editor de texto en: 7 Julio 2013, 10:53 am
En que leguaje escribo aora el código lo puedo hacer rubi por ejemplo cual sería mejor y mas rápido

Sin ánimo de ofender, pero desde que publicaste este post no has dejado de repetir esa pregunta que no tiene ningún sentido, y esto te ocurre porque aún no entiendes el concepto.

El lenguaje que vas a usar en la IDE CodeBlacks es C/C++, Ruby es otro lenguaje muy distinto, C++ es C++, y Ruby es Ruby, y para programar en otro lenguaje hay que usar otras IDEs, además, Ruby es un lenguaje de Scripting.

Por el momento has elegido programar en C++, pero nadie te va a dar hecho un generador de diccionarios, tienes que aprender a hacerlo, dices que te interesa aprender, pues en los links de arriba te puse buena información sobre como hacer permutaciones en C++, que eso es lo que tienes que buscar.

Saludos!

 
8798  Programación / .NET (C#, VB.NET, ASP) / Re: una pregunta muy basica en: 7 Julio 2013, 10:16 am
si desarrollo una aplicación de escritorio basado en .net 3.5 y el usuario tiene un framework superior, la aplicación corre lo mismo?

Eso depende bastante.

Framework 4.X difiere del 3.X, no es lo mismo, el Core es muy distinto.

Pero por suerte el Framework 4.X tiene un soporte de compatibilidad para correr casi todas las aplicaciones basadas en Framework 3.X (y 2.0) sin necesidad de que el FW 3.X esté instalado, Como he dicho tiene soporte para correrlas casi todas, PERO!... no todas, así que si dicha aplicación usa algo que sólamente dependa del FW 3.5 entonces si que necesitarás que el FW 3.5 esté instalado en dicho PC.

Lo mejor que puedes hacer es instalarte una máquina virtual con Windows 8, y comprobarlo por ti mismo, Win8 lleva FW 4.5 instalado por defecto (Y no está instalado el FW 3.5, pero incluye soporte para instalarlo por separado), así que es el mejor SO donde puedes testear tu problema.

Si es una aplicación sencilla no debería haber ningún problema, sólo tienes que hacerte esta pregunta: ¿Porque Windows 8 sólamente lleva instalado FW 4.5?, pues porque generálmente funcionarán las aplicaciones desarolladas en las versiones inferiores de FW, así que no es necesario más.

EDITO: De todas formas Microsoft siempre intenta promover el uso del FW 4.X a los desarrolladores, y yo me imagino que la razón de esto debe ser porque en un futuro no muy lejano en próximas versiones del FW Microsoft dejará de lado la compatibilidad con el FW 2.X y 3.X (Como hace Microsoft con el Windows XP), así que deberías plantearte si reálmente usar FW 3.5 o actualizar tu aplicación al uso del FW 4.0 como mínimo.

Saludos!
8799  Programación / .NET (C#, VB.NET, ASP) / Re: [Duda] ¿Qué cifrado es? en: 7 Julio 2013, 09:33 am
@Shout

Antes de nada, creo que habría sido mejor si posteases esto en Ingenieria inversa.

Al analizar el ensamblado para comprobar que ofuscador han utilizado se ve que han usado el ofuscador "Crypto obfuscator": http://www.ssware.com/cryptoobfuscator/download.htm

Para desofuscarlo es suficiente con usar "de4dot", o el "SimpleAssembly Explorer", que ya lleva integrado un plugin del "de4dot" y es muy intuitivo de usar porque se asemeja al ".NET Reflector": http://code.google.com/p/simple-assembly-explorer/

Hay dos archivos de recursos, uno es una imágen, la imágen de kenshin, el otro no se que es, pero creo que el archivo que intentas "descifrar" es un recurso que se inyecta al proceso del COD, así que no es ningún archivo de texto ni nada interesante, miagino que solo son bytes que se inyectan al proceso, aunque la verdad es que no sé mucho sobre parches e inyecciones así que tampoco me hagas mucho caso, quizás me equivoque.

Hasta aquí es hasta donde he llegado, no soy un experto en el tema.



NOTA: Los nombres están así porque según he leido es imposible recuperar los nombres originales al desofuscar, tanto los nombres de los métodos y funciones de las Classes como los nombres de los archivos de las Classes, así que esto es lo que hay y no se puede mejorar, pero al menos es entendible y legible.

Ahora te mostraré una Class desofuscada:

PD: Aquí verás el string "SW52ZXJzZSBUcm9sbGVyKg==", este es Base64 y al revertirlo la codificación devuelve el string "Inverse Troller*"
En VB:
Código
  1. Imports System
  2. Imports System.Collections.Generic
  3. Imports System.IO
  4. Imports System.Reflection
  5. Imports System.Reflection.Emit
  6. Imports System.Text
  7.  
  8. Namespace A
  9.    Friend NotInheritable Class 
  10.        ' Methods
  11.        Private Shared Function (ByVal base1 As MethodBase) As Type()
  12.            Dim typeArray As Type()
  13.            Dim num3 As Integer
  14.            Dim infoArray As ParameterInfo() = base1.GetParameters
  15.            Dim length As Integer = infoArray.Length
  16.            If base1.IsStatic Then
  17.                goto Label_002E
  18.            End If
  19.        Label_0017:
  20.            Select Case 6
  21.                Case 0
  22.                    goto Label_0017
  23.                Case Else
  24.                    If (1 = 0) Then
  25.                    End If
  26.                    length += 1
  27.                    Exit Select
  28.            End Select
  29.        Label_002E:
  30.            typeArray = New Type(length  - 1) {}
  31.            Dim index As Integer = 0
  32.            If base1.IsStatic Then
  33.                goto Label_0089
  34.            End If
  35.        Label_0041:
  36.            Select Case 5
  37.                Case 0
  38.                    goto Label_0041
  39.                Case Else
  40.                    Dim declaringType As Type = base1.DeclaringType
  41.                    If Not declaringType.IsValueType Then
  42.                        Dim type9 As Type = base1.DeclaringType
  43.                        typeArray(0) = type9
  44.                        goto Label_0085
  45.                    End If
  46.                    Exit Select
  47.            End Select
  48.        Label_005C:
  49.            Select Case 7
  50.                Case 0
  51.                    goto Label_005C
  52.                Case Else
  53.                    Dim type8 As Type = base1.DeclaringType.MakeByRefType
  54.                    typeArray(0) = type8
  55.                    Exit Select
  56.            End Select
  57.        Label_0085:
  58.            index += 1
  59.        Label_0089:
  60.            num3 = 0
  61.            Do While (num3 < infoArray.Length)
  62.                typeArray(index) = infoArray(num3).ParameterType
  63.                num3 += 1
  64.                index += 1
  65.            Loop
  66.        Label_00AD:
  67.            Select Case 2
  68.                Case 0
  69.                    goto Label_00AD
  70.            End Select
  71.            Return typeArray
  72.        End Function
  73.  
  74.        Private Shared Sub (ByRef numRef1 As Integer, ByVal info1 As DynamicILInfo)
  75.            Dim count As Integer = BitConverter.ToInt32(., numRef1)
  76.            numRef1 = (numRef1 + 4)
  77.            If (count <> 0) Then
  78.                Dim dst As Byte() = New Byte(count  - 1) {}
  79.                Buffer.BlockCopy(., numRef1, dst, 0, count)
  80.                Dim startIndex As Integer = 4
  81.                Dim num3 As Integer = ((count - 4) / &H18)
  82.                Dim i As Integer
  83.                For i = 0 To num3 - 1
  84.                    Dim num10 As Integer = BitConverter.ToInt32(dst, startIndex)
  85.                    Dim options As ExceptionHandlingClauseOptions = DirectCast(num10, ExceptionHandlingClauseOptions)
  86.                    startIndex = (startIndex + 20)
  87.                    Select Case options
  88.                        Case ExceptionHandlingClauseOptions.Clause
  89.                            Dim typeToken As Integer = BitConverter.ToInt32(dst, startIndex)
  90.                            Dim type As RuntimeTypeHandle = ..ResolveTypeHandle(typeToken)
  91.                            Dim num5 As Integer = info1.GetTokenFor(type)
  92.                            .(num5, startIndex, dst)
  93.                            Exit Select
  94.                        Case ExceptionHandlingClauseOptions.Fault
  95.                            Throw New NotSupportedException("dynamic method does not support fault clause")
  96.                    End Select
  97.                    startIndex = (startIndex + 4)
  98.                Next i
  99.            Label_00CD:
  100.                Select Case 7
  101.                    Case 0
  102.                        goto Label_00CD
  103.                End Select
  104.                info1.SetExceptions(dst)
  105.                Return
  106.            End If
  107.        Label_0018:
  108.            Select Case 5
  109.                Case 0
  110.                    goto Label_0018
  111.            End Select
  112.            If (1 = 0) Then
  113.            End If
  114.        End Sub
  115.  
  116.        Private Shared Sub (ByVal body1 As MethodBody, ByVal info1 As DynamicILInfo)
  117.            Dim helper As SignatureHelper = SignatureHelper.GetLocalVarSigHelper
  118.            Dim enumerator As IEnumerator(Of LocalVariableInfo) = body1.LocalVariables.GetEnumerator
  119.            Try
  120.                Do While enumerator.MoveNext
  121.                    Dim info As LocalVariableInfo = enumerator.Current
  122.                    Dim localType As Type = info.LocalType
  123.                    Dim isPinned As Boolean = info.IsPinned
  124.                    helper.AddArgument(localType, isPinned)
  125.                Loop
  126.            Label_0043:
  127.                Select Case 5
  128.                    Case 0
  129.                        goto Label_0043
  130.                End Select
  131.                If (1 = 0) Then
  132.                End If
  133.            Finally
  134.                If (enumerator Is Nothing) Then
  135.                    goto Label_006B
  136.                End If
  137.            Label_005B:
  138.                Select Case 6
  139.                    Case 0
  140.                        goto Label_005B
  141.                    Case Else
  142.                        enumerator.Dispose
  143.                        Exit Select
  144.                End Select
  145.            Label_006B:
  146.            End Try
  147.            Dim signature As Byte() = helper.GetSignature
  148.            info1.SetLocalSignature(signature)
  149.        End Sub
  150.  
  151.        Public Shared Sub (ByVal num2 As Integer, ByVal num1 As Integer, ByVal buffer1 As Byte())
  152.            buffer1(num1++) = CByte(num2)
  153.            buffer1(num1++) = CByte((num2 >> 8))
  154.            buffer1(num1++) = CByte((num2 >> &H10))
  155.            buffer1(num1++) = CByte((num2 >> &H18))
  156.        End Sub
  157.  
  158.        Private Shared Sub (ByRef numRef1 As Integer, ByVal base1 As MethodBase, ByVal info1 As DynamicILInfo)
  159.            Dim maxStackSize As Integer = BitConverter.ToInt32(., numRef1)
  160.            numRef1 = (numRef1 + 4)
  161.            Dim count As Integer = BitConverter.ToInt32(., numRef1)
  162.            numRef1 = (numRef1 + 4)
  163.            Dim dst As Byte() = New Byte(count  - 1) {}
  164.            Buffer.BlockCopy(., numRef1, dst, 0, count)
  165.            New (base1, dst, info1).
  166.            info1.SetCode(dst, maxStackSize)
  167.            numRef1 = (numRef1 + count)
  168.        End Sub
  169.  
  170.        Friend Shared Sub (ByVal num1 As Integer, ByVal num3 As Integer, ByVal num4 As Integer)
  171.            Dim type As Type
  172.            Dim base2 As MethodBase
  173.            Try
  174.                Dim handle As RuntimeTypeHandle = ..ResolveTypeHandle(num1)
  175.                type = Type.GetTypeFromHandle(handle)
  176.                Dim handle7 As RuntimeMethodHandle = ..ResolveMethodHandle(num3)
  177.                Dim declaringType As RuntimeTypeHandle = ..ResolveTypeHandle(num4)
  178.                Dim methodFromHandle As MethodBase = MethodBase.GetMethodFromHandle(handle7, declaringType)
  179.                Dim obj2 As Object = methodFromHandle
  180.                base2 = DirectCast(obj2, MethodBase)
  181.            Catch exception3 As Exception
  182.                Throw
  183.            End Try
  184.            Dim fields As FieldInfo() = type.GetFields((BindingFlags.GetField Or (BindingFlags.NonPublic Or BindingFlags.Static)))
  185.            Dim info As FieldInfo
  186.            For Each info In fields
  187.                Try
  188.                    Dim type8 As Type
  189.                    Dim num As Integer
  190.                    Dim expressionStack_D5_0 As String
  191.                    Dim expressionStack_B3_0 As String
  192.                    Dim expressionStack_D6_0 As Object
  193.                    Dim expressionStack_D6_1 As String
  194.                    Dim expressionStack_C6_0 As String
  195.                    Dim method As DynamicMethod = Nothing
  196.                    Dim body As MethodBody = base2.GetMethodBody
  197.                    Dim parameterTypes As Type() = .(base2)
  198.                    Dim type6 As Type = base2.DeclaringType
  199.                    Dim fullName As String = type6.FullName
  200.                    Dim name As String = base2.Name
  201.                    Dim text6 As String = (fullName & "." & name & "_Encrypted$")
  202.                    If TypeOf base2 Is ConstructorInfo Then
  203.                        expressionStack_D5_0 = text6
  204.                        goto Label_00D5
  205.                    Else
  206.                        expressionStack_B3_0 = text6
  207.                    End If
  208.                Label_00B3:
  209.                    Select Case 6
  210.                        Case 0
  211.                            goto Label_00B3
  212.                        Case Else
  213.                            Dim expressionStack_C0_0 As String
  214.                            Dim expressionStack_BD_0 As String = expressionStack_B3_0
  215.                            If (1 <> 0) Then
  216.                                expressionStack_C6_0 = expressionStack_BD_0
  217.                                Exit Select
  218.                            Else
  219.                                expressionStack_C0_0 = expressionStack_BD_0
  220.                            End If
  221.                            expressionStack_C6_0 = expressionStack_C0_0
  222.                            Exit Select
  223.                    End Select
  224.                    Dim returnType As Type = DirectCast(base2, MethodInfo).ReturnType
  225.                    If (returnType OrElse True) Then
  226.                        expressionStack_D6_1 = expressionStack_C6_0
  227.                        expressionStack_D6_0 = returnType
  228.                        goto Label_00D6
  229.                    Else
  230.                        expressionStack_D5_0 = CStr(returnType)
  231.                    End If
  232.                    expressionStack_D5_0 = expressionStack_C6_0
  233.                Label_00D5:
  234.                    expressionStack_D6_1 = expressionStack_D5_0
  235.                    expressionStack_D6_0 = Nothing
  236.                Label_00D6:
  237.                    type8 = base2.DeclaringType
  238.                    method = New DynamicMethod(expressionStack_D6_1, DirectCast(expressionStack_D6_0, Type), parameterTypes, type8, True)
  239.                    Dim flag2 As Boolean = ..TryGetValue(num1, num)
  240.                    Dim info2 As DynamicILInfo = method.GetDynamicILInfo
  241.                    .(body, info2)
  242.                    .(num, base2, info2)
  243.                    .(num, info2)
  244.                    Dim delegate2 As Delegate = method.CreateDelegate(type)
  245.                    info.SetValue(Nothing, delegate2)
  246.                Catch exception4 As Exception
  247.                End Try
  248.            Next
  249.        Label_014A:
  250.            Select Case 6
  251.                Case 0
  252.                    goto Label_014A
  253.            End Select
  254.        End Sub
  255.  
  256.        Shared Sub New()
  257.            Dim type2 As Type
  258.            If (Not . Is Nothing) Then
  259.                goto Label_00D8
  260.            End If
  261.        Label_000A:
  262.            Select Case 5
  263.                Case 0
  264.                    goto Label_000A
  265.                Case Else
  266.                    If (1 = 0) Then
  267.                    End If
  268.                    Dim s As String = "SW52ZXJzZSBUcm9sbGVyKg=="
  269.                    Dim bytes As Byte() = Convert.FromBase64String(s)
  270.                    s = Encoding.UTF8.GetString(bytes, 0, bytes.Length)
  271.                    Dim stream As Stream = Assembly.GetExecutingAssembly.GetManifestResourceStream(s)
  272.                    Dim buffer4 As Byte() = .(&H61, stream)
  273.                    . = buffer4
  274.                    . = New Dictionary(Of Integer, Integer)
  275.                    Dim reader As New BinaryReader(New MemoryStream(., False))
  276.                    Try
  277.                        Dim num As Integer = reader.ReadInt32
  278.                        Dim i As Integer
  279.                        For i = 0 To num - 1
  280.                            Dim num3 As Integer = reader.ReadInt32
  281.                            Dim num4 As Integer = reader.ReadInt32
  282.                            ..Item(num3) = num4
  283.                        Next i
  284.                    Label_00B8:
  285.                        Select Case 5
  286.                            Case 0
  287.                                goto Label_00B8
  288.                        End Select
  289.                    Finally
  290.                        If (reader Is Nothing) Then
  291.                            goto Label_00D7
  292.                        End If
  293.                    Label_00C7:
  294.                        Select Case 4
  295.                            Case 0
  296.                                goto Label_00C7
  297.                            Case Else
  298.                                reader.Dispose
  299.                                Exit Select
  300.                        End Select
  301.                    Label_00D7:
  302.                    End Try
  303.                    Exit Select
  304.            End Select
  305.        Label_00D8:
  306.            type2 = GetType(MulticastDelegate)
  307.            If (type2 Is Nothing) Then
  308.                Return
  309.            End If
  310.        Label_00E6:
  311.            Select Case 5
  312.                Case 0
  313.                    goto Label_00E6
  314.                Case Else
  315.                    Dim modules As Module() = Assembly.GetExecutingAssembly.GetModules
  316.                    Dim moduleHandle As ModuleHandle = modules(0).ModuleHandle
  317.                    . = moduleHandle
  318.                    Exit Select
  319.            End Select
  320.        End Sub
  321.  
  322.  
  323.        ' Fields
  324.        Friend Shared ReadOnly  As Byte()
  325.        Friend Shared ReadOnly  As Dictionary(Of Integer, Integer)
  326.        Private Shared ReadOnly  As ModuleHandle
  327.  
  328.        ' Nested Types
  329.        Public NotInheritable Class 
  330.            ' Methods
  331.            Private Function () As Byte
  332.                Return Me.(Me.++)
  333.            End Function
  334.  
  335.            Private Function () As Integer
  336.                Dim startIndex As Integer = Me.
  337.                Me. = (Me. + 4)
  338.                Return BitConverter.ToInt32(Me., startIndex)
  339.            End Function
  340.  
  341.            Private Function () As Object
  342.                Dim num48 As Integer
  343.                Dim info2 As MemberInfo
  344.                Dim base3 As MethodBase
  345.                Dim num As Integer = Me.
  346.                Dim nop As OpCode = OpCodes.Nop
  347.                Dim metadataToken As Integer = 0
  348.                Dim index As Byte = Me.
  349.                If (index = &HFE) Then
  350.                    index = Me.
  351.                    nop = .(index)
  352.                    goto Label_0060
  353.                End If
  354.            Label_0020:
  355.                Select Case 6
  356.                    Case 0
  357.                        goto Label_0020
  358.                    Case Else
  359.                        If (1 = 0) Then
  360.                        End If
  361.                        nop = .(index)
  362.                        Exit Select
  363.                End Select
  364.            Label_0060:
  365.                Select Case nop.OperandType
  366.                    Case OperandType.InlineBrTarget
  367.                        Me.(4)
  368.                        Return Nothing
  369.                    Case OperandType.InlineField
  370.                        metadataToken = Me.
  371.                        Dim info As FieldInfo = Me..ResolveField(metadataToken, Me., Me.)
  372.                        Dim fieldHandle As RuntimeFieldHandle = info.FieldHandle
  373.                        Dim num39 As Integer = Me..GetTokenFor(fieldHandle)
  374.                        Dim size As Integer = nop.Size
  375.                        Me.(num39, (num + size))
  376.                        Return Nothing
  377.                    Case OperandType.InlineI
  378.                        Me.(4)
  379.                        Return Nothing
  380.                    Case OperandType.InlineI8
  381.                        Me.(8)
  382.                        Return Nothing
  383.                    Case OperandType.InlineMethod
  384.                        metadataToken = Me.
  385.                        Dim base2 As MethodBase = Me..ResolveMethod(metadataToken, Me., Me.)
  386.                        Dim method As RuntimeMethodHandle = base2.MethodHandle
  387.                        Dim type9 As Type = base2.DeclaringType
  388.                        Dim handle10 As RuntimeTypeHandle = type9.TypeHandle
  389.                        Dim num36 As Integer = Me..GetTokenFor(method, handle10)
  390.                        Dim num37 As Integer = nop.Size
  391.                        Me.(num36, (num + num37))
  392.                        Return Nothing
  393.                    Case OperandType.InlineNone
  394.                        Return Nothing
  395.                    Case OperandType.InlineR
  396.                        Me.(8)
  397.                        Return Nothing
  398.                    Case OperandType.InlineSig
  399.                        metadataToken = Me.
  400.                        Dim signature As Byte() = Me..ResolveSignature(metadataToken)
  401.                        Dim num33 As Integer = Me..GetTokenFor(signature)
  402.                        Dim num34 As Integer = nop.Size
  403.                        Me.(num33, (num + num34))
  404.                        Return Nothing
  405.                    Case OperandType.InlineString
  406.                        metadataToken = Me.
  407.                        Dim literal As String = Me..ResolveString(metadataToken)
  408.                        Dim num30 As Integer = Me..GetTokenFor(literal)
  409.                        Dim num31 As Integer = nop.Size
  410.                        Me.(num30, (num + num31))
  411.                        Return Nothing
  412.                    Case OperandType.InlineSwitch
  413.                        Dim num4 As Integer = Me.
  414.                        Me.((num4 * 4))
  415.                        Return Nothing
  416.                    Case OperandType.InlineTok
  417.                        metadataToken = Me.
  418.                        info2 = Me..ResolveMember(metadataToken, Me., Me.)
  419.                        If (info2.MemberType = MemberTypes.TypeInfo) Then
  420.                            Exit Select
  421.                        End If
  422.                    Label_02B0:
  423.                        Select Case 6
  424.                            Case 0
  425.                                goto Label_02B0
  426.                            Case Else
  427.                                If (info2.MemberType <> MemberTypes.NestedType) Then
  428.                                    If (info2.MemberType = MemberTypes.Method) Then
  429.                                        goto Label_0325
  430.                                    End If
  431.                                Label_0305:
  432.                                    Select Case 7
  433.                                        Case 0
  434.                                            goto Label_0305
  435.                                        Case Else
  436.                                            If (info2.MemberType <> MemberTypes.Constructor) Then
  437.                                                If (info2.MemberType <> MemberTypes.Field) Then
  438.                                                    goto Label_038D
  439.                                                End If
  440.                                            Label_0363:
  441.                                                Select Case 4
  442.                                                    Case 0
  443.                                                        goto Label_0363
  444.                                                End Select
  445.                                                Dim info3 As FieldInfo = TryCast(info2,FieldInfo)
  446.                                                Dim field As RuntimeFieldHandle = info3.FieldHandle
  447.                                                metadataToken = Me..GetTokenFor(field)
  448.                                                goto Label_038D
  449.                                            End If
  450.                                            Exit Select
  451.                                    End Select
  452.                                Label_031B:
  453.                                    Select Case 3
  454.                                        Case 0
  455.                                            goto Label_031B
  456.                                    End Select
  457.                                    goto Label_0325
  458.                                End If
  459.                                Exit Select
  460.                        End Select
  461.                    Label_02CA:
  462.                        Select Case 7
  463.                            Case 0
  464.                                goto Label_02CA
  465.                        End Select
  466.                        Exit Select
  467.                    Case OperandType.InlineType
  468.                        metadataToken = Me.
  469.                        Dim type As Type = Me..ResolveType(metadataToken, Me., Me.)
  470.                        Dim handle12 As RuntimeTypeHandle = type.TypeHandle
  471.                        Dim num42 As Integer = Me..GetTokenFor(handle12)
  472.                        Dim num43 As Integer = nop.Size
  473.                        Me.(num42, (num + num43))
  474.                        Return Nothing
  475.                    Case OperandType.InlineVar
  476.                        Me.(2)
  477.                        Return Nothing
  478.                    Case OperandType.ShortInlineBrTarget
  479.                        Me.(1)
  480.                        Return Nothing
  481.                    Case OperandType.ShortInlineI
  482.                        Me.(1)
  483.                        Return Nothing
  484.                    Case OperandType.ShortInlineR
  485.                        Me.(4)
  486.                        Return Nothing
  487.                    Case OperandType.ShortInlineVar
  488.                        Me.(1)
  489.                        Return Nothing
  490.                    Case Else
  491.                        Dim operandType As OperandType = nop.OperandType
  492.                        Dim message As String = ("unexpected OperandType " & operandType)
  493.                        Throw New BadImageFormatException(message)
  494.                End Select
  495.                Dim type2 As Type = TryCast(info2,Type)
  496.                Dim typeHandle As RuntimeTypeHandle = type2.TypeHandle
  497.                metadataToken = Me..GetTokenFor(typeHandle)
  498.                goto Label_038D
  499.            Label_0325:
  500.                base3 = TryCast(info2,MethodBase)
  501.                Dim methodHandle As RuntimeMethodHandle = base3.MethodHandle
  502.                Dim declaringType As Type = base3.DeclaringType
  503.                Dim contextType As RuntimeTypeHandle = declaringType.TypeHandle
  504.                metadataToken = Me..GetTokenFor(methodHandle, contextType)
  505.            Label_038D:
  506.                num48 = nop.Size
  507.                Me.(metadataToken, (num + num48))
  508.                Return Nothing
  509.            End Function
  510.  
  511.            Friend Sub ()
  512.                Do While (Me. < Me..Length)
  513.                    Dim obj2 As Object = Me.
  514.                Loop
  515.            Label_001B:
  516.                Select Case 6
  517.                    Case 0
  518.                        goto Label_001B
  519.                End Select
  520.                If (1 = 0) Then
  521.                End If
  522.            End Sub
  523.  
  524.            Private Sub (ByVal num1 As Integer)
  525.                Me. = (Me. + num1)
  526.            End Sub
  527.  
  528.            Private Sub (ByVal num2 As Integer, ByVal num1 As Integer)
  529.                Me.(num1++) = CByte(num2)
  530.                Me.(num1++) = CByte((num2 >> 8))
  531.                Me.(num1++) = CByte((num2 >> &H10))
  532.                Me.(num1++) = CByte((num2 >> &H18))
  533.            End Sub
  534.  
  535.            Shared Sub New()
  536.                Dim fields As FieldInfo() = GetType(OpCodes).GetFields((BindingFlags.Public Or BindingFlags.Static))
  537.                Dim info As FieldInfo
  538.                For Each info In fields
  539.                    Dim obj2 As Object = info.GetValue(Nothing)
  540.                    Dim code As OpCode = DirectCast(obj2, OpCode)
  541.                    Dim num3 As Short = code.Value
  542.                    Dim index As UInt16 = CUShort(num3)
  543.                    If (index >= &H100) Then
  544.                        goto Label_0089
  545.                    End If
  546.                Label_0063:
  547.                    Select Case 3
  548.                        Case 0
  549.                            goto Label_0063
  550.                        Case Else
  551.                            If (1 = 0) Then
  552.                            End If
  553.                            .(index) = code
  554.                            Continue
  555.                    End Select
  556.                Label_0089:
  557.                    If ((index And &HFF00) <> &HFE00) Then
  558.                        Continue For
  559.                    End If
  560.                Label_0097:
  561.                    Select Case 7
  562.                        Case 0
  563.                            goto Label_0097
  564.                        Case Else
  565.                            .((index And &HFF)) = code
  566.                            Exit Select
  567.                    End Select
  568.                Next
  569.            Label_00C8:
  570.                Select Case 3
  571.                    Case 0
  572.                        goto Label_00C8
  573.                End Select
  574.            End Sub
  575.  
  576.            Public Sub New(ByVal base1 As MethodBase, ByVal buffer1 As Byte(), ByVal info1 As DynamicILInfo)
  577.                ' This item is obfuscated and can not be translated.
  578.                Dim typeArray2 As Type()
  579.                Dim genericArguments As Type()
  580.                Me. = info1
  581.                Me. = buffer1
  582.                Me. = 0
  583.                Dim module As Module = base1.Module
  584.                Me. = [module]
  585.                If TypeOf base1 Is ConstructorInfo Then
  586.                    goto Label_0050
  587.                End If
  588.            Label_0032:
  589.                Select Case 4
  590.                    Case 0
  591.                        goto Label_0032
  592.                    Case Else
  593.                        If (1 <> 0) Then
  594.                            goto Label_0045
  595.                        End If
  596.                        genericArguments = base1.GetGenericArguments
  597.                        If (genericArguments OrElse True) Then
  598.                        End If
  599.                        Exit Select
  600.                End Select
  601.            Label_0050:
  602.                genericArguments. = Nothing
  603.                If (base1.DeclaringType Is Nothing) Then
  604.                    goto Label_007C
  605.                End If
  606.            Label_0060:
  607.                Select Case 7
  608.                    Case 0
  609.                        goto Label_0060
  610.                    Case Else
  611.                        typeArray2 = base1.DeclaringType.GetGenericArguments
  612.                        If (typeArray2 OrElse True) Then
  613.                        End If
  614.                        Exit Select
  615.                End Select
  616.            Label_007C:
  617.                typeArray2. = Nothing
  618.            End Sub
  619.  
  620.  
  621.            ' Fields
  622.            Private  As Byte()
  623.            Private  As Integer
  624.            Private  As DynamicILInfo
  625.            Private  As Module
  626.            Private Shared  As OpCode() = New OpCode(&H100  - 1) {}
  627.            Private  As Type()
  628.            Private Shared  As OpCode() = New OpCode(&H100  - 1) {}
  629.            Private  As Type()
  630.        End Class
  631.    End Class
  632. End Namespace
  633.  
  634.  

Si quieres ver el resto, bueno, ya te he dicho como hacerlo.

Saludos
8800  Programación / Programación General / Re: crear un script necesito algún editor de texto en: 7 Julio 2013, 08:19 am
@ElSevi

Si te llevas mal con el inglés te vas a llevar mal con la programación.

No se nada de C/C++ pero aparte de lo comentado por el compañero OmarHack, debes empezar a buscar información y snippets sobre el tipo de proyecto que quieres llevar a cabo:

-> Write a C program to print all permutations of a given string

-> http://bit.ly/1a2Mxvx


PD: He movido el tema porque esto ha cambiado de rumbo del scripting y se ha hablado de vb, de C y de su p* madre xD.

Páginas: 1 ... 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 [880] 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 ... 1254
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines