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

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  [Duda] ¿Qué cifrado es?
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Duda] ¿Qué cifrado es?  (Leído 4,642 veces)
Shout

Desconectado Desconectado

Mensajes: 191


Acid


Ver Perfil
[Duda] ¿Qué cifrado es?
« en: 7 Julio 2013, 00:52 am »

-


« Última modificación: 8 Octubre 2016, 02:25 am por Shout » En línea

I'll bring you death and pestilence, I'll bring you down on my own
SγиtαxEяяoя

Desconectado Desconectado

Mensajes: 154


Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #1 en: 7 Julio 2013, 06:01 am »

Creo que hay mismo lo dice que es C# o no ?


En línea

Eleкtro
Ex-Staff
*
Conectado Conectado

Mensajes: 9.813



Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #2 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
« Última modificación: 7 Julio 2013, 10:09 am por EleKtro H@cker » En línea

Shout

Desconectado Desconectado

Mensajes: 191


Acid


Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #3 en: 7 Julio 2013, 22:50 pm »

.
« Última modificación: 8 Octubre 2016, 02:26 am por Shout » En línea

I'll bring you death and pestilence, I'll bring you down on my own
Eleкtro
Ex-Staff
*
Conectado Conectado

Mensajes: 9.813



Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #4 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!
« Última modificación: 7 Julio 2013, 23:27 pm por EleKtro H@cker » En línea

Shout

Desconectado Desconectado

Mensajes: 191


Acid


Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #5 en: 8 Julio 2013, 00:09 am »

Muchas gracias!

Pero me sale esto:
Código
  1. //  Microsoft (R) .NET Framework IL Disassembler.  Version 3.5.30729.1
  2. //  (c) Microsoft Corporation. Reservados todos los derechos.
  3.  
  4. Módulo protegido: no se puede desensamblar
  5.  

¿Qué puedo hacer para saltarme la restricción? He leído que hay que "nullear" un byte, pero realmente no sé cuál es. Te agradecería si me dijeses qué proceso hay que seguir para encontrarlo, o al menos alguna pista.


Edito
Se me ha olvidado preguntar: el .exe es un .exe que espera a que un proceso se abra y le inyecta un .dll. ¿Hay alguna manera de "sniffear" lo que el programa envía al juego y así obtener el DLL sin tener que descifrar todo?
En línea

I'll bring you death and pestilence, I'll bring you down on my own
Eleкtro
Ex-Staff
*
Conectado Conectado

Mensajes: 9.813



Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #6 en: 8 Julio 2013, 00:21 am »

¿Qué puedo hacer para saltarme la restricción? He leído que hay que "nullear" un byte, pero realmente no sé cuál es. Te agradecería si me dijeses qué proceso hay que seguir para encontrarlo, o al menos alguna pista.

Yo ya no puedo ayudarte más, mis conocimientos sobre el reversing llega hasta aquí.

PD: Pero tienes que nullear todos los bytes de los ops, lo leí en algún tutorial hace tiempo.

¿Hay alguna manera de "sniffear" lo que el programa envía al juego y así obtener el DLL sin tener que descifrar todo?

La dll desprotegida pasa diréctamente por un stream de la memória, supongo que ese stream lo podrás capturar y guardarlo, pero ni idea de como, quizás con el Ollydbg será muy fácil de hacer (para quien sepa hacerlo).

Lo que si te puedo decir con toda seguridad es que un simple Base64 no es, aparte de la ofuscacion de los strings, los recursos están encryptados y además comprimidos, así que... ahí hay tarea para desprotegerlo.

Si quieres llegar hasta el fondo del asunto, o esperas un milagro de una repsuesta de un Pro, o quizás tengas más suerte si le preguntas al desarrollador del ofuscador en persona:

http://stackoverflow.com/users/51919/logicnp
http://www.ssware.com/support.htm

Un saludo.
« Última modificación: 8 Julio 2013, 00:27 am por EleKtro H@cker » En línea

SγиtαxEяяoя

Desconectado Desconectado

Mensajes: 154


Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #7 en: 8 Julio 2013, 05:18 am »

@SγиtαxEяяoя odio cuando la gente no lee la pregunta. El proyecto C# ya lo he descifrado, lo que me hace falta son los archivos que están cifrados (no compilados) dentro del mismo.

:huh: :huh: lo siento, igual tambien odio cosas y personas pero no vale amargarse la vida por ellas ;) Enserio he leido todo el post y no veo que hallas dicho que es C# solo esto "_.cs" nada mas, es evidente  :-[ pero bueno soy un novato apenas estoy empezando uno trata de ayudar en lo que puede y solo recibes un odio  :( pff no vengo aqui hacer amistades
En línea

Eleкtro
Ex-Staff
*
Conectado Conectado

Mensajes: 9.813



Ver Perfil
Re: [Duda] ¿Qué cifrado es?
« Respuesta #8 en: 8 Julio 2013, 07:59 am »

@SγиtαxEяяoя

La pregunta trata sobre métodos de encryptación e ingeniería inversa, pero tu soltaste la frase de: "eso es C#", fue un poco chistoso xD, creo que dijiste lo primero que se te pasó por la cabeza sin entender la pregunta y el problema, pero con intención de ayudar ...eso es lo que cuenta.

...A todos nos ha pasado, no hay que sofocarse. ;)

Saludos
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Duda Cifrado de disco
Seguridad
n3w 2 2,586 Último mensaje 17 Enero 2011, 13:58 pm
por n3w
ayuda en duda con mysql cifrado
Criptografía
kkshihack 0 3,213 Último mensaje 11 Febrero 2011, 23:10 pm
por kkshihack
DUDA: cifrado de contraseña
Nivel Web
thedevilini 3 2,761 Último mensaje 22 Diciembre 2015, 19:32 pm
por Shell Root
[DUDA] String cifrado
Criptografía
REEND 4 4,660 Último mensaje 16 Mayo 2016, 17:09 pm
por REEND
duda con cifrado
Seguridad
General Dmitry Vergadoski 5 2,830 Último mensaje 23 Diciembre 2019, 05:01 am
por engel lex
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines