<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Reverse Engineering | Maverick Kaung</title>
    <link>https://www.mavjs.org/tag/reverse-engineering/</link>
      <atom:link href="https://www.mavjs.org/tag/reverse-engineering/index.xml" rel="self" type="application/rss+xml" />
    <description>Reverse Engineering</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Mon, 08 Oct 2018 19:42:33 +0200</lastBuildDate>
    <image>
      <url>https://www.mavjs.org/media/icon_hu268191f709183466a438488e2ba784b7_1058813_512x512_fill_lanczos_center_3.png</url>
      <title>Reverse Engineering</title>
      <link>https://www.mavjs.org/tag/reverse-engineering/</link>
    </image>
    
    <item>
      <title>2018 FLARE-On Challenges Writeup</title>
      <link>https://www.mavjs.org/post/flareon5-writeup/</link>
      <pubDate>Mon, 08 Oct 2018 19:42:33 +0200</pubDate>
      <guid>https://www.mavjs.org/post/flareon5-writeup/</guid>
      <description>&lt;p&gt;I decided to participate in this year&amp;rsquo;s edition of &lt;a href=&#34;https://www.fireeye.com/blog/threat-research/2018/08/announcing-the-fifth-annual-flare-on-challenge.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;FLARE-On challenge&lt;/a&gt;. It is made by the fine folks from FireEye Labs Advanced Reverse Engineering (FLARE) team.&lt;/p&gt;
&lt;p&gt;I wanted to see how far I could go. I did not set any goals nor did I took it as seriously as I would have liked.&lt;/p&gt;


















&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://www.mavjs.org/img/1-flareon.png&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;The challenge is now over and I only managed to make it to the 2 challenge, as expected (you can see the reason why above 😆 ). Let&amp;rsquo;s get on with the challenges.&lt;/p&gt;
&lt;h1 id=&#34;minesweeper-championship-registration&#34;&gt;Minesweeper Championship Registration&lt;/h1&gt;
&lt;p&gt;Simple challenge. Once you open the zipped file, you&amp;rsquo;ll get a &lt;code&gt;jar&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;These days I mostly use &lt;a href=&#34;https://bytecodeviewer.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Bytecode Viewer&lt;/a&gt; when it comes to &lt;code&gt;APK&lt;/code&gt; or &lt;code&gt;jar&lt;/code&gt; files.
Once you open the challenge &lt;code&gt;jar&lt;/code&gt; file with it and navigate to the only class file in there you&amp;rsquo;ll see the following code:&lt;/p&gt;


















&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://www.mavjs.org/img/2-flareon.png&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Rest is history! 😉&lt;/p&gt;
&lt;h1 id=&#34;ultimate-minesweeper&#34;&gt;Ultimate Minesweeper&lt;/h1&gt;
&lt;p&gt;Boy, was I in for a challenge with this one. 😅&lt;/p&gt;
&lt;p&gt;Figured out it was a &lt;code&gt;.NET&lt;/code&gt; binary and remembered a friend of mine talking about their experience decompiling them a few months back, I took this opportunity to try it out.
There might have been an easier way than what I will be describing below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Opened up the binary using &lt;em&gt;Jetbrains&lt;/em&gt;&amp;rsquo;s &lt;a href=&#34;https://www.jetbrains.com/decompiler/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;dotPeek&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Exported it to a Visual Studio project.&lt;/li&gt;
&lt;/ul&gt;


















&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://www.mavjs.org/img/3-1-flareon.png&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;

&lt;ul&gt;
&lt;li&gt;Opened up the solution/project with Visual Studio.&lt;/li&gt;
&lt;li&gt;Started looking into the main class.&lt;/li&gt;
&lt;li&gt;Found a function &lt;code&gt;SquareRevealedCallback&lt;/code&gt; that is used as a callback after each click on the minefield tiles.&lt;/li&gt;
&lt;/ul&gt;


















&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://www.mavjs.org/img/3-2-flareon.png&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;

&lt;ul&gt;
&lt;li&gt;Got to another function &lt;code&gt;BombRevealed&lt;/code&gt; that checks if any minefields were revealed, which returns &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; to the callback function above.&lt;/li&gt;
&lt;/ul&gt;


















&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://www.mavjs.org/img/3-3-flareon.png&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;

&lt;ul&gt;
&lt;li&gt;Modified the &lt;code&gt;if&lt;/code&gt; statement in &lt;code&gt;BombRevealed&lt;/code&gt; as below and rest is some clicking. 😆&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-C#&#34; data-lang=&#34;C#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; (!&lt;span style=&#34;color:#66d9ef&#34;&gt;this&lt;/span&gt;.MinesPresent[index2, index1])
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    System.Console.WriteLine(index1 + &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    System.Console.WriteLine(index2 + &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

















&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://www.mavjs.org/img/3-4-flareon.png&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Definitely going to hone my skills before next year&amp;rsquo;s FLARE-on challenge! 💪 😎&lt;/p&gt;
&lt;p&gt;Also check out a more in-depth thorough writeup of the challenges from the authors: &lt;a href=&#34;https://www.fireeye.com/blog/threat-research/2018/10/2018-flare-on-challenge-solutions.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://www.fireeye.com/blog/threat-research/2018/10/2018-flare-on-challenge-solutions.html&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
