title: Edit pseudo-code in IDA Pro change values
body: <p>Hello I was looking for some help or any tutorial on how to edit or change (rwrite) an elf binary file with IDA PRO. When I open the file with IDA Pro I search where I want to edit, after that I press F5 I see the pseudo-code</p>
  
  <pre><code>    void __usercall TSkillFed::Event(TSkillFed *const this@&lt;esi&gt;, char *a2@&lt;eax&gt;, int a3)
  {
    int v3; // ebx
    char *v4; // eax
    signed int v5; // edi
    _DWORD *v6; // ebx
    int v7; // eax
    _DWORD *v8; // edi
    int v9; // eax
    int SecsPerMana; // [esp+18h] [ebp-10h]
  
    v3 = *(_DWORD *)(a3 + 16);
    if ( v3 )
    {
      if ( !*(_BYTE *)(v3 + 656) &amp;&amp; !IsProtectionZone(*(_DWORD *)(v3 + 624), *(_DWORD *)(v3 + 628), *(_DWORD *)(v3 + 632)) )
      {
        SecsPerMana = 6;
        v4 = 0;
        v5 = 12;
        if ( !*(_DWORD *)(v3 + 652) )
          v4 = (char *)TPlayer::GetActiveProfession((TPlayer *const )v3);
        switch ( (unsigned int)v4 )
        {
          case 0u:
          case 1u:
            v5 = 6;
            goto LABEL_9;
          case 2u:
            SecsPerMana = 4;
            v5 = 8;
            break;
          case 3u:
          case 4u:
            v5 = 12;
            goto LABEL_18;
          case 0xBu:
            v5 = 4;
  LABEL_9:
            SecsPerMana = 6;
            break;
          case 0xCu:
            v5 = 6;
  LABEL_18:
            SecsPerMana = 3;
            break;
          case 0xDu:
          case 0xEu:
            SecsPerMana = 2;
            v5 = 12;
            break;
          default:
            error(v4, "TSkillFed::Event: Unbekannter Beruf %d.\n", v4);
            break;
        }
        if ( !((*(int (__cdecl **)(int))(*(_DWORD *)a3 + 52))(a3) % v5) )
        {
          v8 = *(_DWORD **)(v3 + 12);
          (*(void (__cdecl **)(_DWORD, int))(*v8 + 8))(*(_DWORD *)(v3 + 12), v8[5] + 1);
          v9 = v8[6];
          if ( v8[5] &gt; v9 )
            v8[5] = v9;
        }
        if ( !((*(int (__cdecl **)(int))(*(_DWORD *)a3 + 52))(a3) % SecsPerMana) )
        {
          v6 = *(_DWORD **)(v3 + 16);
          (*(void (__cdecl **)(_DWORD *, int))(*v6 + 8))(v6, v6[5] + 2);
          v7 = v6[6];
          if ( v6[5] &gt; v7 )
            v6[5] = v7;
        }
      }
    }
    else
    {
      error(a2, "TSkillFed::Event: GetMaster liefert NULL zurueck!\n");
    }
  }
  </code></pre>
  
  <p>How I can change where it says <code>SecsPerMana = 2;</code>?</p>
  
  <p>I want to change all the lines where <code>SecsPerMana</code> are. I want change them with number 1?</p>
  
  <p>Also after that changes how to save it on the file?</p>