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

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Ingeniería Inversa (Moderadores: karmany, .:UND3R:., MCKSys Argentina)
| | |-+  VB .Net decompilado, necesito quedarme con un trozo de codigo en el EXE.
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: VB .Net decompilado, necesito quedarme con un trozo de codigo en el EXE.  (Leído 2,680 veces)
olevlove

Desconectado Desconectado

Mensajes: 11


Ver Perfil
VB .Net decompilado, necesito quedarme con un trozo de codigo en el EXE.
« en: 15 Mayo 2010, 20:09 pm »

Tengo un Problema. por favor, ¿Puede alguien ayudarme?
He decompilado un programa en .Net y sólo quiero que funcione estas 2 lineas en el form_load.
   
Código
  1. ucVEarth1.HTMLLocation = "C:\?" + rec_path.Text + "VirtualEarth.html?"
  2. xtraTabControl1.SelectedTabPageIndex = &HB
  3.  

He intentado hacerlo pero siempre borro mas de lo necesario y me da error.
El cambio quiero realizarlo en el EXE, es decir, con un editor Hexadecimal cambiar los valores.

Este es el codigo VB .Net:
Código
  1. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
  2.    Dim flag1 As Boolean = False
  3.    Dim s1 As String = System.String.Empty
  4.    Dim flag2 As Boolean = Not license.ValidateLicenseAtStartup(System.String.Empty, ByRef flag1, ByRef s1)
  5.    If Not flag2 Then
  6.        GoTo label_0
  7.    End If
  8.    DisplayLicenseForm()
  9.    Close()
  10.    Try
  11.        Dim textReader1 As System.IO.TextReader = New System.IO.StreamReader("C:\?" + rec_path.Text + "monitor.XML?")
  12.        Dim i1 As Integer = 2
  13.        Dim sArr1 As String() = New string(i1) {}
  14.        Dim i2 As Integer = 1
  15.        While flag2
  16.            sArr1(i2) = textReader1.ReadLine()
  17.            i2 = i2 + 1
  18.            flag2 = i2 < i1
  19.        End While
  20.        textReader1.Close()
  21.        flag2 = (sArr1(1)) Is Nothing
  22.        If flag2 Then
  23.            GoTo label_0
  24.        End If
  25.        comboBoxEdit1.Text = sArr1(1)
  26.        Try
  27.            ucVEarth1.HTMLLocation = "C:\?" + rec_path.Text + "VirtualEarth.html?"
  28.        Catch
  29.        End Try
  30.    Catch
  31.        System.Windows.Forms.MessageBox.Show("Problem reading Monitor Number?", "Contact support@simtouch.eu?", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand)
  32.    End Try
  33.    xtraTabControl1.SelectedTabPageIndex = &HB
  34. End Sub
Este es el codigo Decompilado:
Código
  1. .method private hidebysig instance void  Form1_Load(object sender,
  2.                                                    class [mscorlib]System.EventArgs e) cil managed
  3. // SIG: 20 02 01 1C 12 25
  4. {
  5.  // Method begins at RVA 0xe4c4
  6.  // Code size       265 (0x109)
  7.  .maxstack  4
  8.  .locals init (bool V_0,
  9.           string V_1,
  10.           class [mscorlib]System.IO.TextReader V_2,
  11.           int32 V_3,
  12.           string[] V_4,
  13.           int32 V_5,
  14.           bool V_6)
  15.  IL_0000:  /* 00   |                  */ nop
  16.  IL_0001:  /* 16   |                  */ ldc.i4.0
  17.  IL_0002:  /* 0A   |                  */ stloc.0
  18.  IL_0003:  /* 7E   | (0A)00008F       */ ldsfld     string [mscorlib]System.String::Empty
  19.  IL_0008:  /* 0B   |                  */ stloc.1
  20.  IL_0009:  /* 02   |                  */ ldarg.0
  21.  IL_000a:  /* 7B   | (04)0000E3       */ ldfld      class SimTouch_Screen.LicenseValidator SimTouch_Screen.Form1::license
  22.  IL_000f:  /* 7E   | (0A)00008F       */ ldsfld     string [mscorlib]System.String::Empty
  23.  IL_0014:  /* 12   | 00               */ ldloca.s   V_0
  24.  IL_0016:  /* 12   | 01               */ ldloca.s   V_1
  25.  IL_0018:  /* 6F   | (06)00019D       */ callvirt   instance bool SimTouch_Screen.LicenseValidator::ValidateLicenseAtStartup(string,
  26.                                                                                                                              bool&,
  27.                                                                                                                              string&)
  28.  IL_001d:  /* 16   |                  */ ldc.i4.0
  29.  IL_001e:  /* FE01 |                  */ ceq
  30.  IL_0020:  /* 13   | 06               */ stloc.s    V_6
  31.  IL_0022:  /* 11   | 06               */ ldloc.s    V_6
  32.  IL_0024:  /* 2D   | 04               */ brtrue.s   IL_002a
  33.  IL_0026:  /* 00   |                  */ nop
  34.  IL_0027:  /* 00   |                  */ nop
  35.  IL_0028:  /* 2B   | 10               */ br.s       IL_003a
  36.  IL_002a:  /* 00   |                  */ nop
  37.  IL_002b:  /* 02   |                  */ ldarg.0
  38.  IL_002c:  /* 28   | (06)0003BF       */ call       instance void SimTouch_Screen.Form1::DisplayLicenseForm()
  39.  IL_0031:  /* 00   |                  */ nop
  40.  IL_0032:  /* 02   |                  */ ldarg.0
  41.  IL_0033:  /* 28   | (0A)000096       */ call       instance void [System.Windows.Forms]System.Windows.Forms.Form::Close()
  42.  IL_0038:  /* 00   |                  */ nop
  43.  IL_0039:  /* 00   |                  */ nop
  44.  .try
  45.  {
  46.    IL_003a:  /* 00   |                  */ nop
  47.    IL_003b:  /* 72   | (70)003F6F       */ ldstr      "C:\\"
  48.    IL_0040:  /* 02   |                  */ ldarg.0
  49.    IL_0041:  /* 7B   | (04)00038D       */ ldfld      class [System.Windows.Forms]System.Windows.Forms.Label SimTouch_Screen.Form1::rec_path
  50.    IL_0046:  /* 6F   | (0A)000090       */ callvirt   instance string [System.Windows.Forms]System.Windows.Forms.Control::get_Text()
  51.    IL_004b:  /* 72   | (70)00403D       */ ldstr      "monitor.XML"
  52.    IL_0050:  /* 28   | (0A)000095       */ call       string [mscorlib]System.String::Concat(string,
  53.                                                                                              string,
  54.                                                                                              string)
  55.    IL_0055:  /* 73   | (0A)000156       */ newobj     instance void [mscorlib]System.IO.StreamReader::.ctor(string)
  56.    IL_005a:  /* 0C   |                  */ stloc.2
  57.    IL_005b:  /* 18   |                  */ ldc.i4.2
  58.    IL_005c:  /* 0D   |                  */ stloc.3
  59.    IL_005d:  /* 09   |                  */ ldloc.3
  60.    IL_005e:  /* 8D   | (01)00006D       */ newarr     [mscorlib]System.String
  61.    IL_0063:  /* 13   | 04               */ stloc.s    V_4
  62.    IL_0065:  /* 17   |                  */ ldc.i4.1
  63.    IL_0066:  /* 13   | 05               */ stloc.s    V_5
  64.    IL_0068:  /* 2B   | 13               */ br.s       IL_007d
  65.    IL_006a:  /* 00   |                  */ nop
  66.    IL_006b:  /* 11   | 04               */ ldloc.s    V_4
  67.    IL_006d:  /* 11   | 05               */ ldloc.s    V_5
  68.    IL_006f:  /* 08   |                  */ ldloc.2
  69.    IL_0070:  /* 6F   | (0A)000157       */ callvirt   instance string [mscorlib]System.IO.TextReader::ReadLine()
  70.    IL_0075:  /* A2   |                  */ stelem.ref
  71.    IL_0076:  /* 00   |                  */ nop
  72.    IL_0077:  /* 11   | 05               */ ldloc.s    V_5
  73.    IL_0079:  /* 17   |                  */ ldc.i4.1
  74.    IL_007a:  /* 58   |                  */ add
  75.    IL_007b:  /* 13   | 05               */ stloc.s    V_5
  76.    IL_007d:  /* 11   | 05               */ ldloc.s    V_5
  77.    IL_007f:  /* 09   |                  */ ldloc.3
  78.    IL_0080:  /* FE04 |                  */ clt
  79.    IL_0082:  /* 13   | 06               */ stloc.s    V_6
  80.    IL_0084:  /* 11   | 06               */ ldloc.s    V_6
  81.    IL_0086:  /* 2D   | E2               */ brtrue.s   IL_006a
  82.    IL_0088:  /* 08   |                  */ ldloc.2
  83.    IL_0089:  /* 6F   | (0A)000158       */ callvirt   instance void [mscorlib]System.IO.TextReader::Close()
  84.    IL_008e:  /* 00   |                  */ nop
  85.    IL_008f:  /* 11   | 04               */ ldloc.s    V_4
  86.    IL_0091:  /* 17   |                  */ ldc.i4.1
  87.    IL_0092:  /* 9A   |                  */ ldelem.ref
  88.    IL_0093:  /* 14   |                  */ ldnull
  89.    IL_0094:  /* FE01 |                  */ ceq
  90.    IL_0096:  /* 13   | 06               */ stloc.s    V_6
  91.    IL_0098:  /* 11   | 06               */ ldloc.s    V_6
  92.    IL_009a:  /* 2D   | 12               */ brtrue.s   IL_00ae
  93.    IL_009c:  /* 00   |                  */ nop
  94.    IL_009d:  /* 02   |                  */ ldarg.0
  95.    IL_009e:  /* 7B   | (04)000308       */ ldfld      class ['DevExpress.XtraEditors.v8.3']DevExpress.XtraEditors.ComboBoxEdit SimTouch_Screen.Form1::comboBoxEdit1
  96.    IL_00a3:  /* 11   | 04               */ ldloc.s    V_4
  97.    IL_00a5:  /* 17   |                  */ ldc.i4.1
  98.    IL_00a6:  /* 9A   |                  */ ldelem.ref
  99.    IL_00a7:  /* 6F   | (0A)00008E       */ callvirt   instance void [System.Windows.Forms]System.Windows.Forms.Control::set_Text(string)
  100.    IL_00ac:  /* 00   |                  */ nop
  101.    IL_00ad:  /* 00   |                  */ nop
  102.    .try
  103.    {
  104.      IL_00ae:  /* 00   |                  */ nop
  105.      IL_00af:  /* 02   |                  */ ldarg.0
  106.      IL_00b0:  /* 7B   | (04)0001DE       */ ldfld      class [VEarth]VEarth.ucVEarth SimTouch_Screen.Form1::ucVEarth1
  107.      IL_00b5:  /* 72   | (70)003F6F       */ ldstr      "C:\\"
  108.      IL_00ba:  /* 02   |                  */ ldarg.0
  109.      IL_00bb:  /* 7B   | (04)00038D       */ ldfld      class [System.Windows.Forms]System.Windows.Forms.Label SimTouch_Screen.Form1::rec_path
  110.      IL_00c0:  /* 6F   | (0A)000090       */ callvirt   instance string [System.Windows.Forms]System.Windows.Forms.Control::get_Text()
  111.      IL_00c5:  /* 72   | (70)004055       */ ldstr      "VirtualEarth.html"
  112.      IL_00ca:  /* 28   | (0A)000095       */ call       string [mscorlib]System.String::Concat(string,
  113.                                                                                                string,
  114.                                                                                                string)
  115.      IL_00cf:  /* 6F   | (0A)000159       */ callvirt   instance void [VEarth]VEarth.ucVEarth::set_HTMLLocation(string)
  116.      IL_00d4:  /* 00   |                  */ nop
  117.      IL_00d5:  /* 00   |                  */ nop
  118.      IL_00d6:  /* DE   | 05               */ leave.s    IL_00dd
  119.    }  // end .try
  120.    catch [mscorlib]System.Object
  121.    {
  122.      IL_00d8:  /* 26   |                  */ pop
  123.      IL_00d9:  /* 00   |                  */ nop
  124.      IL_00da:  /* 00   |                  */ nop
  125.      IL_00db:  /* DE   | 00               */ leave.s    IL_00dd
  126.    }  // end handler
  127.    // HEX: 00 00 00 00 AE 00 00 00 2A 00 00 00 D8 00 00 00 05 00 00 00 02 00 00 01
  128.    IL_00dd:  /* 00   |                  */ nop
  129.    IL_00de:  /* 00   |                  */ nop
  130.    IL_00df:  /* DE   | 18               */ leave.s    IL_00f9
  131.  }  // end .try
  132.  catch [mscorlib]System.Object
  133.  {
  134.    IL_00e1:  /* 26   |                  */ pop
  135.    IL_00e2:  /* 00   |                  */ nop
  136.    IL_00e3:  /* 72   | (70)004079       */ ldstr      "Problem reading Monitor Number"
  137.    IL_00e8:  /* 72   | (70)0040B7       */ ldstr      "Contact support@simtouch.eu"
  138.    IL_00ed:  /* 16   |                  */ ldc.i4.0
  139.    IL_00ee:  /* 1F   | 10               */ ldc.i4.s   16
  140.    IL_00f0:  /* 28   | (0A)00015A       */ call       valuetype [System.Windows.Forms]System.Windows.Forms.DialogResult [System.Windows.Forms]System.Windows.Forms.MessageBox::Show(string,
  141.                                                                                                                                                                                     string,
  142.                                                                                                                                                                                     valuetype [System.Windows.Forms]System.Windows.Forms.MessageBoxButtons,
  143.                                                                                                                                                                                     valuetype [System.Windows.Forms]System.Windows.Forms.MessageBoxIcon)
  144.    IL_00f5:  /* 26   |                  */ pop
  145.    IL_00f6:  /* 00   |                  */ nop
  146.    IL_00f7:  /* DE   | 00               */ leave.s    IL_00f9
  147.  }  // end handler
  148.  // HEX: 00 00 00 00 3A 00 00 00 A7 00 00 00 E1 00 00 00 18 00 00 00 02 00 00 01
  149.  IL_00f9:  /* 00   |                  */ nop
  150.  IL_00fa:  /* 02   |                  */ ldarg.0
  151.  IL_00fb:  /* 7B   | (04)00010A       */ ldfld      class ['DevExpress.XtraEditors.v8.3']DevExpress.XtraTab.XtraTabControl SimTouch_Screen.Form1::xtraTabControl1
  152.  IL_0100:  /* 1F   | 0B               */ ldc.i4.s   11
  153.  IL_0102:  /* 6F   | (0A)00015B       */ callvirt   instance void ['DevExpress.XtraEditors.v8.3']DevExpress.XtraTab.XtraTabControl::set_SelectedTabPageIndex(int32)
  154.  IL_0107:  /* 00   |                  */ nop
  155.  IL_0108:  /* 2A   |                  */ ret
  156. } // end of method Form1::Form1_Load
  157.  

Este es el codigo Hexadecimal del fichero EXE:
Código
  1. Offset    0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F   Ascii
  2.  
  3. 0000C6C0  02 00 00 01 1B 30 04 00 09 01 00 00 39 00 00 11  ..0....9..
  4. 0000C6D0  00 16 0A 7E 8F 00 00 0A 0B 02 7B E3 00 00 04 7E  ..~... {ã..~
  5. 0000C6E0  8F 00 00 0A 12 00 12 01 6F 9D 01 00 06 16 FE 01  ....o.þ
  6. 0000C6F0  13 06 11 06 2D 04 00 00 2B 10 00 02 28 BF 03 00  -..+.(¿.
  7. 0000C700  06 00 02 28 96 00 00 0A 00 00 00 72 6F 3F 00 70  .(......ro?.p
  8. 0000C710  02 7B 8D 03 00 04 6F 90 00 00 0A 72 3D 40 00 70  {.o...r=@.p
  9. 0000C720  28 95 00 00 0A 73 56 01 00 0A 0C 18 0D 09 8D 6D  (...sV..
  10. 0000C730  00 00 01 13 04 17 13 05 2B 13 00 11 04 11 05 08  ..+.
  11. 0000C740  6F 57 01 00 0A A2 00 11 05 17 58 13 05 11 05 09  oW..¢.X.
  12. 0000C750  FE 04 13 06 11 06 2D E2 08 6F 58 01 00 0A 00 11  þ-âoX...
  13. 0000C760  04 17 9A 14 FE 01 13 06 11 06 2D 12 00 02 7B 08  šþ-.{
  14. 0000C770  03 00 04 11 04 17 9A 6F 8E 00 00 0A 00 00 00 02  .šoŽ......
  15. 0000C780  7B DE 01 00 04 72 6F 3F 00 70 02 7B 8D 03 00 04  {Þ.ro?.p{.
  16. 0000C790  6F 90 00 00 0A 72 55 40 00 70 28 95 00 00 0A 6F  o...rU@.p(...o
  17. 0000C7A0  59 01 00 0A 00 00 DE 05 26 00 00 DE 00 00 00 DE  Y....Þ&..Þ...Þ
  18. 0000C7B0  18 26 00 72 79 40 00 70 72 B7 40 00 70 16 1F 10  &.ry@.pr·@.p
  19. 0000C7C0  28 5A 01 00 0A 26 00 DE 00 00 02 7B 0A 01 00 04  (Z..&.Þ..{..
  20. 0000C7D0  1F 0B 6F 5B 01 00 0A 00 2A 00 00 00 01 1C 00 00   o[...*.....
  21.  
En línea

MCKSys Argentina
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.465


Diviértete crackeando, que para eso estamos!


Ver Perfil
Re: VB .Net decompilado, necesito quedarme con un trozo de codigo en el EXE.
« Respuesta #1 en: 15 Mayo 2010, 20:55 pm »

Podrias poner un salto incondicional (jmp) a las instrucciones para asi ejecutar sólo lo que quieres.

Seria algo asi:
Código:
IL_0000    2B AC    br.s    IL_00ae
-- aqui va el codigo original

Creo que el valor AC es correcto (172 bytes) pero verifícalo por las dudas.

No he probado este código, pero es una idea... :P

Saludos!
En línea

MCKSys Argentina

"Si piensas que algo está bien sólo porque todo el mundo lo cree, no estás pensando."

olevlove

Desconectado Desconectado

Mensajes: 11


Ver Perfil
Re: VB .Net decompilado, necesito quedarme con un trozo de codigo en el EXE.
« Respuesta #2 en: 15 Mayo 2010, 21:06 pm »

Perfecto!!!!!
Me diste la Idea!!!!, con el salto voy directamente a donde quiero :)

Muchísimas gracias.
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[HECHO] Ayuda modificar código MSIL decompilado. El método está localizado
Ingeniería Inversa
JuDelCo 4 3,892 Último mensaje 7 Enero 2011, 16:36 pm
por rdzlcs
Quedarme solo con algunos decimales.
Programación C/C++
astinx 3 2,629 Último mensaje 7 Abril 2012, 20:19 pm
por david_BS
Reconstruir este trozo de código en java
Java
Tuplado 6 3,069 Último mensaje 16 Octubre 2012, 19:23 pm
por sapito169
Pregunta trozo código ensamblador de malware
Análisis y Diseño de Malware
orApic 6 3,187 Último mensaje 19 Junio 2017, 17:44 pm
por orApic
Ayuda con este trozo de código
Programación C/C++
valrojo 2 1,979 Último mensaje 16 Noviembre 2019, 10:20 am
por valrojo
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines