在IDA Pro更改值中编辑伪代码

时间:2018-10-06 16:20:28

标签: linux edit elf ida

您好,我正在寻找有关如何使用IDA PRO编辑或更改(改写)elf二进制文件的帮助或任何教程。当我使用IDA Pro打开文件时,我搜索要编辑的位置,然后按F5键,我看到了伪代码

    void __usercall TSkillFed::Event(TSkillFed *const this@<esi>, char *a2@<eax>, 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) && !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] > 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] > v7 )
          v6[5] = v7;
      }
    }
  }
  else
  {
    error(a2, "TSkillFed::Event: GetMaster liefert NULL zurueck!\n");
  }
}

如何更改显示SecsPerMana = 2;的位置?

我想更改SecsPerMana所在的所有行。我要用数字1更改它们吗?

还在那之后更改了如何将其保存在文件上吗?

0 个答案:

没有答案