title: Crack linux executable
body: <p>I have a linux executable and its disassembly (in particular, the program checks if I'm superuser, and if so, output some message by executing function "start_reactor" and exit; if I'm not a superuser the program call another function "check_password"), what I need is to find a way to crack it (execute function "start_reactor") by entering some specific string as an input for function "check_password".</p>
  
  <p>Below is dissasembly of an executable.. </p>
  
  <pre><code>08048504 &lt;check_password&gt;:
  8048504:    55                   push   ebp
  8048505:    89 e5                mov    ebp,esp
  8048507:    b8 00 00 00 00       mov    eax,0x0
  804850c:    5d                   pop    ebp
  804850d:    c3                   ret    
  
  0804850e &lt;start_reactor&gt;:
  804850e:    55                   push   ebp
  804850f:    89 e5                mov    ebp,esp
  8048511:    83 ec 04             sub    esp,0x4
  8048514:    c7 04 24 90 86 04 08 mov    DWORD PTR [esp],0x8048690
  804851b:    e8 0c ff ff ff       call   804842c &lt;printf@plt&gt;
  8048520:    c7 04 24 2e 00 00 00 mov    DWORD PTR [esp],0x2e
  8048527:    e8 d0 fe ff ff       call   80483fc &lt;putchar@plt&gt;
  804852c:    a1 60 98 04 08       mov    eax,ds:0x8049860
  8048531:    89 04 24             mov    DWORD PTR [esp],eax
  8048534:    e8 e3 fe ff ff       call   804841c &lt;fflush@plt&gt;
  8048539:    c7 04 24 01 00 00 00 mov    DWORD PTR [esp],0x1
  8048540:    e8 07 ff ff ff       call   804844c &lt;sleep@plt&gt;
  8048545:    eb d9                jmp    8048520 &lt;start_reactor+0x12&gt;
  
  08048547 &lt;main&gt;:
  8048547:    55                   push   ebp
  8048548:    89 e5                mov    ebp,esp
  804854a:    83 ec 1c             sub    esp,0x1c
  804854d:    c7 45 f8 be ba fe ca mov    DWORD PTR [ebp-0x8],0xcafebabe
  8048554:    e8 e3 fe ff ff       call   804843c &lt;getuid@plt&gt;
  8048559:    85 c0                test   eax,eax
  804855b:    0f 94 c0             sete   al
  804855e:    0f b6 c0             movzx  eax,al
  8048561:    89 45 fc             mov    DWORD PTR [ebp-0x4],eax
  8048564:    83 7d fc 00          cmp    DWORD PTR [ebp-0x4],0x0
  8048568:    75 24                jne    804858e &lt;main+0x47&gt;
  804856a:    c7 04 24 b0 86 04 08 mov    DWORD PTR [esp],0x80486b0
  8048571:    e8 b6 fe ff ff       call   804842c &lt;printf@plt&gt;
  8048576:    a1 60 98 04 08       mov    eax,ds:0x8049860
  804857b:    89 04 24             mov    DWORD PTR [esp],eax
  804857e:    e8 99 fe ff ff       call   804841c &lt;fflush@plt&gt;
  8048583:    8d 45 e8             lea    eax,[ebp-0x18]
  8048586:    89 04 24             mov    DWORD PTR [esp],eax
  8048589:    e8 5e fe ff ff       call   80483ec &lt;gets@plt&gt;
  804858e:    81 7d f8 be ba fe ca cmp    DWORD PTR [ebp-0x8],0xcafebabe
  8048595:    74 18                je     80485af &lt;main+0x68&gt;
  8048597:    c7 04 24 d8 86 04 08 mov    DWORD PTR [esp],0x80486d8
  804859e:    e8 b9 fe ff ff       call   804845c &lt;puts@plt&gt;
  80485a3:    c7 04 24 ff ff ff ff mov    DWORD PTR [esp],0xffffffff
  80485aa:    e8 bd fe ff ff       call   804846c &lt;exit@plt&gt;
  80485af:    83 7d fc 00          cmp    DWORD PTR [ebp-0x4],0x0
  80485b3:    75 0f                jne    80485c4 &lt;main+0x7d&gt;
  80485b5:    8d 45 e8             lea    eax,[ebp-0x18]
  80485b8:    89 04 24             mov    DWORD PTR [esp],eax
  80485bb:    e8 44 ff ff ff       call   8048504 &lt;check_password&gt;
  80485c0:    85 c0                test   eax,eax
  80485c2:    74 05                je     80485c9 &lt;main+0x82&gt;
  80485c4:    e8 45 ff ff ff       call   804850e &lt;start_reactor&gt;
  80485c9:    c9                   leave  
  80485ca:    c3                   ret    
  80485cb:    90                   nop    
  80485cc:    90                   nop    
  80485cd:    90                   nop    
  80485ce:    90                   nop    
  80485cf:    90                   nop    
  </code></pre>
  
  <p>..and result of a reverse ingeneering using IDA.</p>
  
  <pre><code>int __cdecl main()
  {
    __uid_t v0; // eax@1
    int result; // eax@7
    char s; // [sp+4h] [bp-18h]@2
    int v3; // [sp+14h] [bp-8h]@1
    bool v4; // [sp+18h] [bp-4h]@1
  
    v3 = -889275714;
    v0 = getuid();
    v4 = v0 == 0;
    if ( v0 != 0 )
    {
      printf("Please enter the password to continue: ");
      fflush(stdout);
      gets(&amp;s);
    }
    if ( v3 != -889275714 )
    {
      puts(" ");
      exit(-1);
    }
    if ( v4 || (result = check_password()) != 0 )
      start_reactor();
    return result;
  }
  </code></pre>
  
  <p>I'm really new to Assembler.. :(</p>