<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>slvdr510.dev - CTF</title>
    <subtitle>Personal blog about Linux and development.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://slvdr510.dev/tags/ctf/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://slvdr510.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-10-05T00:00:00+00:00</updated>
    <id>https://slvdr510.dev/tags/ctf/atom.xml</id>
    <entry xml:lang="en">
        <title>Reversing XOR encryption in a CTF</title>
        <published>2026-10-05T00:00:00+00:00</published>
        <updated>2026-10-05T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://slvdr510.dev/blog/0001-ctf-xor-encryption/"/>
        <id>https://slvdr510.dev/blog/0001-ctf-xor-encryption/</id>
        
        <content type="html" xml:base="https://slvdr510.dev/blog/0001-ctf-xor-encryption/">&lt;h1 id=&quot;my-very-first-ctf-at-uhu&quot;&gt;My very first CTF at &lt;a rel=&quot;external&quot; href=&quot;https://uhu.es&quot;&gt;UHU&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;I decided to participate on my first CTF with a group of students wich were also new organizing this kind of events.&lt;/p&gt;
&lt;p&gt;This post is about what they teach to us to begin using Ghidra to reverse engineering.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;1-installing-ghidra&quot;&gt;1. Installing Ghidra&lt;/h2&gt;
&lt;p&gt;I decided to download it via Discover (Flatpak) to reduce the friction of installing the program.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/01.webp&quot; alt=&quot;Install Ghidra from Flatpak&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;2-ghidra-new-project&quot;&gt;2. Ghidra new project&lt;/h2&gt;
&lt;p&gt;Once we opened the program, we have to create a new project.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;File &amp;gt; New Project &amp;gt; Non-Shared project &amp;gt; Next &amp;gt; Type a name for the project &amp;gt; Finish&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/02.webp&quot; alt=&quot;Ghidra project menu&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Download the &lt;code&gt;.exe&lt;/code&gt; I’m going to analyze by clicking &lt;a href=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/reto_final.exe&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/reto_prueba.exe&quot;&gt;this&lt;/a&gt; is another one I’m not covering on the post, but it’s suposed to be the initial one we had to learn the fundamentals.&lt;/p&gt;
&lt;p&gt;Import the file to the project doing click to &lt;code&gt;File &amp;gt; Import File&lt;/code&gt; and selecting it.&lt;/p&gt;
&lt;p&gt;Should look similar to the following image.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/03.webp&quot; alt=&quot;Ghidra project with the .exe file on it&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Double click the &lt;code&gt;.exe&lt;/code&gt; file under folder with the name of the project.&lt;/p&gt;
&lt;p&gt;A dragon image should splash on the screen, after that, you should see something similar to this.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/04.webp&quot; alt=&quot;.exe opened with ghidra&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;3-runing-the-exe-file&quot;&gt;3. Runing the .exe file&lt;/h2&gt;
&lt;p&gt;In my case, as I’m using linux, I’ll use wine to run the .exe file.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/05.webp&quot; alt=&quot;.exe shell output&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As you can see, we have some strings to begin with out of running the program.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;4-finding-uses-of-the-strings&quot;&gt;4. Finding uses of the strings&lt;/h2&gt;
&lt;p&gt;On &lt;code&gt;CodeBrowser&lt;/code&gt; window, click to &lt;code&gt;Window &amp;gt; Defined Strings&lt;/code&gt; and let’s search one of the strings we saw earlier. For example, &lt;code&gt;ACCESO DENEGADO&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Use the search bar &lt;code&gt;Filter:&lt;/code&gt; and write there the string and double click on the red squared text.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/06.webp&quot; alt=&quot;find string&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As you can see, &lt;code&gt;CodeBrowser&lt;/code&gt; left window, jumped into the section where it used the string.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/07.webp&quot; alt=&quot;code browser moved into the function of the string&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now click on one of the functions of the section of the code highlighted after doing double click to the string we fount before.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/08.webp&quot; alt=&quot;click to the function of the section&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The right window (Decompile window) will show us the code generated by &lt;code&gt;Ghidra&lt;/code&gt; from the binary where the string was being used.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/09.webp&quot; alt=&quot;Decompile window jumped into the interestin code&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There you can have a view of the code.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#1F2328, #D5CED9); background-color: light-dark(#FFFFFF, #23262E);&quot; &gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;undefined8 &lt;/span&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;FUN_140001528&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;undefined8 &lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;param_1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;undefined8 &lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;param_2&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;undefined8 &lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;undefined8 &lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;  size_t&lt;/span&gt;&lt;span&gt; longitud_input&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  ulonglong uVar1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  byte local_98 &lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;32&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  byte miNumero &lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;100&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;  int&lt;/span&gt;&lt;span&gt; tope&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;  int&lt;/span&gt;&lt;span&gt; i&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;  int&lt;/span&gt;&lt;span&gt; local_c&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_140001740&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  tope &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;15&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  uVar1 &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;762f1d252c733130&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;0&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 5&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;1&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 6&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;2&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 5&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;3&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;39&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;4&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;30&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;5&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;71&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;6&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;34&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;7&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;71&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;8&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;30&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;9&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;31&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;10&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;73&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;b&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;2c&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;c&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;25&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;d&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;1d&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;e&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;2f&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;f&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;76&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;10&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;31&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;11&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;36&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;12&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;71&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;13&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;30&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;  local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;14&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;3f&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;================================&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;762f1d252c733130&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;          RETO FINAL            &lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;uVar1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;================================&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;uVar1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;Introduce la flag para ganar :) &lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;uVar1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_140001480&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;DAT_140010071&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;miNumero&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  longitud_input &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt; strlen&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;char&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; *&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;miNumero&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;  if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;longitud_input &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;==&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;longlong&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;tope&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    local_c &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;    for&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt; i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span&gt; tope&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt; i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span&gt; i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      longitud_input &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;size_t&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;uint&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;int&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;char&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;miNumero&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; ^&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;42&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;      if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;int&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;char&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;miNumero&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; ^&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;42&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; !=&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;uint&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        local_c &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;        break&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;    if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;local_c &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 0&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;      FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;Acceso denegado, no es la flag correcta&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;longitud_input&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                   )&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;    else&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;      FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;FELICIDADES, LLAMAME PARA RECLAMAR TU PREMIO!!! &lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;longitud_input&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;  else&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;    FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt; ACCESO DENEGADO, LONGITUD DE LA FLAG ERRONEA &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;longitud_input&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                  param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;5-understanding-the-code&quot;&gt;5. Understanding the code&lt;/h2&gt;
&lt;p&gt;The code reads data from text input, compares the length of the input string with another variable which has the size of the string, in this case I changed the name of the variable to be &lt;code&gt;tope&lt;/code&gt; and it’s value &lt;code&gt;tope = 0x15;&lt;/code&gt; when hovering it, it show us some hints of what can it be &lt;code&gt;21 decimal&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So the length of the string must be 21.&lt;/p&gt;
&lt;p&gt;On this part of the code we see our text input being compared with &lt;code&gt;local_98[i]&lt;/code&gt; after applying &lt;code&gt;XOR&lt;/code&gt; with base &lt;code&gt;0x42&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#1F2328, #D5CED9); background-color: light-dark(#FFFFFF, #23262E);&quot; &gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;for&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt; i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span&gt; tope&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt; i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span&gt; i &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 1&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      longitud_input &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;size_t&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;uint&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;int&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;char&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;miNumero&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; ^&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;42&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;      if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;int&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;char&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;miNumero&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; ^&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;42&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; !=&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;uint&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        local_c &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;        break&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the result of the &lt;code&gt;XOR&lt;/code&gt; to each character of the input text is not equal to &lt;code&gt;local_98[i]&lt;/code&gt;, &lt;code&gt;local_c&lt;/code&gt; will be &lt;code&gt;0&lt;/code&gt; then the loop breaks and will not be &lt;code&gt;1&lt;/code&gt; which is what we need to get the flag.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#1F2328, #D5CED9); background-color: light-dark(#FFFFFF, #23262E);&quot; &gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;local_c &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 0&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;Acceso denegado, no es la flag correcta&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;longitud_input&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;               )&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;else&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#8250DF, #FFE66D);&quot;&gt;  FUN_1400014d4&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;byte &lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;FELICIDADES, LLAMAME PARA RECLAMAR TU PREMIO!!! &lt;/span&gt;&lt;span style=&quot;color: light-dark(#0A3069, #96E072);&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;longitud_input&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                param_3&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;param_4&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At the begin of the file, we have the values asigned to &lt;code&gt;local_98[]&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color-scheme: light dark; color: light-dark(#1F2328, #D5CED9); background-color: light-dark(#FFFFFF, #23262E);&quot; &gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;0&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 5&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;1&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 6&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;2&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt; 5&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;3&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;39&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;4&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;30&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;5&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;71&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;6&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;34&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;7&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;71&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;8&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;30&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;9&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;31&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;10&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;73&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;b&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;2c&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;c&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;25&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;d&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;1d&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;e&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;2f&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;f&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;76&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;10&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;31&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;11&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;36&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;12&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;71&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;13&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;30&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: light-dark(#953800, #00E8C6);&quot;&gt;local_98&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;14&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #EE5D43);&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: light-dark(#CF222E, #C74DED);&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: light-dark(#0550AE, #F39C12);&quot;&gt;3f&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;6-cyberchief-to-the-rescue&quot;&gt;6. CyberChief to the rescue!&lt;/h2&gt;
&lt;p&gt;We can use &lt;a rel=&quot;external&quot; href=&quot;https://gchq.github.io/CyberChef/&quot;&gt;CyberChief&lt;/a&gt; to see what we get from the hex values after applying XOR with 0x42 base.&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;HEX&lt;/code&gt; in &lt;code&gt;operations&lt;/code&gt; search , then drag and drop &lt;code&gt;From HEX&lt;/code&gt; to the &lt;code&gt;recipe&lt;/code&gt; container.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/10.webp&quot; alt=&quot;cyberchief searching HEX&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;operations&lt;/code&gt; filter, type &lt;code&gt;XOR&lt;/code&gt; and drag and drop it under the &lt;code&gt;From HEX&lt;/code&gt; block.&lt;/p&gt;
&lt;p&gt;Also, don’t forget to set the key to 42 as you could see from &lt;code&gt;(miNumero[i] ^ 0x42)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/11.webp&quot; alt=&quot;complete recipe&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then we can dump the HEX values of the &lt;code&gt;local_98[]&lt;/code&gt; in the same order and write them on the &lt;code&gt;Input&lt;/code&gt; box of &lt;code&gt;CyberChef&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The string of all the HEX values on a line should be this &lt;code&gt;05060539307134713031732c251d2f76313671303f&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;The 3 first values: &lt;code&gt;local_98[0] = 5;&lt;/code&gt;, &lt;code&gt;local_98[1] = 6;&lt;/code&gt;, &lt;code&gt;local_98[2] = 5;&lt;/code&gt; must have a 0 before, as all the following values of &lt;code&gt;local_98[]&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So after pasting this into the input, we can have the value needed to get the winner message.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/12.webp&quot; alt=&quot;input output of cyberchief&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;7-checking-if-we-won&quot;&gt;7. Checking if we won&lt;/h2&gt;
&lt;p&gt;It’s as easy as runing the program with the text we got earlier.&lt;/p&gt;
&lt;p&gt;Then we can enter &lt;code&gt;GDG{r3v3rs1ng_m4st3r}&lt;/code&gt; to the input of the &lt;code&gt;.exe&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/13.webp&quot; alt=&quot;winner message&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Et voilà! Winner winner chicken dinner.&lt;/p&gt;
&lt;hr /&gt;
&lt;h2 id=&quot;extra&quot;&gt;Extra&lt;/h2&gt;
&lt;p&gt;There is a memmory of the event.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://slvdr510.dev/blog/0001-ctf-xor-encryption/14.webp&quot; alt=&quot;picture of the IRL event&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By the way, I’m the one with the laptop covered of dev/hacker stickers.&lt;/p&gt;
&lt;p&gt;Found myself as a shiny pokémon on the image.&lt;/p&gt;
&lt;p&gt;Thank you to the guy next to me which also helped using Ghidra.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Thank you for reading. &amp;lt;3&lt;/p&gt;
</content>
        
    </entry>
</feed>
