Сейчас на форуме: vsv1, NIKOLA, r0lka, johnniewalker (+4 невидимых)

 eXeL@B —› Крэки, обсуждения —› Деобфускация .net
Посл.ответ Сообщение

Ранг: 0.1 (гость)
Активность: 0=0
Статус: Участник

Создано: 25 сентября 2019 18:32
· Личное сообщение · #1

Решил разреверсить одно приложение. Так как de4dot не справляется, решил сделать вручную.
Расшифровал код, восстановил класс Program.
Споткнулся о конструкции вида
Code:
  1. for (;;)
  2.                         {
  3.                               IL_2B1C:
  4.                               uint num13 = 3535402907u;
  5.                               for (;;)
  6.                               {
  7.                                    uint num2;
  8.                                    switch ((num2 = (num13 ^ 3082938982u)) % 45u)
  9.                                    {
  10.                                    case 0u:
  11.                                        num13 = (num2 * 2692934266u ^ 1921240084u);
  12.                                        continue;
  13.                                    case 1u:
  14.                                        MessageBox.Show(<Module>.smethod_36<string>(3749894506u), <Module>.smethod_36<string>(3668073065u));
  15.                                        num13 = (num2 * 580020653u ^ 1309406797u);
  16.                                        continue;
  17.                                    case 2u:
  18.                                        this.notifyIcon_0.ShowBalloonTip(5000, <Module>.smethod_36<string>(985062527u), <Module>.smethod_34<string>(4023471989u) + this.int_25 + <Module>.smethod_34<string>(3980432990u), ToolTipIcon.Info);
  19.                                        MessageBox.Show(<Module>.smethod_33<string>(4100543861u));
  20.                                        this.int_20++;
  21.                                        num13 = (num2 * 4142395835u ^ 2889234218u);
  22.                                        continue;
  23.                                    case 3u:
  24.                                        num13 = (num2 * 71515459u ^ 879798017u);
  25.                                        continue;
  26.                                    case 4u:
  27.                                        this.richTextBox_0.Text = string.Concat(new object[]
  28.                                        {
  29.                                           <Module>.smethod_35<string>(1150715081u),
  30.                                           DateTime.Now,
  31.                                           <Module>.smethod_34<string>(3849373754u),
  32.                                           this.int_25,
  33.                                           <Module>.smethod_34<string>(2160597432u),
  34.                                           this.richTextBox_0.Text
  35.                                        });
  36.                                        num13 = (num2 * 1588386516u ^ 1652649048u);
  37.                                        continue;
  38.                                    case 5u:
  39.                                        num13 = 3257770860u;
  40.                                        continue;
  41.                                    case 6u:
  42.                                        this.bool_1 = true;
  43.                                        num13 = (num2 * 2703624519u ^ 637681122u);
  44.                                        continue;
  45.                                    case 7u:
  46.                                    {
  47.                                        bool flag16 = Class23.smethod_13(this.int_25);
  48.                                        num13 = (num2 * 1575687266u ^ 3771363000u);
  49.                                        continue;
  50.                                    }
  51.                                    case 8u:
  52.                                        num13 = (num2 * 814370016u ^ 1124631258u);
  53.                                        continue;
  54.                                    case 9u:
  55.                                        this.bool_11 = true;
  56.                                        num13 = (num2 * 2608258140u ^ 4034719729u);
  57.                                        continue;
  58.                                    case 10u:
  59.                                        num13 = (((!Class23.smethod_13(this.int_25)) ? 3421919986u : 3716977549u) ^ num2 * 1990168806u);
  60.                                        continue;
  61.                                    case 11u:
  62.                                        num13 = (num2 * 3080698099u ^ 2767214099u);
  63.                                        continue;
  64.                                    case 12u:
  65.                                        this.bool_1 = true;
  66.                                        this.streamWriter_1.WriteLine(string.Concat(new object[]
  67.                                        {
  68.                                           <Module>.smethod_36<string>(2351365830u),
  69.                                           DateTime.Now,
  70.                                           <Module>.smethod_33<string>(2407032824u),
  71.                                           this.int_25,
  72.                                           <Module>.smethod_36<string>(4124544019u)
  73.                                        }));
  74.                                        num13 = (num2 * 3462032328u ^ 4058823532u);
  75.                                        continue;
  76.                                    case 13u:
  77.                                        num13 = 2228345086u;
  78.                                        continue;
  79.                                    case 14u:
  80.                                    {
  81.                                        bool flag16;
  82.                                        num13 = ((flag16 ? 1383839631u : 16370222u) ^ num2 * 761381830u);
  83.                                        continue;
  84.                                    }
  85.                                    case 15u:
  86.                                        num13 = (((this.streamWriter_1 != null) ? 3771441818u : 2378349683u) ^ num2 * 4102670886u);
  87.                                        continue;
  88.                                    case 16u:
  89.                                        this.bool_6 = true;
  90.                                        num13 = (num2 * 2616661043u ^ 1046695861u);
  91.                                        continue;
  92.                                    case 17u:
  93.                                        num13 = 2150199592u;
  94.                                        continue;
  95.                                    case 18u:
  96.                                        this.int_31++;
  97.                                        num13 = (num2 * 3607809429u ^ 3209382732u);
  98.                                        continue;
  99.                                    case 19u:
  100.                                        this.richTextBox_0.Text = string.Concat(new object[]
  101.                                        {
  102.                                           <Module>.smethod_33<string>(269125423u),
  103.                                           DateTime.Now,
  104.                                           <Module>.smethod_36<string>(1410731607u),
  105.                                           this.int_25,
  106.                                           <Module>.smethod_33<string>(4023285718u),
  107.                                           this.richTextBox_0.Text
  108.                                        });
  109.                                        this.notifyIcon_0.ShowBalloonTip(5000, <Module>.smethod_36<string>(985062527u), <Module>.smethod_36<string>(424440832u) + this.int_25 + <Module>.smethod_33<string>(857325780u), ToolTipIcon.Info);
  110.                                        num13 = (num2 * 4099672421u ^ 2122550757u);
  111.                                        continue;
  112.                                    case 20u:
  113.                                        this.bool_1 = true;
  114.                                        num13 = (num2 * 422663904u ^ 3523545783u);
  115.                                        continue;
  116.                                    case 21u:
  117.                                        num13 = 3417154291u;
  118.                                        continue;
  119.                                    case 22u:
  120.                                        this.bool_6 = true;
  121.                                        num13 = (num2 * 2377530756u ^ 3520413137u);
  122.                                        continue;
  123.                                    case 23u:
  124.                                        num13 = (num2 * 2028743964u ^ 2335731498u);
  125.                                        continue;
  126.                                    case 24u:
  127.                                        this.int_20++;
  128.                                        this.method_25(this.int_20);
  129.                                        num13 = (num2 * 1610931711u ^ 3895470199u);
  130.                                        continue;
  131.                                    case 25u:
  132.                                        this.method_25(this.int_20);
  133.                                        num13 = (num2 * 1699345407u ^ 2237619346u);
  134.                                        continue;
  135.                                    case 26u:
  136.                                        num13 = (num2 * 448998985u ^ 2603675008u);
  137.                                        continue;
  138.                                    case 27u:
  139.                                        num13 = (num2 * 2865887306u ^ 2235582125u);
  140.                                        continue;
  141.                                    case 28u:
  142.                                        this.label_22.Text = <Module>.smethod_35<string>(1523847516u) + this.int_31.ToString();
  143.                                        num13 = (num2 * 606762847u ^ 3385979942u);
  144.                                        continue;
  145.                                    case 29u:
  146.                                        this.streamWriter_1.Close();
  147.                                        num13 = 3646525267u;
  148.                                        continue;
  149.                                    case 30u:
  150.                                        num13 = (num2 * 4058215021u ^ 1300511857u);
  151.                                        continue;
  152.                                    case 31u:
  153.                                        num13 = (num2 * 352037927u ^ 390761754u);
  154.                                        continue;
  155.                                    case 32u:
  156.                                        goto IL_2B1C;
  157.                                    case 33u:
  158.                                        num13 = (num2 * 1110637639u ^ 5971526u);
  159.                                        continue;
  160.                                    case 34u:
  161.                                        this.label_5.ForeColor = Color.Blue;
  162.                                        num13 = (num2 * 1798070680u ^ 2185981926u);
  163.                                        continue;
  164.                                    case 35u:
  165.                                        num13 = (num2 * 3425316977u ^ 2879584443u);
  166.                                        continue;
  167.                                    case 36u:
  168.                                        MessageBox.Show(<Module>.smethod_36<string>(3900295341u));
  169.                                        num13 = 2817477471u;
  170.                                        continue;
  171.                                    case 37u:
  172.                                        this.streamWriter_1.Close();
  173.                                        num13 = (num2 * 1803766645u ^ 3745394553u);
  174.                                        continue;
  175.                                    case 38u:
  176.                                        num13 = ((this.bool_13 ? 1090315439u : 479931277u) ^ num2 * 816866463u);
  177.                                        continue;
  178.                                    case 40u:
  179.                                        this.streamWriter_1 = this.fileInfo_1.AppendText();
  180.                                        num13 = 3378943465u;
  181.                                        continue;
  182.                                    case 41u:
  183.                                        this.label_5.Text = <Module>.smethod_34<string>(3325136810u);
  184.                                        num13 = (num2 * 4242330746u ^ 4157004787u);
  185.                                        continue;
  186.                                    case 42u:
  187.                                        num13 = (num2 * 1401748170u ^ 3948457185u);
  188.                                        continue;
  189.                                    case 43u:
  190.                                        this.bool_1 = true;
  191.                                        this.streamWriter_1.WriteLine(string.Concat(new object[]
  192.                                        {
  193.                                           <Module>.smethod_33<string>(269125423u),
  194.                                           DateTime.Now,
  195.                                           <Module>.smethod_37<string>(2021744322u),
  196.                                           this.int_25,
  197.                                           <Module>.smethod_33<string>(857325780u)
  198.                                        }));
  199.                                        num13 = (num2 * 2291531749u ^ 4049286796u);
  200.                                        continue;
  201.                                    case 44u:
  202.                                        this.button_10.Enabled = false;
  203.                                        num13 = (num2 * 1548058259u ^ 726720218u);
  204.                                        continue;
  205.                                    }
  206.                                    goto Block_68;
  207.                               }
  208.                         }
  209.                         Block_68:;


Как можно превратить их в опрятный код? Или придется глазки напрягать?



Ранг: 88.2 (постоянный), 58thx
Активность: 0.110.04
Статус: Участник

Создано: 25 сентября 2019 18:54
· Личное сообщение · #2

WannaCode
Это конфусер, и уже есть для него деобфускаторы с исходным кодом, так что проще найти на гитхабе готовое и переделать



Ранг: 0.3 (гость)
Активность: 0=0
Статус: Участник

Создано: 25 сентября 2019 19:18
· Личное сообщение · #3

https://github.com/BedTheGod/ConfuserEx-Unpacker-Mod-by-Bed


e6bd_25.09.2019_EXELAB.rU.tgz - Confuserex.Unpacker.Mod.by.Bed.rar




Ранг: 77.2 (постоянный), 73thx
Активность: 0.190.15
Статус: Участник

Создано: 25 сентября 2019 21:06
· Личное сообщение · #4

WannaCode пишет:
Или придется глазки напрягать?

Да, придется..
В коде присутствует декодер строк, найди, декодируй в ASCII - поймёшь логику..




Ранг: 55.9 (постоянный), 29thx
Активность: 0.120.22
Статус: Участник

Создано: 25 сентября 2019 21:09 · Поправил: Adler
· Личное сообщение · #5

Mishar_Hacker пишет:
Это конфусер

А по чем видно, что это именно конфузер, а не какой-то другой обфускактор?
Такое точно Очень похожее и в этом образце после .Net Reactor: --> Link <--
И эту case-кашу привести в читабельный вид так и не удалось, хотя некоторые фрагменты и стали более понятными.

Добавлено спустя 2 минуты
WannaCode, а взглянуть на это приложение можно?


 eXeL@B —› Крэки, обсуждения —› Деобфускация .net
:: Ваш ответ
Жирный  Курсив  Подчеркнутый  Перечеркнутый  {mpf5}  Код  Вставить ссылку 
:s1: :s2: :s3: :s4: :s5: :s6: :s7: :s8: :s9: :s10: :s11: :s12: :s13: :s14: :s15: :s16:


Максимальный размер аттача: 500KB.
Ваш логин: german1505 » Выход » ЛС
   Для печати Для печати